...
1 package validate
2
3 import (
4 devfilev1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
5 )
6
7
8
9
10 func validateCommands(commandsMap map[string]devfilev1.Command) (err error) {
11
12 for _, command := range commandsMap {
13 err = validateCommand(command)
14 if err != nil {
15 return err
16 }
17 }
18
19 return
20 }
21
22
23
24
25 func validateCommand(command devfilev1.Command) (err error) {
26
27
28 if command.Exec == nil && command.Apply == nil && command.Composite == nil {
29 return &UnsupportedOdoCommandError{commandId: command.Id}
30 }
31
32 return
33 }
34
View as plain text