Skip to content

Commit

Permalink
fix: 20791 - sync multi-source application out of order source syncs …
Browse files Browse the repository at this point in the history
…(cherry-pick #21071) (#21078)

Signed-off-by: Ishita Sequeira <ishiseq29@gmail.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
  • Loading branch information
1 parent b32d50d commit 05c1dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@ func getAmbiguousRevision(app *appv1.Application, syncReq *application.Applicati
ambiguousRevision := ""
if app.Spec.HasMultipleSources() {
for i, pos := range syncReq.SourcePositions {
if pos == int64(sourceIndex) {
if pos == int64(sourceIndex+1) {
ambiguousRevision = syncReq.Revisions[i]
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/application/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2919,7 +2919,7 @@ func TestGetAmbiguousRevision_MultiSource(t *testing.T) {
},
}
syncReq := &application.ApplicationSyncRequest{
SourcePositions: []int64{0, 1},
SourcePositions: []int64{1, 2},
Revisions: []string{"rev1", "rev2"},
}

Expand Down

0 comments on commit 05c1dd7

Please sign in to comment.