diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 0285a8c8..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,128 +0,0 @@ ---- - -env: - DEST_BRANCH: "main" - GOPATH: "/var/tmp/go" - GOBIN: "${GOPATH}/bin" - GOCACHE: "${GOPATH}/cache" - GOSRC: "${GOPATH}/src/github.com/containers/podman" - CIRRUS_WORKING_DIR: "${GOPATH}/src/github.com/containers/podman-py" - SCRIPT_BASE: "./contrib/cirrus" - CIRRUS_SHELL: "/bin/bash" - HOME: "/root" # not set by default - - #### - #### Cache-image names to test with (double-quotes around names are critical) - #### - FEDORA_NAME: "fedora-35" - PRIOR_FEDORA_NAME: "fedora-34" - UBUNTU_NAME: "ubuntu-2110" - - # Google-cloud VM Images - IMAGE_SUFFIX: "c4764556961513472" - FEDORA_CACHE_IMAGE_NAME: "fedora-podman-py-${IMAGE_SUFFIX}" - - -gcp_credentials: ENCRYPTED[0c639039cdd3a9a93fac7746ea1bf366d432e5ff3303bf293e64a7ff38dee85fd445f71625fa5626dc438be2b8efe939] - - -# Default VM to use unless set or modified by task -gce_instance: - image_project: "libpod-218412" - zone: "us-central1-c" # Required by Cirrus for the time being - cpu: 2 - memory: "4Gb" - disk: 200 # Required for performance reasons - image_name: "${FEDORA_CACHE_IMAGE_NAME}" - -gating_task: - name: "Gating test" - alias: gating - - # Only run this on PRs, never during post-merge testing. This is also required - # for proper setting of EPOCH_TEST_COMMIT value, required by validation tools. - only_if: $CIRRUS_PR != "" - - timeout_in: 20m - - env: - PATH: ${PATH}:${GOPATH}/bin - - script: - - make - - make lint - -test_task: - name: "Test on $FEDORA_NAME" - alias: test - - depends_on: - - gating - - script: - - ${SCRIPT_BASE}/enable_ssh.sh - - ${SCRIPT_BASE}/build_podman.sh - - ${SCRIPT_BASE}/enable_podman.sh - - ${SCRIPT_BASE}/test.sh - -latest_task: - name: "Test Podman main on $FEDORA_NAME" - alias: latest - allow_failures: true - - depends_on: - - gating - - env: - PATH: ${PATH}:${GOPATH}/bin - - script: - - ${SCRIPT_BASE}/enable_ssh.sh - - ${SCRIPT_BASE}/build_podman.sh - - ${SCRIPT_BASE}/enable_podman.sh - - ${SCRIPT_BASE}/test.sh - -# This task is critical. It updates the "last-used by" timestamp stored -# in metadata for all VM images. This mechanism functions in tandem with -# an out-of-band pruning operation to remove disused VM images. -meta_task: - alias: meta - name: "VM img. keepalive" - - container: &smallcontainer - image: "quay.io/libpod/imgts:$IMAGE_SUFFIX" - cpu: 1 - memory: 1 - - env: - IMGNAMES: ${FEDORA_CACHE_IMAGE_NAME} - BUILDID: "${CIRRUS_BUILD_ID}" - REPOREF: "${CIRRUS_REPO_NAME}" - GCPJSON: ENCRYPTED[e8a53772eff6e86bf6b99107b6e6ee3216e2ca00c36252ae3bd8cb29d9b903ffb2e1a1322ea810ca251b04f833b8f8d9] - GCPNAME: ENCRYPTED[fb878daf188d35c2ed356dc777267d99b59863ff3abf0c41199d562fca50ba0668fdb0d87e109c9eaa2a635d2825feed] - GCPPROJECT: "libpod-218412" - - clone_script: &noop mkdir -p $CIRRUS_WORKING_DIR - script: /usr/local/bin/entrypoint.sh - -# Status aggregator for all tests. This task simply ensures a defined -# set of tasks all passed, and allows confirming that based on the status -# of this task. -success_task: - name: "Total Success" - alias: success - - # N/B: ALL tasks must be listed here, minus their '_task' suffix. - depends_on: - - meta - - gating - - test - - latest - container: - image: quay.io/libpod/alpine:latest - cpu: 1 - memory: 1 - env: - CIRRUS_SHELL: "/bin/sh" - clone_script: *noop - script: *noop diff --git a/podman/domain/containers_create.py b/podman/domain/containers_create.py index c24b3cdf..11b08fc0 100644 --- a/podman/domain/containers_create.py +++ b/podman/domain/containers_create.py @@ -74,6 +74,7 @@ def create( process will run as. healthcheck (Dict[str,Any]): Specify a test to perform to check that the container is healthy. + health_check_on_failure_action (int): Specify an action if a healthcheck fails. hostname (str): Optional hostname for the container. init (bool): Run an init inside the container that forwards signals and reaps processes init_path (str): Path to the docker-init binary @@ -340,6 +341,7 @@ def to_bytes(size: Union[int, str, None]) -> Union[int, None]: "expose": {}, "groups": pop("group_add"), "healthconfig": pop("healthcheck"), + "health_check_on_failure_action": pop("health_check_on_failure_action"), "hostadd": [], "hostname": pop("hostname"), "httpproxy": pop("use_config_proxy"), diff --git a/podman/tests/integration/test_container_create.py b/podman/tests/integration/test_container_create.py index a3f4fc79..ddbfdf00 100644 --- a/podman/tests/integration/test_container_create.py +++ b/podman/tests/integration/test_container_create.py @@ -67,6 +67,14 @@ def _test_memory_limit(self, parameter_name, host_config_name): test['expected_value'], ) + def test_container_healtchecks(self): + """Test passing various healthcheck options""" + parameters = {} + parameters['healthcheck'] = {'Test': ['CMD-SHELL curl http://localhost || exit']} + parameters['health_check_on_failure_action'] = 1 + container = self.client.containers.create(self.alpine_image, **parameters) + self.containers.append(container) + def test_container_mem_limit(self): """Test passing memory limit""" self._test_memory_limit('mem_limit', 'Memory')