Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiying-lin committed Dec 10, 2024
1 parent 2e6b515 commit 7736d21
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 50 deletions.
2 changes: 1 addition & 1 deletion apis/cluster/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions apis/placement/v1alpha1/override_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ type ClusterResourceOverride struct {
// If the resource is selected by both ClusterResourceOverride and ResourceOverride, ResourceOverride will win when resolving
// conflicts.
type ClusterResourceOverrideSpec struct {
// Placement defines whether the override is applied to a specific placement or not.
// If set, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
// Otherwise, it will be applied to the next rollout.
// The recommended way is to set the placement so that the override can be rolled out immediately.
// +optional
Placement *PlacementRef `json:"placement,omitempty"`

// ClusterResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`.
// If a namespace is selected, ALL the resources under the namespace are selected automatically.
// LabelSelector is not supported.
Expand All @@ -48,13 +55,6 @@ type ClusterResourceOverrideSpec struct {
// Policy defines how to override the selected resources on the target clusters.
// +required
Policy *OverridePolicy `json:"policy"`

// Placement defines whether the override is applied to a specific placement or not.
// If so, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
// Otherwise, it will be applied to the next rollout.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec.placement is immutable"
// +optional
Placement *PlacementRef `json:"placement,omitempty"`
}

// PlacementRef is the reference to a placement.
Expand Down Expand Up @@ -137,6 +137,13 @@ type ResourceOverride struct {
// If the resource is selected by both ClusterResourceOverride and ResourceOverride, ResourceOverride will win when resolving
// conflicts.
type ResourceOverrideSpec struct {
// Placement defines whether the override is applied to a specific placement or not.
// If set, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
// Otherwise, it will be applied to the next rollout.
// The recommended way is to set the placement so that the override can be rolled out immediately.
// +optional
Placement *PlacementRef `json:"placement,omitempty"`

// ResourceSelectors is an array of selectors used to select namespace scoped resources. The selectors are `ORed`.
// You can have 1-20 selectors.
// +kubebuilder:validation:Required
Expand All @@ -148,13 +155,6 @@ type ResourceOverrideSpec struct {
// Policy defines how to override the selected resources on the target clusters.
// +required
Policy *OverridePolicy `json:"policy"`

// Placement defines whether the override is applied to a specific placement or not.
// If so, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
// Otherwise, it will be applied to the next rollout.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec.placement is immutable"
// +optional
Placement *PlacementRef `json:"placement,omitempty"`
}

// ResourceSelector is used to select namespace scoped resources as the target resources to be placed.
Expand Down
20 changes: 10 additions & 10 deletions apis/placement/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/placement/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,16 @@ spec:
placement:
description: |-
Placement defines whether the override is applied to a specific placement or not.
If so, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
If set, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
Otherwise, it will be applied to the next rollout.
The recommended way is to set the placement so that the override can be rolled out immediately.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
x-kubernetes-validations:
- message: spec.placement is immutable
rule: self == oldSelf
policy:
description: Policy defines how to override the selected resources
on the target clusters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,16 @@ spec:
placement:
description: |-
Placement defines whether the override is applied to a specific placement or not.
If so, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
If set, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
Otherwise, it will be applied to the next rollout.
The recommended way is to set the placement so that the override can be rolled out immediately.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
x-kubernetes-validations:
- message: spec.placement is immutable
rule: self == oldSelf
policy:
description: Policy defines how to override the selected resources
on the target clusters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,16 @@ spec:
placement:
description: |-
Placement defines whether the override is applied to a specific placement or not.
If so, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
If set, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
Otherwise, it will be applied to the next rollout.
The recommended way is to set the placement so that the override can be rolled out immediately.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
x-kubernetes-validations:
- message: spec.placement is immutable
rule: self == oldSelf
policy:
description: Policy defines how to override the selected resources
on the target clusters.
Expand Down Expand Up @@ -266,10 +264,7 @@ spec:
minItems: 1
type: array
overrideType:
<<<<<<< HEAD
default: JSONPatch
=======
>>>>>>> 683fa05 (interface: support crp attached override)
description: OverrideType defines the type of the override
rules.
enum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ spec:
placement:
description: |-
Placement defines whether the override is applied to a specific placement or not.
If so, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
If set, the override will trigger the placement rollout immediately when the rollout strategy type is RollingUpdate.
Otherwise, it will be applied to the next rollout.
The recommended way is to set the placement so that the override can be rolled out immediately.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
x-kubernetes-validations:
- message: spec.placement is immutable
rule: self == oldSelf
policy:
description: Policy defines how to override the selected resources
on the target clusters.
Expand Down Expand Up @@ -280,10 +278,7 @@ spec:
minItems: 1
type: array
overrideType:
<<<<<<< HEAD
default: JSONPatch
=======
>>>>>>> 683fa05 (interface: support crp attached override)
description: OverrideType defines the type of the override
rules.
enum:
Expand Down
2 changes: 1 addition & 1 deletion test/apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7736d21

Please sign in to comment.