summaryrefslogtreecommitdiff
path: root/libpod/define/sdnotify.go
blob: 1d548c764ed55a8e584c863739d1f4e30722593f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
	}
}