getGroup returns the group the command belongs to, or nil if the command does not belong to a group
(command v1alpha2.Command)
| 115 | |
| 116 | // getGroup returns the group the command belongs to, or nil if the command does not belong to a group |
| 117 | func 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 |
| 134 | func validateCommandComponent(command v1alpha2.Command, components []v1alpha2.Component) error { |
no outgoing calls
no test coverage detected