mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Make sure to run parallel commands part of a composite command in parallel (#7075)
* Make sure to run parallel commands part of a composite command in parallel * Display warnings in case there are errors when executing pre-stop events * Fix the command_composite_parallel.go implementation by lowering the case of the sub-command names Since this passed the Devfile validation logic, we should use the same logic as in command_composite.go
This commit is contained in:
@@ -230,7 +230,7 @@ func (do *DeleteComponentClient) ExecutePreStopEvents(ctx context.Context, devfi
|
||||
)
|
||||
err = libdevfile.ExecPreStopEvents(ctx, devfileObj, handler)
|
||||
if err != nil {
|
||||
klog.V(4).Infof("Failed to execute %q event commands for component %q, cause: %v", libdevfile.PreStop, componentName, err.Error())
|
||||
log.Warningf("Failed to execute %q event commands for component %q, cause: %v", libdevfile.PreStop, componentName, err.Error())
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -33,8 +33,9 @@ func newCommand(devfileObj parser.DevfileObj, devfileCmd v1alpha2.Command) (comm
|
||||
case v1alpha2.CompositeCommandType:
|
||||
if util.SafeGetBool(devfileCmd.Composite.Parallel) {
|
||||
cmd = newParallelCompositeCommand(devfileObj, devfileCmd)
|
||||
} else {
|
||||
cmd = newCompositeCommand(devfileObj, devfileCmd)
|
||||
}
|
||||
cmd = newCompositeCommand(devfileObj, devfileCmd)
|
||||
|
||||
case v1alpha2.ExecCommandType:
|
||||
cmd = newExecCommand(devfileObj, devfileCmd)
|
||||
|
||||
@@ -52,7 +52,7 @@ func (o *parallelCompositeCommand) Execute(ctx context.Context, handler Handler,
|
||||
}
|
||||
commandExecs := util.NewConcurrentTasks(len(o.command.Composite.Commands))
|
||||
for _, devfileCmd := range o.command.Composite.Commands {
|
||||
cmd, err2 := newCommand(o.devfileObj, allCommands[devfileCmd])
|
||||
cmd, err2 := newCommand(o.devfileObj, allCommands[strings.ToLower(devfileCmd)])
|
||||
if err2 != nil {
|
||||
return err2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user