Skip to content

Commit

Permalink
fix: reverse order of deployers during cleanup (GoogleContainerTools#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chronicc committed Nov 21, 2022
1 parent a3808f6 commit de1019f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/skaffold/deploy/deploy_mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ func (m DeployerMux) Dependencies() ([]string, error) {
}

func (m DeployerMux) Cleanup(ctx context.Context, w io.Writer, dryRun bool) error {
for _, deployer := range m.deployers {
revDeployers := m.deployers
for i, j := 0, len(revDeployers)-1; i < j; i, j = i+1, j-1 {
revDeployers[i], revDeployers[j] = revDeployers[j], revDeployers[i]
}
for _, deployer := range revDeployers {
ctx, endTrace := instrumentation.StartTrace(ctx, "Cleanup")
if dryRun {
output.Yellow.Fprintln(w, "Following resources would be deleted:")
Expand Down

0 comments on commit de1019f

Please sign in to comment.