github.com/containers/podman/v4@v4.9.4/libpod/define/sdnotify.go (about)

     1  package define
     2  
     3  import "fmt"
     4  
     5  // Strings used for --sdnotify option to podman
     6  const (
     7  	SdNotifyModeConmon    = "conmon"
     8  	SdNotifyModeContainer = "container"
     9  	SdNotifyModeHealthy   = "healthy"
    10  	SdNotifyModeIgnore    = "ignore"
    11  )
    12  
    13  // ValidateSdNotifyMode validates the specified mode.
    14  func ValidateSdNotifyMode(mode string) error {
    15  	switch mode {
    16  	case "", SdNotifyModeContainer, SdNotifyModeConmon, SdNotifyModeIgnore, SdNotifyModeHealthy:
    17  		return nil
    18  	default:
    19  		return fmt.Errorf("%w: invalid sdnotify value %q: must be %s, %s, %s or %s", ErrInvalidArg, mode, SdNotifyModeConmon, SdNotifyModeContainer, SdNotifyModeHealthy, SdNotifyModeIgnore)
    20  	}
    21  }