Skip to content

Commit faee18e

Browse files
authored
Fix healthcheck issue where defined in image (#618)
Fix #598 Signed-off-by: Sagi Shnaidman <[email protected]>
1 parent e4cd2c4 commit faee18e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/module_utils/podman/podman_container_lib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -943,12 +943,12 @@ def diffparam_group_add(self):
943943
# Healthcheck is only defined in container config if a healthcheck
944944
# was configured; otherwise the config key isn't part of the config.
945945
def diffparam_healthcheck(self):
946+
before = ''
946947
if 'healthcheck' in self.info['config']:
947948
# the "test" key is a list of 2 items where the first one is
948949
# "CMD-SHELL" and the second one is the actual healthcheck command.
949-
before = self.info['config']['healthcheck']['test'][1]
950-
else:
951-
before = ''
950+
if len(self.info['config']['healthcheck']['test']) > 1:
951+
before = self.info['config']['healthcheck']['test'][1]
952952
after = self.params['healthcheck'] or before
953953
return self._diff_update_and_compare('healthcheck', before, after)
954954

0 commit comments

Comments
 (0)