feat: update the placement v1 with PR and CPRS#484
feat: update the placement v1 with PR and CPRS#484ryanzhang-oss wants to merge 5 commits intokubefleet-dev:mainfrom
Conversation
Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com>
Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| // ClusterResourcePlacementSpec defines the desired state of ClusterResourcePlacement. | ||
| type ClusterResourcePlacementSpec struct { | ||
| // PlacementSpec defines the desired state of ClusterResourcePlacement. | ||
| type PlacementSpec struct { |
There was a problem hiding this comment.
Do we have a repo-wide naming convention?
There was a problem hiding this comment.
this is k8s api so we follow k8s naming convention
Signed-off-by: Ryan Zhang <yangzhangrice@hotmail.com>
michaelawyu
left a comment
There was a problem hiding this comment.
LGTM ;) I can submit additional API progression E2E test cases if needed.
| // The desired state of ClusterResourcePlacement. | ||
| // +required | ||
| Spec ClusterResourcePlacementSpec `json:"spec"` | ||
| Spec PlacementSpec `json:"spec"` |
There was a problem hiding this comment.
I added some CEL to v1beta1 PlacementSpec and Policy
https://github.com/kubefleet-dev/kubefleet/pull/315/changes
Should we include those as well?
There was a problem hiding this comment.
We can have yetkin add it in his PR.
| @@ -885,15 +935,26 @@ type EnvelopeType string | |||
| const ( | |||
| // ConfigMapEnvelopeType means the envelope object is of type `ConfigMap`. | |||
| ConfigMapEnvelopeType EnvelopeType = "ConfigMap" | |||
There was a problem hiding this comment.
Non-blocking but is it time to drop this?
| @@ -1203,6 +1275,57 @@ const ( | |||
| // - "Unknown" means we haven't finished the apply yet so that we cannot check the resource availability. | |||
| ResourcesAvailableConditionType ResourcePlacementConditionType = "Available" | |||
There was a problem hiding this comment.
Think this and the ones above should have been replaced by the ones below.
Code reviewFound 5 issues:
kubefleet/apis/placement/v1/clusterresourceplacement_types.go Lines 1480 to 1498 in 2e3152b
kubefleet/apis/placement/v1/clusterresourceplacement_types.go Lines 1480 to 1498 in 2e3152b
kubefleet/apis/placement/v1/clusterresourceplacement_types.go Lines 1530 to 1537 in 2e3152b |
- 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>
…esilient
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>
3433d12 to
2d86616
Compare


Description of your changes
update the placement v1 with PR and CPRS
Fixes #
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer