Skip to content

Commit 380f7be

Browse files
authored
fix: Dry run stuck on pre sync hook (argoproj#236)
* 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]>
1 parent 89cb483 commit 380f7be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/sync/sync_context.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,13 @@ func (sc *syncContext) processCreateTasks(state runState, tasks syncTasks, dryRu
10601060
state = failed
10611061
}
10621062
if !dryRun || sc.dryRun || result == common.ResultCodeSyncFailed {
1063-
sc.setResourceResult(t, result, operationPhases[result], message)
1063+
phase := operationPhases[result]
1064+
// no resources are created in dry-run, so running phase means validation was
1065+
// successful and sync operation succeeded
1066+
if sc.dryRun && phase == common.OperationRunning {
1067+
phase = common.OperationSucceeded
1068+
}
1069+
sc.setResourceResult(t, result, phase, message)
10641070
}
10651071
return state
10661072
})

0 commit comments

Comments
 (0)