From b3ade6159e2e80485aea6c903f4bce8f269a621a Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Tue, 7 May 2019 14:54:51 -0700 Subject: [PATCH] Issue #1579 - Impossible to sync to HEAD from UI if auto-sync is enabled (#1580) --- server/application/application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/application/application.go b/server/application/application.go index 33d9dc46b7..7f77662f12 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -802,7 +802,7 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*ap return nil, status.Errorf(codes.FailedPrecondition, "application is deleting") } if a.Spec.SyncPolicy != nil && a.Spec.SyncPolicy.Automated != nil { - if syncReq.Revision != "" && syncReq.Revision != a.Spec.Source.TargetRevision { + if syncReq.Revision != "" && syncReq.Revision != util.FirstNonEmpty(a.Spec.Source.TargetRevision, "HEAD") { return nil, status.Errorf(codes.FailedPrecondition, "Cannot sync to %s: auto-sync currently set to %s", syncReq.Revision, a.Spec.Source.TargetRevision) } }