From 94f1de013dce4cee1be50fa47a6c519582a70bf3 Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Fri, 24 Oct 2025 18:51:49 -0700 Subject: [PATCH 1/5] add transition from rollingUpdate to external E2E Signed-off-by: Arvind Thirumurugan --- test/e2e/staged_updaterun_test.go | 115 ++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/test/e2e/staged_updaterun_test.go b/test/e2e/staged_updaterun_test.go index 51d3bd183..10ddf111e 100644 --- a/test/e2e/staged_updaterun_test.go +++ b/test/e2e/staged_updaterun_test.go @@ -872,6 +872,121 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem It("Should not rollout any resources to member clusters as it's reportDiff mode", checkIfRemovedConfigMapFromAllMemberClustersConsistently) }) + + FContext("Test RP rollout strategy transition from rollingUpdate to external", Ordered, func() { + var strategy *placementv1beta1.StagedUpdateStrategy + updateRunName := fmt.Sprintf(stagedUpdateRunNameWithSubIndexTemplate, GinkgoParallelProcess(), 0) + var oldConfigMap, newConfigMap corev1.ConfigMap + + BeforeAll(func() { + // Create the RP with rollingUpdate strategy initially. + rp := &placementv1beta1.ResourcePlacement{ + ObjectMeta: metav1.ObjectMeta{ + Name: rpName, + Namespace: testNamespace, + // Add a custom finalizer; this would allow us to better observe + // the behavior of the controllers. + Finalizers: []string{customDeletionBlockerFinalizer}, + }, + Spec: placementv1beta1.PlacementSpec{ + ResourceSelectors: configMapSelector(), + Strategy: placementv1beta1.RolloutStrategy{ + Type: placementv1beta1.RollingUpdateRolloutStrategyType, + }, + }, + } + Expect(hubClient.Create(ctx, rp)).To(Succeed(), "Failed to create RP") + + // Create the stagedUpdateStrategy for later use. + strategy = createStagedUpdateStrategySucceed(strategyName, testNamespace) + + oldConfigMap = appConfigMap() + newConfigMap = appConfigMap() + newConfigMap.Data["data"] = testConfigMapDataValue + }) + + AfterAll(func() { + // Remove the custom deletion blocker finalizer from the RP. + ensureRPAndRelatedResourcesDeleted(types.NamespacedName{Name: rpName, Namespace: testNamespace}, allMemberClusters) + + // Delete the stagedUpdateRun. + ensureStagedUpdateRunDeletion(updateRunName, testNamespace) + + // Delete the stagedUpdateStrategy. + ensureStagedUpdateRunStrategyDeletion(strategyName, testNamespace) + }) + + It("Should rollout resources to all member clusters with rollingUpdate strategy", func() { + rpStatusUpdatedActual := rpStatusUpdatedActual(appConfigMapIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) + checkIfPlacedWorkResourcesOnMemberClustersInUpdateRun(allMemberClusters) + }) + + It("Update RP to use external rollout strategy", func() { + Eventually(func() error { + rp := &placementv1beta1.ResourcePlacement{} + if err := hubClient.Get(ctx, client.ObjectKey{Name: rpName, Namespace: testNamespace}, rp); err != nil { + return fmt.Errorf("failed to get the rp: %w", err) + } + rp.Spec.Strategy = placementv1beta1.RolloutStrategy{ + Type: placementv1beta1.ExternalRolloutStrategyType, + } + return hubClient.Update(ctx, rp) + }, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP strategy to external rollout") + }) + + It("Should update rp status to reflect external rollout strategy", func() { + rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, + []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status for external strategy", testNamespace, rpName) + }) + + It("Update the configmap on hub but should not rollout to member clusters", func() { + updateConfigMapSucceed(&newConfigMap) + + // Verify old configmap is still on all member clusters + for _, cluster := range allMemberClusters { + configMapActual := configMapPlacedOnClusterActual(cluster, &oldConfigMap) + Consistently(configMapActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep old configmap %s data on cluster %s", oldConfigMap.Name, cluster.ClusterName) + } + }) + + It("Should have the new resource snapshot but RP status should remain completed with old snapshot", func() { + validateLatestResourceSnapshot(rpName, testNamespace, resourceSnapshotIndex2nd) + + // RP status should still show completed with old snapshot + rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, + []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) + Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep RP %s/%s status as expected", testNamespace, rpName) + }) + + It("Create a staged update run with new resourceSnapshotIndex and verify rollout happens", func() { + createStagedUpdateRunSucceed(updateRunName, testNamespace, rpName, resourceSnapshotIndex2nd, strategyName) + + // Verify rollout to canary cluster first + By("Verify that the new configmap is updated on member-cluster-2 during canary stage") + configMapActual := configMapPlacedOnClusterActual(allMemberClusters[1], &newConfigMap) + Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, allMemberClusterNames[1]) + + validateAndApproveNamespacedApprovalRequests(updateRunName, testNamespace, envCanary) + + // Verify complete rollout + surSucceededActual := stagedUpdateRunStatusSucceededActual(updateRunName, testNamespace, policySnapshotIndex1st, len(allMemberClusters), defaultApplyStrategy, &strategy.Spec, [][]string{{allMemberClusterNames[1]}, {allMemberClusterNames[0], allMemberClusterNames[2]}}, nil, nil, nil) + Eventually(surSucceededActual, updateRunEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to validate updateRun %s/%s succeeded", testNamespace, updateRunName) + + // Verify new configmap is on all member clusters + for _, cluster := range allMemberClusters { + configMapActual := configMapPlacedOnClusterActual(cluster, &newConfigMap) + Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, cluster.ClusterName) + } + }) + + It("Should update rp status as completed with new snapshot", func() { + rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex2nd, true, allMemberClusterNames, + []string{resourceSnapshotIndex2nd, resourceSnapshotIndex2nd, resourceSnapshotIndex2nd}, []bool{true, true, true}, nil, nil) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) + }) + }) }) func createStagedUpdateStrategySucceed(strategyName, namespace string) *placementv1beta1.StagedUpdateStrategy { From 915c8fa2eb3680e7e83fe191e2b7a8119894b056 Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Fri, 24 Oct 2025 19:05:57 -0700 Subject: [PATCH 2/5] add transition from external to rollingUpdate E2E Signed-off-by: Arvind Thirumurugan --- test/e2e/staged_updaterun_test.go | 118 +++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/test/e2e/staged_updaterun_test.go b/test/e2e/staged_updaterun_test.go index 10ddf111e..d99b3bd59 100644 --- a/test/e2e/staged_updaterun_test.go +++ b/test/e2e/staged_updaterun_test.go @@ -873,7 +873,7 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem It("Should not rollout any resources to member clusters as it's reportDiff mode", checkIfRemovedConfigMapFromAllMemberClustersConsistently) }) - FContext("Test RP rollout strategy transition from rollingUpdate to external", Ordered, func() { + Context("Test RP rollout strategy transition from rollingUpdate to external", Ordered, func() { var strategy *placementv1beta1.StagedUpdateStrategy updateRunName := fmt.Sprintf(stagedUpdateRunNameWithSubIndexTemplate, GinkgoParallelProcess(), 0) var oldConfigMap, newConfigMap corev1.ConfigMap @@ -987,6 +987,122 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) }) }) + + Context("Test RP rollout strategy transition from external to rollingUpdate", Ordered, func() { + var strategy *placementv1beta1.StagedUpdateStrategy + updateRunName := fmt.Sprintf(stagedUpdateRunNameWithSubIndexTemplate, GinkgoParallelProcess(), 0) + var oldConfigMap, newConfigMap corev1.ConfigMap + + BeforeAll(func() { + // Create the RP with external rollout strategy initially. + rp := &placementv1beta1.ResourcePlacement{ + ObjectMeta: metav1.ObjectMeta{ + Name: rpName, + Namespace: testNamespace, + // Add a custom finalizer; this would allow us to better observe + // the behavior of the controllers. + Finalizers: []string{customDeletionBlockerFinalizer}, + }, + Spec: placementv1beta1.PlacementSpec{ + ResourceSelectors: configMapSelector(), + Strategy: placementv1beta1.RolloutStrategy{ + Type: placementv1beta1.ExternalRolloutStrategyType, + }, + }, + } + Expect(hubClient.Create(ctx, rp)).To(Succeed(), "Failed to create RP") + + // Create the stagedUpdateStrategy. + strategy = createStagedUpdateStrategySucceed(strategyName, testNamespace) + + oldConfigMap = appConfigMap() + newConfigMap = appConfigMap() + newConfigMap.Data["data"] = testConfigMapDataValue + }) + + AfterAll(func() { + // Remove the custom deletion blocker finalizer from the RP. + ensureRPAndRelatedResourcesDeleted(types.NamespacedName{Name: rpName, Namespace: testNamespace}, allMemberClusters) + + // Delete the stagedUpdateRun. + ensureStagedUpdateRunDeletion(updateRunName, testNamespace) + + // Delete the stagedUpdateStrategy. + ensureStagedUpdateRunStrategyDeletion(strategyName, testNamespace) + }) + + It("Should not rollout any resources to member clusters with external strategy", checkIfRemovedConfigMapFromAllMemberClustersConsistently) + + It("Should have the latest resource snapshot", func() { + validateLatestResourceSnapshot(rpName, testNamespace, resourceSnapshotIndex1st) + }) + + It("Should update rp status as pending rollout", func() { + rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(nil, "", false, allMemberClusterNames, []string{"", "", ""}, []bool{false, false, false}, nil, nil) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) + }) + + It("Create updateRun and verify resources are rolled out", func() { + createStagedUpdateRunSucceed(updateRunName, testNamespace, rpName, resourceSnapshotIndex1st, strategyName) + + validateAndApproveNamespacedApprovalRequests(updateRunName, testNamespace, envCanary) + + surSucceededActual := stagedUpdateRunStatusSucceededActual(updateRunName, testNamespace, policySnapshotIndex1st, len(allMemberClusters), defaultApplyStrategy, &strategy.Spec, [][]string{{allMemberClusterNames[1]}, {allMemberClusterNames[0], allMemberClusterNames[2]}}, nil, nil, nil) + Eventually(surSucceededActual, updateRunEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to validate updateRun %s/%s succeeded", testNamespace, updateRunName) + + checkIfPlacedWorkResourcesOnMemberClustersInUpdateRun(allMemberClusters) + }) + + It("Should update rp status as completed", func() { + rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, + []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) + }) + + It("Update the configmap on hub but should not rollout to member clusters with external strategy", func() { + updateConfigMapSucceed(&newConfigMap) + + // Verify old configmap is still on all member clusters + for _, cluster := range allMemberClusters { + configMapActual := configMapPlacedOnClusterActual(cluster, &oldConfigMap) + Consistently(configMapActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep old configmap %s data on cluster %s", oldConfigMap.Name, cluster.ClusterName) + } + }) + + It("Should have new resource snapshot but RP status should remain completed with old snapshot", func() { + validateLatestResourceSnapshot(rpName, testNamespace, resourceSnapshotIndex2nd) + + // RP status should still show completed with old snapshot + rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, + []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) + Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep RP %s/%s status as expected", testNamespace, rpName) + }) + + It("Update RP to use rollingUpdate strategy", func() { + Eventually(func() error { + rp := &placementv1beta1.ResourcePlacement{} + if err := hubClient.Get(ctx, client.ObjectKey{Name: rpName, Namespace: testNamespace}, rp); err != nil { + return fmt.Errorf("failed to get the rp: %w", err) + } + rp.Spec.Strategy = placementv1beta1.RolloutStrategy{ + Type: placementv1beta1.RollingUpdateRolloutStrategyType, + } + return hubClient.Update(ctx, rp) + }, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP strategy to rollingUpdate") + }) + + It("Should automatically rollout new resources to all member clusters with rollingUpdate strategy", func() { + // Verify RP status shows all clusters with new resource snapshot + rpStatusUpdatedActual := rpStatusUpdatedActual(appConfigMapIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex2nd) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status with rollingUpdate strategy", testNamespace, rpName) + + // Verify new configmap is on all member clusters + for _, cluster := range allMemberClusters { + configMapActual := configMapPlacedOnClusterActual(cluster, &newConfigMap) + Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, cluster.ClusterName) + } + }) + }) }) func createStagedUpdateStrategySucceed(strategyName, namespace string) *placementv1beta1.StagedUpdateStrategy { From 710b92993e002928897e27a46e04353067e2353e Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Tue, 28 Oct 2025 10:54:55 -0700 Subject: [PATCH 3/5] minor fixes Signed-off-by: Arvind Thirumurugan --- test/e2e/cluster_staged_updaterun_test.go | 7 +++---- test/e2e/staged_updaterun_test.go | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/e2e/cluster_staged_updaterun_test.go b/test/e2e/cluster_staged_updaterun_test.go index 82680092f..754a0bceb 100644 --- a/test/e2e/cluster_staged_updaterun_test.go +++ b/test/e2e/cluster_staged_updaterun_test.go @@ -981,10 +981,9 @@ var _ = Describe("test CRP rollout with staged update run", func() { }, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update CRP strategy to external rollout") }) - It("Should update crp status to reflect external rollout strategy", func() { - crpStatusUpdatedActual := crpStatusWithExternalStrategyActual(workResourceIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, - []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) - Eventually(crpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update CRP %s status for external strategy", crpName) + It("Should update crp status to reflect external rollout strategy with new observed generation and no other change", func() { + crpStatusUpdatedActual := crpStatusUpdatedActual(workResourceIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) + Eventually(crpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update CRP %s status as expected", crpName) }) It("Update the configmap on hub but should not rollout to member clusters", func() { diff --git a/test/e2e/staged_updaterun_test.go b/test/e2e/staged_updaterun_test.go index d99b3bd59..5200f8a31 100644 --- a/test/e2e/staged_updaterun_test.go +++ b/test/e2e/staged_updaterun_test.go @@ -935,10 +935,9 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem }, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP strategy to external rollout") }) - It("Should update rp status to reflect external rollout strategy", func() { - rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, - []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) - Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status for external strategy", testNamespace, rpName) + It("Should update rp status to reflect external rollout strategy with new observed generation and no other change", func() { + rpStatusUpdatedActual := rpStatusUpdatedActual(appConfigMapIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) + Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) }) It("Update the configmap on hub but should not rollout to member clusters", func() { From 5869e6c45857dab49727e607e74154e8a725623e Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Tue, 28 Oct 2025 11:15:11 -0700 Subject: [PATCH 4/5] minor updates Signed-off-by: Arvind Thirumurugan --- test/e2e/cluster_staged_updaterun_test.go | 5 ++--- test/e2e/staged_updaterun_test.go | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/test/e2e/cluster_staged_updaterun_test.go b/test/e2e/cluster_staged_updaterun_test.go index 754a0bceb..fd8467f8a 100644 --- a/test/e2e/cluster_staged_updaterun_test.go +++ b/test/e2e/cluster_staged_updaterun_test.go @@ -1000,9 +1000,8 @@ var _ = Describe("test CRP rollout with staged update run", func() { validateLatestClusterResourceSnapshot(crpName, resourceSnapshotIndex2nd) // CRP status should still show completed with old snapshot - crpStatusUpdatedActual := crpStatusWithExternalStrategyActual(workResourceIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, - []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) - Consistently(crpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep CRP %s status as expected", crpName) + crpStatusUpdatedActual := crpStatusUpdatedActual(workResourceIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) + Consistently(crpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to update CRP %s status as expected", crpName) }) It("Create a staged update run with new resourceSnapshotIndex and verify rollout happens", func() { diff --git a/test/e2e/staged_updaterun_test.go b/test/e2e/staged_updaterun_test.go index 5200f8a31..33ba3985b 100644 --- a/test/e2e/staged_updaterun_test.go +++ b/test/e2e/staged_updaterun_test.go @@ -943,7 +943,7 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem It("Update the configmap on hub but should not rollout to member clusters", func() { updateConfigMapSucceed(&newConfigMap) - // Verify old configmap is still on all member clusters + // Verify old configmap is still on all member clusters. for _, cluster := range allMemberClusters { configMapActual := configMapPlacedOnClusterActual(cluster, &oldConfigMap) Consistently(configMapActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep old configmap %s data on cluster %s", oldConfigMap.Name, cluster.ClusterName) @@ -953,27 +953,26 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem It("Should have the new resource snapshot but RP status should remain completed with old snapshot", func() { validateLatestResourceSnapshot(rpName, testNamespace, resourceSnapshotIndex2nd) - // RP status should still show completed with old snapshot - rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, - []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) - Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep RP %s/%s status as expected", testNamespace, rpName) + // RP status should still show completed with old snapshot. + rpStatusUpdatedActual := rpStatusUpdatedActual(appConfigMapIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) + Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) }) It("Create a staged update run with new resourceSnapshotIndex and verify rollout happens", func() { createStagedUpdateRunSucceed(updateRunName, testNamespace, rpName, resourceSnapshotIndex2nd, strategyName) - // Verify rollout to canary cluster first + // Verify rollout to canary cluster first. By("Verify that the new configmap is updated on member-cluster-2 during canary stage") configMapActual := configMapPlacedOnClusterActual(allMemberClusters[1], &newConfigMap) Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, allMemberClusterNames[1]) validateAndApproveNamespacedApprovalRequests(updateRunName, testNamespace, envCanary) - // Verify complete rollout + // Verify complete rollout. surSucceededActual := stagedUpdateRunStatusSucceededActual(updateRunName, testNamespace, policySnapshotIndex1st, len(allMemberClusters), defaultApplyStrategy, &strategy.Spec, [][]string{{allMemberClusterNames[1]}, {allMemberClusterNames[0], allMemberClusterNames[2]}}, nil, nil, nil) Eventually(surSucceededActual, updateRunEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to validate updateRun %s/%s succeeded", testNamespace, updateRunName) - // Verify new configmap is on all member clusters + // Verify new configmap is on all member clusters. for _, cluster := range allMemberClusters { configMapActual := configMapPlacedOnClusterActual(cluster, &newConfigMap) Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, cluster.ClusterName) @@ -1061,7 +1060,7 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem It("Update the configmap on hub but should not rollout to member clusters with external strategy", func() { updateConfigMapSucceed(&newConfigMap) - // Verify old configmap is still on all member clusters + // Verify old configmap is still on all member clusters. for _, cluster := range allMemberClusters { configMapActual := configMapPlacedOnClusterActual(cluster, &oldConfigMap) Consistently(configMapActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep old configmap %s data on cluster %s", oldConfigMap.Name, cluster.ClusterName) @@ -1071,7 +1070,7 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem It("Should have new resource snapshot but RP status should remain completed with old snapshot", func() { validateLatestResourceSnapshot(rpName, testNamespace, resourceSnapshotIndex2nd) - // RP status should still show completed with old snapshot + // RP status should still show completed with old snapshot. rpStatusUpdatedActual := rpStatusWithExternalStrategyActual(appConfigMapIdentifiers(), resourceSnapshotIndex1st, true, allMemberClusterNames, []string{resourceSnapshotIndex1st, resourceSnapshotIndex1st, resourceSnapshotIndex1st}, []bool{true, true, true}, nil, nil) Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep RP %s/%s status as expected", testNamespace, rpName) @@ -1091,11 +1090,11 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem }) It("Should automatically rollout new resources to all member clusters with rollingUpdate strategy", func() { - // Verify RP status shows all clusters with new resource snapshot + // Verify RP status shows all clusters with new resource snapshot. rpStatusUpdatedActual := rpStatusUpdatedActual(appConfigMapIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex2nd) Eventually(rpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update RP %s/%s status with rollingUpdate strategy", testNamespace, rpName) - // Verify new configmap is on all member clusters + // Verify new configmap is on all member clusters. for _, cluster := range allMemberClusters { configMapActual := configMapPlacedOnClusterActual(cluster, &newConfigMap) Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, cluster.ClusterName) From 81e71d582aa4a288d5bd53d80e01ce30cbf77215 Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Tue, 28 Oct 2025 11:31:12 -0700 Subject: [PATCH 5/5] minor fix Signed-off-by: Arvind Thirumurugan --- test/e2e/cluster_staged_updaterun_test.go | 2 +- test/e2e/staged_updaterun_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/cluster_staged_updaterun_test.go b/test/e2e/cluster_staged_updaterun_test.go index fd8467f8a..35de38ad5 100644 --- a/test/e2e/cluster_staged_updaterun_test.go +++ b/test/e2e/cluster_staged_updaterun_test.go @@ -1001,7 +1001,7 @@ var _ = Describe("test CRP rollout with staged update run", func() { // CRP status should still show completed with old snapshot crpStatusUpdatedActual := crpStatusUpdatedActual(workResourceIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) - Consistently(crpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to update CRP %s status as expected", crpName) + Consistently(crpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep CRP %s status as expected", crpName) }) It("Create a staged update run with new resourceSnapshotIndex and verify rollout happens", func() { diff --git a/test/e2e/staged_updaterun_test.go b/test/e2e/staged_updaterun_test.go index 33ba3985b..22d04c305 100644 --- a/test/e2e/staged_updaterun_test.go +++ b/test/e2e/staged_updaterun_test.go @@ -955,7 +955,7 @@ var _ = Describe("test RP rollout with staged update run", Label("resourceplacem // RP status should still show completed with old snapshot. rpStatusUpdatedActual := rpStatusUpdatedActual(appConfigMapIdentifiers(), allMemberClusterNames, nil, resourceSnapshotIndex1st) - Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to update RP %s/%s status as expected", testNamespace, rpName) + Consistently(rpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep RP %s/%s status as expected", testNamespace, rpName) }) It("Create a staged update run with new resourceSnapshotIndex and verify rollout happens", func() {