MCPcopy Create free account
hub / github.com/devfile/api / getGroup

Function getGroup

pkg/validation/commands.go:117–131  ·  view source on GitHub ↗

getGroup returns the group the command belongs to, or nil if the command does not belong to a group

(command v1alpha2.Command)

Source from the content-addressed store, hash-verified

115
116// getGroup returns the group the command belongs to, or nil if the command does not belong to a group
117func getGroup(command v1alpha2.Command) *v1alpha2.CommandGroup {
118 switch {
119 case command.Composite != nil:
120 return command.Composite.Group
121 case command.Exec != nil:
122 return command.Exec.Group
123 case command.Apply != nil:
124 return command.Apply.Group
125 case command.Custom != nil:
126 return command.Custom.Group
127
128 default:
129 return nil
130 }
131}
132
133// validateCommandComponent validates the given exec or apply command, the command should map to a valid container component
134func validateCommandComponent(command v1alpha2.Command, components []v1alpha2.Component) error {

Callers 2

ValidateCommandsFunction · 0.70
validateGroupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected