@@ -424,7 +424,7 @@ func processRollbackEvent(
424
424
logrus .Errorf ("could not push to git with native command: %s" , err )
425
425
return nil , fmt .Errorf ("could not push to git. Check server logs" )
426
426
}
427
- gitopsRepoCache .Invalidate (repoName )
427
+ gitopsRepoCache .InvalidateNow (repoName )
428
428
429
429
rollbackResults := []model.Result {}
430
430
@@ -612,14 +612,15 @@ func cloneTemplateWriteAndPush(
612
612
613
613
if sha != "" || kustomizationSha != "" { // if there is a change to push
614
614
operation := func () error {
615
- return nativeGit .PushWithToken (repo , githubChartAccessToken )
615
+ head , _ := repo .Head ()
616
+ return nativeGit .NativePushWithToken (repoTmpPath , repoName , githubChartAccessToken , head .Name ().Short ())
616
617
}
617
618
backoffStrategy := backoff .WithMaxRetries (backoff .NewExponentialBackOff (), 5 )
618
619
err := backoff .Retry (operation , backoffStrategy )
619
620
if err != nil {
620
621
return "" , err
621
622
}
622
- gitopsRepoCache .Invalidate (repoName )
623
+ gitopsRepoCache .InvalidateNow (repoName )
623
624
}
624
625
625
626
perf .WithLabelValues ("gitops_cloneTemplateWriteAndPush" ).Observe (float64 (time .Since (t0 ).Seconds ()))
@@ -669,11 +670,12 @@ func cloneTemplateDeleteAndPush(
669
670
sha , err := nativeGit .Commit (repo , gitMessage )
670
671
671
672
if sha != "" { // if there is a change to push
672
- err = nativeGit .PushWithToken (repo , nonImpersonatedToken )
673
+ head , _ := repo .Head ()
674
+ err = nativeGit .NativePushWithToken (repoTmpPath , repoName , nonImpersonatedToken , head .Name ().Short ())
673
675
if err != nil {
674
676
return "" , err
675
677
}
676
- gitopsRepoCache .Invalidate (repoName )
678
+ gitopsRepoCache .InvalidateNow (repoName )
677
679
}
678
680
679
681
return sha , nil
0 commit comments