diff --git a/src/app/backend/resource/deployment/deploy.go b/src/app/backend/resource/deployment/deploy.go index 3d66803dff29cc751e486b7bbd1bbb3249d29e60..aa0b52b815a675c1031b82bae74a7ae171dbdc34 100644 --- a/src/app/backend/resource/deployment/deploy.go +++ b/src/app/backend/resource/deployment/deploy.go @@ -189,7 +189,7 @@ func DeployApp(spec *AppDeploymentSpec, client client.Interface) error { containerSpec.Command = []string{*spec.ContainerCommand} } if spec.ContainerCommandArgs != nil { - containerSpec.Args = []string{*spec.ContainerCommandArgs} + containerSpec.Args = strings.Fields(*spec.ContainerCommandArgs) } if spec.CpuRequirement != nil { diff --git a/src/app/backend/resource/deployment/deploy_test.go b/src/app/backend/resource/deployment/deploy_test.go index 06a753541c30e351deef5666c94feebad6b0b6ba..144668e683bb05f885b83bed32405e8a76cebc5a 100644 --- a/src/app/backend/resource/deployment/deploy_test.go +++ b/src/app/backend/resource/deployment/deploy_test.go @@ -17,6 +17,7 @@ package deployment import ( "reflect" "regexp" + "strings" "testing" apps "k8s.io/api/apps/v1" @@ -90,7 +91,7 @@ func TestDeployApp(t *testing.T) { func TestDeployAppContainerCommands(t *testing.T) { command := "foo-command" - commandArgs := "foo-command-args" + commandArgs := "foo-command-args1 foo-command-args2" spec := &AppDeploymentSpec{ Namespace: "foo-namespace", Name: "foo-name", @@ -109,9 +110,13 @@ func TestDeployAppContainerCommands(t *testing.T) { command, container.Command) } - if container.Args[0] != commandArgs { - t.Errorf("Expected command args to be %#v but got %#v", - commandArgs, container.Args) + if container.Args[0] != strings.Fields(commandArgs)[0] { + t.Errorf("Expected command args 1st argument to be %#v but got %#v", + strings.Fields(commandArgs)[0], container.Args[0]) + } + if container.Args[1] != strings.Fields(commandArgs)[1] { + t.Errorf("Expected command args 2nd argument to be %#v but got %#v", + strings.Fields(commandArgs)[1], container.Args[1]) } }