Skip to content

Commit

Permalink
Add init cluster annotations and labels setting in klusterlet.
Browse files Browse the repository at this point in the history
Signed-off-by: xuezhaojun <[email protected]>
  • Loading branch information
xuezhaojun committed Jul 25, 2023
1 parent 6d7212c commit 95cf570
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ spec:
description: clientCertExpirationSeconds represents the seconds of a client certificate to expire. If it is not set or 0, the default duration seconds will be set by the hub cluster. If the value is larger than the max signing duration seconds set on the hub cluster, the max signing duration seconds will be set.
type: integer
format: int32
clusterAnnotations:
description: ClusterAnnotations is a set of annotations that are applied to the managed cluster created during the registration process.
type: object
additionalProperties:
type: string
clusterLabels:
description: ClusterLabels is a set of labels that are applied to the managed cluster created during the registration process.
type: object
additionalProperties:
type: string
featureGates:
description: "FeatureGates represents the list of feature gates for registration 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 @@ -184,6 +184,19 @@ spec:
set.
format: int32
type: integer
clusterAnnotations:
additionalProperties:
type: string
description: ClusterAnnotations is a set of annotations that are
applied to the managed cluster created during the registration
process.
type: object
clusterLabels:
additionalProperties:
type: string
description: ClusterLabels is a set of labels that are applied
to the managed cluster created during the registration process.
type: object
featureGates:
description: 'FeatureGates represents the list of feature gates
for registration If it is set empty, default feature gates will
Expand Down
8 changes: 8 additions & 0 deletions operator/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ type RegistrationConfiguration struct {
// he can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.
// +optional
FeatureGates []FeatureGate `json:"featureGates,omitempty"`

// ClusterLabels is a set of labels that are applied to the managed cluster created during the registration process.
// +optional
ClusterLabels map[string]string `json:"clusterLabels,omitempty"`

// ClusterAnnotations is a set of annotations that are applied to the managed cluster created during the registration process.
// +optional
ClusterAnnotations map[string]string `json:"clusterAnnotations,omitempty"`
}

type WorkConfiguration struct {
Expand Down
14 changes: 14 additions & 0 deletions operator/v1/zz_generated.deepcopy.go

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

2 changes: 2 additions & 0 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.

0 comments on commit 95cf570

Please sign in to comment.