Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface: support crp attached override #979

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

22 changes: 22 additions & 0 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 @@ -50,6 +57,14 @@ type ClusterResourceOverrideSpec struct {
Policy *OverridePolicy `json:"policy"`
}

// PlacementRef is the reference to a placement.
// For now, we only support ClusterResourcePlacement.
type PlacementRef struct {
zhiying-lin marked this conversation as resolved.
Show resolved Hide resolved
// Name is the reference to the name of placement.
// +required
Name string `json:"name"`
}

// OverridePolicy defines how to override the selected resources on the target clusters.
// More is to be added.
type OverridePolicy struct {
Expand Down Expand Up @@ -122,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 Down
30 changes: 27 additions & 3 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 @@ -129,6 +129,19 @@ spec:
maxItems: 20
minItems: 1
type: array
placement:
description: |-
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.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
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 @@ -143,6 +143,19 @@ spec:
maxItems: 20
minItems: 1
type: array
placement:
description: |-
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.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
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 @@ -44,6 +44,19 @@ spec:
spec:
description: The desired state of ResourceOverrideSpec.
properties:
placement:
description: |-
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.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
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 @@ -58,6 +58,19 @@ spec:
overrideSpec:
description: OverrideSpec stores the spec of ResourceOverride.
properties:
placement:
description: |-
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.
properties:
name:
description: Name is the reference to the name of placement.
type: string
required:
- name
type: object
policy:
description: Policy defines how to override the selected resources
on the target clusters.
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.

Loading