Make sure a Deploy command is present in the Devfile before auto-applying components (#7093)

* Add integration test case highlighting the issue

* Make sure a Deploy command is present in the Devfile before auto-applying components

* Fix expected output in 'odo deploy' interactive tests
This commit is contained in:
Armel Soro
2023-09-20 14:06:56 +02:00
committed by GitHub
parent 9e1698bc99
commit 1ab0178cef
4 changed files with 331 additions and 146 deletions

View File

@@ -39,6 +39,11 @@ func (o *DeployClient) Deploy(ctx context.Context) error {
path = filepath.Dir(devfilePath)
)
_, err := libdevfile.ValidateAndGetCommand(*devfileObj, "", v1alpha2.DeployCommandGroupKind)
if err != nil {
return err
}
handler := component.NewRunHandler(
ctx,
o.kubeClient,
@@ -52,7 +57,7 @@ func (o *DeployClient) Deploy(ctx context.Context) error {
},
)
err := o.buildPushAutoImageComponents(handler, *devfileObj)
err = o.buildPushAutoImageComponents(handler, *devfileObj)
if err != nil {
return err
}