Skip to content

Commit 489d495

Browse files
janiskemperguettli
authored andcommitted
🐛 Show correct latest release per ClusterStack
We have shown always the same ClusterStackRelease as latest release, even if it was a ClusterStack that does not own the ClusterStackRelease. This was because we have in theory correctly searched for the latest release, but then have not taken it due to a mistake with the wrong index of a for loop Signed-off-by: Thomas Guettler <[email protected]>
1 parent 22cc6d7 commit 489d495

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/controller/clusterstack_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ func (r *ClusterStackReconciler) getExistingClusterStackReleases(ctx context.Con
444444

445445
for i := range csrList.Items {
446446
csr := csrList.Items[i]
447-
for i := range csr.GetOwnerReferences() {
448-
ownerRef := csr.GetOwnerReferences()[i]
447+
for j := range csr.GetOwnerReferences() {
448+
ownerRef := csr.GetOwnerReferences()[j]
449449
if matchesOwnerRef(&ownerRef, clusterStack) {
450450
existingClusterStackReleases = append(existingClusterStackReleases, &csrList.Items[i])
451451
break

0 commit comments

Comments
 (0)