Fix docker RA behavior when Docker is not running

This commit is contained in:
bizhiyuan 2024-03-01 15:25:58 +08:00
parent 95d859fb1a
commit 11064daaa6
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From ed418237891d4a5003ba3513e417d34fa86bbb52 Mon Sep 17 00:00:00 2001
From: Ryan Ronnander <rronnander@linbit.com>
Date: Fri, 23 Feb 2024 10:00:28 -0800
Subject: [PATCH] Fix docker RA behavior when Docker isn't running
---
heartbeat/docker | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/heartbeat/docker b/heartbeat/docker
index 2adcadee..50523db9 100755
--- a/heartbeat/docker
+++ b/heartbeat/docker
@@ -293,8 +293,8 @@ docker_simple_status()
VERSION_OUT=$(docker version)
version_ret=$?
if [ $version_ret -eq 1 ]; then
- ocf_exit_reason "Docker service is in error state while checking for ${CONTAINER}, based on image, ${OCF_RESKEY_image}: ${VERSION_OUT}"
- return $OCF_ERR_GENERIC
+ ocf_log err "Docker service is not running or in error state while checking for ${CONTAINER}, based on image, ${OCF_RESKEY_image}: ${VERSION_OUT}"
+ return $OCF_NOT_RUNNING
fi
container_exists
--
2.41.0

View File

@ -1,7 +1,7 @@
Name: resource-agents Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.13.0 Version: 4.13.0
Release: 7 Release: 8
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/resource-agents URL: https://github.com/ClusterLabs/resource-agents
Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz
@ -12,6 +12,8 @@ Patch0003: fix-handler-out-of-scope-leak.patch
Patch0004: fix-uninitialized-value-covscan-error.patch Patch0004: fix-uninitialized-value-covscan-error.patch
Patch0005: Avoid-false-positive-for-VG-activation.patch Patch0005: Avoid-false-positive-for-VG-activation.patch
Patch0006: Don-t-build-with-ansi-by-default.patch Patch0006: Don-t-build-with-ansi-by-default.patch
Patch0007: Fix-docker-RA-behavior-when-Docker-isn-t-running.patch
Obsoletes: heartbeat-resources <= %{version} Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version} Provides: heartbeat-resources = %{version}
BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel
@ -109,6 +111,9 @@ export CFLAGS="$(echo '%{optflags}')"
%{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*}
%changelog %changelog
* Fri Mar 01 2024 bizhiyuan <bizhiyuan@kylinos.cn> - 4.13.0-8
- Fix docker RA behavior when Docker is not running
* Fri Feb 23 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-7 * Fri Feb 23 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-7
- Don't build with -ansi by default - Don't build with -ansi by default