Skip to content

Commit

Permalink
On Podman, execute Build command only if itself is not hotReloadcapable
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed May 3, 2023
1 parent b587433 commit b5ac956
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/dev/podmandev/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/redhat-developer/odo/pkg/log"
odocontext "github.com/redhat-developer/odo/pkg/odo/context"
"github.com/redhat-developer/odo/pkg/port"
"github.com/redhat-developer/odo/pkg/util"
"github.com/redhat-developer/odo/pkg/watch"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -94,11 +95,20 @@ func (o *DevClient) reconcile(
)
return libdevfile.Build(ctx, devfileObj, options.BuildCommand, execHandler)
}
err = doExecuteBuildCommand()

var buildCmd devfilev1.Command
buildCmd, err = libdevfile.ValidateAndGetCommand(parameters.Devfile, parameters.StartOptions.BuildCommand, devfilev1.BuildCommandGroupKind)
if err != nil {
return err
}

if !componentStatus.RunExecuted || !util.SafeGetBool(buildCmd.Exec.HotReloadCapable) {
err = doExecuteBuildCommand()
if err != nil {
return err
}
}

cmdKind := devfilev1.RunCommandGroupKind
cmdName := options.RunCommand
if options.Debug {
Expand Down

0 comments on commit b5ac956

Please sign in to comment.