Skip to content

Commit fa9023a

Browse files
fix: 20791 - sync multi-source application out of order source syncs (#21071)
Signed-off-by: Ishita Sequeira <[email protected]>
1 parent cdec7e2 commit fa9023a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/application/application.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2229,7 +2229,7 @@ func getAmbiguousRevision(app *appv1.Application, syncReq *application.Applicati
22292229
ambiguousRevision := ""
22302230
if app.Spec.HasMultipleSources() {
22312231
for i, pos := range syncReq.SourcePositions {
2232-
if pos == int64(sourceIndex) {
2232+
if pos == int64(sourceIndex+1) {
22332233
ambiguousRevision = syncReq.Revisions[i]
22342234
}
22352235
}

server/application/application_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2946,7 +2946,7 @@ func TestGetAmbiguousRevision_MultiSource(t *testing.T) {
29462946
},
29472947
}
29482948
syncReq := &application.ApplicationSyncRequest{
2949-
SourcePositions: []int64{0, 1},
2949+
SourcePositions: []int64{1, 2},
29502950
Revisions: []string{"rev1", "rev2"},
29512951
}
29522952

0 commit comments

Comments
 (0)