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

✨ add AppliedManifestWorkEvictionGracePeriod in klusterlet #327

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
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ spec:
description: WorkConfiguration contains the configuration of work
type: object
properties:
appliedManifestWorkEvictionGracePeriod:
description: AppliedManifestWorkEvictionGracePeriod is the eviction grace period the work agent will wait before evicting the AppliedManifestWorks, whose corresponding ManifestWorks are missing on the hub cluster, from the managed cluster. If not present, the default value of the work agent will be used.
type: string
pattern: ^([0-9]+(s|m|h))+$
featureGates:
description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false."
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,14 @@ spec:
workConfiguration:
description: WorkConfiguration contains the configuration of work
properties:
appliedManifestWorkEvictionGracePeriod:
description: AppliedManifestWorkEvictionGracePeriod is the eviction
grace period the work agent will wait before evicting the AppliedManifestWorks,
whose corresponding ManifestWorks are missing on the hub cluster,
from the managed cluster. If not present, the default value
of the work agent will be used.
pattern: ^([0-9]+(s|m|h))+$
type: string
featureGates:
description: 'FeatureGates represents the list of feature gates
for work If it is set empty, default feature gates will be used.
Expand Down
8 changes: 8 additions & 0 deletions operator/v1/types_klusterlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ type WorkAgentConfiguration struct {
// +optional
// +kubebuilder:default:=100
KubeAPIBurst int32 `json:"kubeAPIBurst,omitempty"`

// AppliedManifestWorkEvictionGracePeriod is the eviction grace period the work agent will wait before
// evicting the AppliedManifestWorks, whose corresponding ManifestWorks are missing on the hub cluster, from
// the managed cluster. If not present, the default value of the work agent will be used.
// +optional
// +kubebuilder:validation:Type=string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does nil mean?

Copy link
Contributor Author

@elgnay elgnay Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nil means the appliedManifestWorkEvictionGracePeriod is not specified. The default value of the work agent will be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a struct is used instead of a pointer, an empty struct will result in a zero value of the appliedManifestWorkEvictionGracePeriod.

// +kubebuilder:validation:Pattern="^([0-9]+(s|m|h))+$"
AppliedManifestWorkEvictionGracePeriod *metav1.Duration `json:"appliedManifestWorkEvictionGracePeriod,omitempty"`
}

const (
Expand Down
7 changes: 4 additions & 3 deletions operator/v1/zz_generated.swagger_doc_generated.go

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

Loading