You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// +kubebuilder:validation:XValidation:rule="!(self != 'External' && oldSelf == 'External')",message="cannot change rollout strategy type from 'External' to other types"
530
530
TypeRolloutStrategyType`json:"type,omitempty"`
531
531
532
532
// Rolling update config params. Present only if RolloutStrategyType = RollingUpdate.
@@ -166,6 +169,14 @@ var _ = Describe("Test placement v1beta1 API validation", func() {
166
169
Expect(errors.As(err, &statusErr)).To(BeTrue(), fmt.Sprintf("Update CRP call produced error %s. Error type wanted is %s.", reflect.TypeOf(err), reflect.TypeOf(&k8sErrors.StatusError{})))
167
170
Expect(statusErr.ErrStatus.Message).Should(MatchRegexp("placement type is immutable"))
168
171
})
172
+
173
+
It("should deny update of RolloutStrategy type when External", func() {
Expect(errors.As(err, &statusErr)).To(BeTrue(), fmt.Sprintf("Update CRP call produced error %s. Error type wanted is %s.", reflect.TypeOf(err), reflect.TypeOf(&k8sErrors.StatusError{})))
178
+
Expect(statusErr.ErrStatus.Message).Should(MatchRegexp("cannot change rollout strategy type from 'External' to other types"))
Consistently(configMapActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep old configmap %s data on cluster %s", oldConfigMap.Name, cluster.ClusterName)
1453
-
}
1454
-
})
1455
-
1456
-
It("Should have new resource snapshot but CRP status should remain completed with old snapshot", func() {
Consistently(crpStatusUpdatedActual, consistentlyDuration, consistentlyInterval).Should(Succeed(), "Failed to keep CRP %s status as expected", crpName)
1463
-
})
1464
-
1465
-
It("Update CRP to use rollingUpdate strategy", func() {
Eventually(crpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update CRP %s status with rollingUpdate strategy", crpName)
Eventually(configMapActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update to the new configmap %s on cluster %s", newConfigMap.Name, cluster.ClusterName)
1487
-
}
1488
-
})
1489
-
})
1490
-
1491
1369
Context("Test parallel cluster updates with maxConcurrency set to 3", Ordered, func() {
0 commit comments