Skip to content

Commit

Permalink
fix: incorrectly worded error message in argocd-update is corrected (#…
Browse files Browse the repository at this point in the history
…3192)

Signed-off-by: Rohan <[email protected]>
  • Loading branch information
RohanMishra315 authored Jan 2, 2025
1 parent 37d0647 commit 17f45df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/directives/argocd_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ func (a *argocdUpdater) mustPerformUpdate(
// NB: We return the current phase here because we want the caller
// to know that an operation is still running.
return status.Phase, false, fmt.Errorf(
"current operation was not initiated by %q and not by %q: waiting for operation to complete",
applicationOperationInitiator, status.Operation.InitiatedBy.Username,
"current operation was initiated by %q and not by %q: waiting for operation to complete",
status.Operation.InitiatedBy.Username, applicationOperationInitiator,
)
}
// Initiate our own operation.
Expand Down
3 changes: 2 additions & 1 deletion internal/directives/argocd_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,8 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) {
}
},
assertions: func(t *testing.T, phase argocd.OperationPhase, mustUpdate bool, err error) {
require.ErrorContains(t, err, "current operation was not initiated by")
require.ErrorContains(t, err, "current operation was initiated by")
require.ErrorContains(t, err, "and not by")
require.ErrorContains(t, err, "waiting for operation to complete")
require.Equal(t, argocd.OperationRunning, phase)
require.False(t, mustUpdate)
Expand Down

0 comments on commit 17f45df

Please sign in to comment.