Skip to content

Commit

Permalink
Merge 11c02cd into 5c38573
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l authored Feb 6, 2023
2 parents 5c38573 + 11c02cd commit 2bd9cd5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pkg/component/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ func (do *DeleteComponentClient) ExecutePreStopEvents(devfileObj parser.DevfileO

klog.V(4).Infof("Executing %q event commands for component %q", libdevfile.PreStop, componentName)
// ignore the failures if any; delete should not fail because preStop events failed to execute
err = libdevfile.ExecPreStopEvents(devfileObj, component.NewExecHandler(do.kubeClient, do.execClient, appName, componentName, pod.Name, "", false))
err = libdevfile.ExecPreStopEvents(devfileObj,
component.NewExecHandler(do.kubeClient, do.execClient, appName, componentName, pod.Name, "Executing pre-stop command in container", false))
if err != nil {
klog.V(4).Infof("Failed to execute %q event commands for component %q, cause: %v", libdevfile.PreStop, componentName, err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/component/exec_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (o *execHandler) ApplyOpenShift(openshift v1alpha2.Component) error {
func (o *execHandler) Execute(command v1alpha2.Command) error {
msg := o.msg
if msg == "" {
msg = fmt.Sprintf("Executing %s command %q on container %q", command.Id, command.Exec.CommandLine, command.Exec.Component)
msg = fmt.Sprintf("Executing %s command on container %q", command.Id, command.Exec.Component)
} else {
msg += " (command: " + command.Id + ")"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev/podmandev/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (o *DevClient) reconcile(
appName,
componentName,
pod.Name,
"",
"Executing post-start command in container",
false, /* TODO */
)
err = libdevfile.ExecPostStartEvents(*devfileObj, execHandler)
Expand Down
2 changes: 1 addition & 1 deletion pkg/devfile/adapters/kubernetes/component/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (a Adapter) Push(ctx context.Context, parameters adapters.PushParameters, c
// didn't previously exist
if !componentStatus.PostStartEventsDone && libdevfile.HasPostStartEvents(a.Devfile) {
err = libdevfile.ExecPostStartEvents(a.Devfile,
component.NewExecHandler(a.kubeClient, a.execClient, a.AppName, a.ComponentName, pod.Name, "", parameters.Show))
component.NewExecHandler(a.kubeClient, a.execClient, a.AppName, a.ComponentName, pod.Name, "Executing post-start command in container", parameters.Show))
if err != nil {
return err
}
Expand Down
8 changes: 3 additions & 5 deletions tests/integration/cmd_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,9 @@ var _ = Describe("odo delete command tests", func() {
})
It("should delete the component", func() {
By("listing preStop events", func() {
helper.MatchAllInOutput(out, []string{
"Executing myprestop command",
"Executing secondprestop command",
"Executing thirdprestop command",
})
for _, cmdName := range []string{"myprestop", "secondprestop", "thirdprestop"} {
Expect(out).To(ContainSubstring("Executing pre-stop command in container (command: %s)", cmdName))
}
})
files := helper.ListFilesInDir(commonVar.Context)
if withFiles {
Expand Down

0 comments on commit 2bd9cd5

Please sign in to comment.