podman/pkg/specgen
Jasmin Oster d7fa0aa351
Pass the restart policy to the individual containers
Healthchecks, defined in a .yaml file as livenessProbe did not had any
effect. They were executing as intended, containers were marked as
unhealthy, yet no action was taken. This was never the intended
behaviour, as observed by the comment:

> if restart policy is in place, ensure the health check enforces it

A minimal example is tracked in containers/podman#20903 [1] with the
following YAML:

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: ubi-httpd-24
spec:
  restartPolicy: Always
  containers:
    - name: ubi8-httpd
      image: registry.access.redhat.com/rhscl/httpd-24-rhel7:2.4-217
      livenessProbe:
        httpGet:
          path: "/"
          port: 8081
```

By passing down the restart policy (and using constants instead of
actually wrong hard-coded ones), Podman actually restarts the container
now.

[1]: https://github.com/containers/podman/issues/20903

Closes #20903.

Signed-off-by: Jasmin Oster <nachtjasmin@posteo.de>
2024-03-11 20:39:54 +01:00
..
generate Pass the restart policy to the individual containers 2024-03-11 20:39:54 +01:00
container_validate.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
namespaces.go Merge pull request #21512 from Luap99/pasta-netname-removal 2024-02-08 17:17:55 +00:00
namespaces_test.go drop support for "pasta" as a network name 2024-02-05 13:57:24 +01:00
pod_validate.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
podspecgen.go Add --restart flag to pod create 2023-05-02 10:29:58 -04:00
resources_freebsd.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
resources_linux.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
specgen.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
specgen_local.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_remote.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_test.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
utils.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
volumes.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
winpath.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
winpath_linux.go refactor(machine): improve machine marker value 2023-11-28 21:47:12 +08:00
winpath_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
winpath_windows.go Fix Lint on Windows and enable the job 2024-02-20 08:06:18 -05:00