Skip to content

Commit

Permalink
fix: Dry run stuck on pre sync hook (#236)
Browse files Browse the repository at this point in the history
* fix: Dry run stuck on pre sync hook

Signed-off-by: May Zhang <[email protected]>

* fix: Dry run stuck on pre sync hook

Signed-off-by: May Zhang <[email protected]>
  • Loading branch information
mayzhang2000 authored Mar 12, 2021
1 parent 89cb483 commit 380f7be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/sync/sync_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,13 @@ func (sc *syncContext) processCreateTasks(state runState, tasks syncTasks, dryRu
state = failed
}
if !dryRun || sc.dryRun || result == common.ResultCodeSyncFailed {
sc.setResourceResult(t, result, operationPhases[result], message)
phase := operationPhases[result]
// no resources are created in dry-run, so running phase means validation was
// successful and sync operation succeeded
if sc.dryRun && phase == common.OperationRunning {
phase = common.OperationSucceeded
}
sc.setResourceResult(t, result, phase, message)
}
return state
})
Expand Down

0 comments on commit 380f7be

Please sign in to comment.