Skip to content

Commit 0baafcf

Browse files
committed
T6686: adds explicit disable option
1 parent f790046 commit 0baafcf

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

interface-definitions/container.xml.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,12 @@
561561
<help>Configure health check for the container</help>
562562
</properties>
563563
<children>
564+
<leafNode name="disable">
565+
<properties>
566+
<help>Disable health check if container has one defined</help>
567+
<valueless/>
568+
</properties>
569+
</leafNode>
564570
<leafNode name="command">
565571
<properties>
566572
<help>Health check command to run for the container</help>

smoketest/scripts/cli/test_container.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def test_basic(self):
8383

8484
self.cli_set(base_path + ['name', cont_name, 'image', busybox_image])
8585
self.cli_set(base_path + ['name', cont_name, 'allow-host-networks'])
86+
self.cli_set(base_path + ['name', cont_name, 'health-check', 'disable'])
8687
self.cli_set(
8788
base_path
8889
+ [

src/conf_mode/container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ def generate_run_arguments(name, container_config):
432432
if 'retries' in container_config['health_check']:
433433
health_rt = container_config['health_check']['retries']
434434
healthcheck += f' --health-retries={health_rt}'
435-
else:
436-
healthcheck = ' --no-healthcheck'
435+
if 'disable' in container_config['health_check']:
436+
health_check = f' --no-healthcheck'
437437

438438
command = ''
439439
if 'command' in container_config:

0 commit comments

Comments
 (0)