Skip to content

Commit 270796a

Browse files
committed
refactor: drop duplicate executor.DestroyBuild call
I'm working on changes to the kubernetes runtime where multiple DestroyBuild calls could lead to a nil pointer dereference panic. And, the duplicate DestroyBuild call causes a bunch of logged errors about the build already being destroyed. So, just drop the duplicate.
1 parent 629cebb commit 270796a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

cmd/vela-worker/exec.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func (w *Worker) exec(index int) error {
108108
if err != nil {
109109
logger.Errorf("unable to destroy build: %v", err)
110110
}
111+
112+
logger.Info("completed build")
111113
}()
112114

113115
logger.Info("creating build")
@@ -142,14 +144,5 @@ func (w *Worker) exec(index int) error {
142144
return nil
143145
}
144146

145-
logger.Info("destroying build")
146-
// destroy the build with the executor
147-
err = _executor.DestroyBuild(context.Background())
148-
if err != nil {
149-
logger.Errorf("unable to destroy build: %v", err)
150-
}
151-
152-
logger.Info("completed build")
153-
154147
return nil
155148
}

0 commit comments

Comments
 (0)