MCPcopy
hub / github.com/operator-framework/operator-sdk / Set

Method Set

internal/olm/operator/install_mode.go:37–50  ·  view source on GitHub ↗

Set is called when the --install-mode flag is passed to the CLI. It will configure the InstallMode based on the values passed in.

(str string)

Source from the content-addressed store, hash-verified

35// Set is called when the --install-mode flag is passed to the CLI. It will
36// configure the InstallMode based on the values passed in.
37func (i *InstallMode) Set(str string) error {
38 split := strings.SplitN(str, "=", 2)
39 i.InstallModeType = v1alpha1.InstallModeType(split[0])
40 if len(split) == 2 {
41 namespaces := strings.SplitSeq(split[1], ",")
42 for ns := range namespaces {
43 i.TargetNamespaces = append(i.TargetNamespaces, strings.TrimSpace(ns))
44 }
45 sort.Strings(i.TargetNamespaces)
46 } else {
47 i.TargetNamespaces = []string{}
48 }
49 return i.Validate()
50}
51
52// IsEmpty returns true if the InstallModeType is empty.
53func (i InstallMode) IsEmpty() bool {

Callers 5

checkMatchesMethod · 0.45
runMethod · 0.45
RegisterBuildInfoFunction · 0.45
selectTestsMethod · 0.45
setDescriptorFieldsMethod · 0.45

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected