validateCommand validates a given devfile command where parentCommands is a map to track all the parent commands when validating the composite command's subcommands recursively and devfileCommands is a map of command id to the devfile command
(command v1alpha2.Command, parentCommands map[string]string, devfileCommands map[string]v1alpha2.Command, components []v1alpha2.Component)
| 63 | // validateCommand validates a given devfile command where parentCommands is a map to track all the parent commands when validating |
| 64 | // the composite command's subcommands recursively and devfileCommands is a map of command id to the devfile command |
| 65 | func validateCommand(command v1alpha2.Command, parentCommands map[string]string, devfileCommands map[string]v1alpha2.Command, components []v1alpha2.Component) error { |
| 66 | |
| 67 | switch { |
| 68 | case command.Composite != nil: |
| 69 | return validateCompositeCommand(&command, parentCommands, devfileCommands, components) |
| 70 | case command.Exec != nil || command.Apply != nil: |
| 71 | return validateCommandComponent(command, components) |
| 72 | default: |
| 73 | return &InvalidCommandTypeError{commandId: command.Id} |
| 74 | } |
| 75 | |
| 76 | } |
| 77 | |
| 78 | // validateGroup validates commands belonging to a specific group kind. If there are multiple commands belonging to the same group: |
| 79 | // 1. without any default, err out |
no test coverage detected