diff --git a/pkg/validation/commands.go b/pkg/validation/commands.go index 754e712ef..e7b275d64 100644 --- a/pkg/validation/commands.go +++ b/pkg/validation/commands.go @@ -197,7 +197,7 @@ func validateCompositeCommand(command *v1alpha2.Command, parentCommands map[stri if err != nil { return err } - delete(parentCommands, cmd) + delete(parentCommands, strings.ToLower(cmd)) } return nil } diff --git a/pkg/validation/commands_test.go b/pkg/validation/commands_test.go index 461d65c71..aa726660f 100644 --- a/pkg/validation/commands_test.go +++ b/pkg/validation/commands_test.go @@ -365,6 +365,16 @@ func TestValidateCompositeCommand(t *testing.T) { }, testCompositeCommand: "composite-1", }, + { + name: "Valid Composite command with mixed-case subcommand references", + commands: []v1alpha2.Command{ + generateDummyExecCommand("basic-exec", component, nil), + generateDummyCompositeCommand("composite-a", []string{"basic-exec"}, nil), + generateDummyCompositeCommand("composite-b", []string{"composite-a"}, nil), + generateDummyCompositeCommand("composite-1", []string{"Composite-A", "composite-b"}, nil), + }, + testCompositeCommand: "composite-1", + }, } for _, tt := range tests { commandMap := getCommandsMap(tt.commands)