summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/play_utils.go
blob: 482a158e6e4cea48158c567edd02271827f2ac09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package abi

import "github.com/containers/podman/v4/libpod/define"

// getSdNotifyMode returns the `sdNotifyAnnotation/$name` for the specified
// name. If name is empty, it'll only look for `sdNotifyAnnotation`.
func getSdNotifyMode(annotations map[string]string, name string) (string, error) {
	var mode string
	switch len(name) {
	case 0:
		mode = annotations[sdNotifyAnnotation]
	default:
		mode = annotations[sdNotifyAnnotation+"/"+name]
	}
	return mode, define.ValidateSdNotifyMode(mode)
}