Skip to content

Commit

Permalink
feat(app): Support app sync --dry-run --revision some-revision with a…
Browse files Browse the repository at this point in the history
…rbitrary revisions(#12592) (#16387)

Signed-off-by: Ferenc Kovacs <[email protected]>
  • Loading branch information
Tyrael authored Nov 20, 2023
1 parent 8d8009d commit a6b80df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ func (s *Server) Sync(ctx context.Context, syncReq *application.ApplicationSyncR
if a.DeletionTimestamp != nil {
return nil, status.Errorf(codes.FailedPrecondition, "application is deleting")
}
if a.Spec.SyncPolicy != nil && a.Spec.SyncPolicy.Automated != nil {
if a.Spec.SyncPolicy != nil && a.Spec.SyncPolicy.Automated != nil && !syncReq.GetDryRun() {
if syncReq.GetRevision() != "" && syncReq.GetRevision() != text.FirstNonEmpty(source.TargetRevision, "HEAD") {
return nil, status.Errorf(codes.FailedPrecondition, "Cannot sync to %s: auto-sync currently set to %s", syncReq.GetRevision(), source.TargetRevision)
}
Expand Down

0 comments on commit a6b80df

Please sign in to comment.