Skip to content

Commit

Permalink
added comment to explain why we need to create a new context
Browse files Browse the repository at this point in the history
  • Loading branch information
idsulik committed Apr 16, 2024
1 parent e2415cc commit e8c82e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/skaffold/build/cluster/kaniko.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ func (b *Builder) buildWithKaniko(ctx context.Context, out io.Writer, workspace
}

defer func() {
// if build interrupted the original context is cancelled
// and pod deletion will not be called, so we need a new ctx
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()

Expand Down

0 comments on commit e8c82e0

Please sign in to comment.