mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00

Integrate sd-notify policies into `kube play`. The policies can be configured for all contianers via the `io.containers.sdnotify` annotation or for indidivual containers via the `io.containers.sdnotify/$name` annotation. The `kube play` process will wait for all containers to be ready by waiting for the individual `READY=1` messages which are received via the `pkg/systemd/notifyproxy` proxy mechanism. Also update the simple "container" sd-notify test as it did not fully test the expected behavior which became obvious when adding the new tests. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
21 lines
570 B
Go
21 lines
570 B
Go
package define
|
|
|
|
import "fmt"
|
|
|
|
// Strings used for --sdnotify option to podman
|
|
const (
|
|
SdNotifyModeContainer = "container"
|
|
SdNotifyModeConmon = "conmon"
|
|
SdNotifyModeIgnore = "ignore"
|
|
)
|
|
|
|
// ValidateSdNotifyMode validates the specified mode.
|
|
func ValidateSdNotifyMode(mode string) error {
|
|
switch mode {
|
|
case "", SdNotifyModeContainer, SdNotifyModeConmon, SdNotifyModeIgnore:
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("%w: invalid sdnotify value %q: must be %s, %s or %s", ErrInvalidArg, mode, SdNotifyModeContainer, SdNotifyModeConmon, SdNotifyModeIgnore)
|
|
}
|
|
}
|