Skip to content

Commit 9543d7e

Browse files
feat: update the placement v1 with PR and CPRS (#544)
* update the placement v1 with PR and CPRS Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com> * update the placement v1 with PR and CPRS Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com> * fix the test now that we aded per cluster resource index Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com> * fix: address code review issues in placement v1 API types - Add CEL immutability validations to CRP Spec (matching v1beta1): policy cannot be removed once set, statusReportingScope immutable, placementType immutable, and namespace selector requirement when StatusReportingScope=NamespaceAccessible - Fix contradictory +kubebuilder:validation:Required + omitempty on ClusterResourcePlacementStatus fields (PlacementStatus, LastUpdatedTime) - Add missing +kubebuilder:object:root=true to ResourcePlacementList and ClusterResourcePlacementStatusList Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com> * fix: pin goimports to v0.42.0 and make envelope work de-duplication resilient Two CI fixes: 1. Makefile: pin GOIMPORTS_VER from 'latest' to v0.42.0. golang.org/x/tools v0.43.0 (latest) now requires Go >= 1.25.0, but CI runs Go 1.24.13, causing the unit-and-integration-tests job to fail at setup with: go: golang.org/x/tools/cmd/goimports@latest: requires go >= 1.25.0 2. pkg/controllers/workgenerator/envelope.go: when multiple work objects are found for the same envelope (possible transiently if the same CRP name is reused quickly after deletion), self-heal by deleting all but the most recently created work and proceeding, instead of returning an UnexpectedBehaviorError that causes WorkSynchronized=False on the binding. The previous hard-fail path caused e2e test flakiness in the 'mixed availability statefulset' case where cluster-1's workgenerator would encounter leftover work objects from the prior test context. Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com> * feat: address PR #484 review feedback Remove deprecated ConfigMapEnvelopeType from v1 API, drop duplicate ResourcePlacement* condition types in favor of shorter variants, add CEL validation for placement type immutability on Policy field, and fix envelope duplicate work test to match self-healing behavior. Signed-off-by: Yetkin Timocin <ytimocin@microsoft.com> * Addressing feedback and adding some missing properties Signed-off-by: Yetkin Timocin <ytimocin@microsoft.com> * Address further feedback Signed-off-by: Yetkin Timocin <ytimocin@microsoft.com> --------- Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com> Signed-off-by: Yetkin Timocin <ytimocin@microsoft.com> Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com> Co-authored-by: ryanzhang-oss <ryanzhang-oss@users.noreply.github.com>
1 parent 2520bb6 commit 9543d7e

11 files changed

Lines changed: 3003 additions & 803 deletions

apis/placement/v1/clusterresourceplacement_types.go

Lines changed: 520 additions & 129 deletions
Large diffs are not rendered by default.

apis/placement/v1/override_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type ClusterResourceOverrideSpec struct {
6161
// +kubebuilder:validation:MinItems=1
6262
// +kubebuilder:validation:MaxItems=20
6363
// +required
64-
ClusterResourceSelectors []ClusterResourceSelector `json:"clusterResourceSelectors"`
64+
ClusterResourceSelectors []ResourceSelectorTerm `json:"clusterResourceSelectors"`
6565

6666
// Policy defines how to override the selected resources on the target clusters.
6767
// +required

0 commit comments

Comments
 (0)