Skip to content

Commit

Permalink
add flag option field for the operator CRDs
Browse files Browse the repository at this point in the history
Signed-off-by: ZhiweiYin <[email protected]>
  • Loading branch information
zhiweiyin318 committed Jan 10, 2024
1 parent f6404f3 commit c79ec22
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ spec:
enum:
- Enable
- Disable
flagOptions:
description: FlagOptions represents a list of flag options for the component binary. The key is the option name, the value is the option value. The FlagOptions can override all configured options including the default options and FeatureGates, etc.
type: array
items:
type: object
properties:
key:
description: Key is the flag option name of the component binary.
type: string
value:
description: Value is the value of the flag option.
type: string
registrationImagePullSpec:
description: RegistrationImagePullSpec represents the desired image configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified.
type: string
Expand Down Expand Up @@ -177,6 +189,18 @@ spec:
enum:
- Enable
- Disable
flagOptions:
description: FlagOptions represents a list of flag options for the component binary. The key is the option name, the value is the option value. The FlagOptions can override all configured options including the default options and FeatureGates, etc.
type: array
items:
type: object
properties:
key:
description: Key is the flag option name of the component binary.
type: string
value:
description: Value is the value of the flag option.
type: string
workImagePullSpec:
description: WorkImagePullSpec represents the desired image configuration of work agent. quay.io/open-cluster-management.io/work:latest will be used if unspecified.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,22 @@ spec:
- feature
type: object
type: array
flagOptions:
description: FlagOptions represents a list of flag options for
the component binary. The key is the option name, the value
is the option value. The FlagOptions can override all configured
options including the default options and FeatureGates, etc.
items:
properties:
key:
description: Key is the flag option name of the component
binary.
type: string
value:
description: Value is the value of the flag option.
type: string
type: object
type: array
type: object
registrationImagePullSpec:
description: RegistrationImagePullSpec represents the desired image
Expand Down Expand Up @@ -274,6 +290,22 @@ spec:
- feature
type: object
type: array
flagOptions:
description: FlagOptions represents a list of flag options for
the component binary. The key is the option name, the value
is the option value. The FlagOptions can override all configured
options including the default options and FeatureGates, etc.
items:
properties:
key:
description: Key is the flag option name of the component
binary.
type: string
value:
description: Value is the value of the flag option.
type: string
type: object
type: array
type: object
workImagePullSpec:
description: WorkImagePullSpec represents the desired image configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ spec:
- feature
type: object
type: array
flagOptions:
description: FlagOptions represents a list of flag options for
the component binary. The key is the option name, the value
is the option value. The FlagOptions can override all configured
options including the default options and FeatureGates, etc.
items:
properties:
key:
description: Key is the flag option name of the component
binary.
type: string
value:
description: Value is the value of the flag option.
type: string
type: object
type: array
type: object
addOnManagerImagePullSpec:
default: quay.io/open-cluster-management/addon-manager
Expand Down Expand Up @@ -253,6 +269,22 @@ spec:
- feature
type: object
type: array
flagOptions:
description: FlagOptions represents a list of flag options for
the component binary. The key is the option name, the value
is the option value. The FlagOptions can override all configured
options including the default options and FeatureGates, etc.
items:
properties:
key:
description: Key is the flag option name of the component
binary.
type: string
value:
description: Value is the value of the flag option.
type: string
type: object
type: array
type: object
registrationImagePullSpec:
default: quay.io/open-cluster-management/registration
Expand Down Expand Up @@ -293,6 +325,22 @@ spec:
- feature
type: object
type: array
flagOptions:
description: FlagOptions represents a list of flag options for
the component binary. The key is the option name, the value
is the option value. The FlagOptions can override all configured
options including the default options and FeatureGates, etc.
items:
properties:
key:
description: Key is the flag option name of the component
binary.
type: string
value:
description: Value is the value of the flag option.
type: string
type: object
type: array
type: object
workImagePullSpec:
default: quay.io/open-cluster-management/work
Expand Down
25 changes: 25 additions & 0 deletions operator/v1/types_clustermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ type RegistrationHubConfiguration 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"`

// FlagOptions represents a list of flag options for the component binary.
// The key is the option name, the value is the option value.
// The FlagOptions can override all configured options including the default options and FeatureGates, etc.
// +optional
FlagOptions []FlagOptions `json:"flagOptions,omitempty"`
}

type WorkConfiguration struct {
Expand All @@ -114,6 +120,12 @@ type WorkConfiguration 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"`

// FlagOptions represents a list of flag options for the component binary.
// The key is the option name, the value is the option value.
// The FlagOptions can override all configured options including the default options and FeatureGates, etc.
// +optional
FlagOptions []FlagOptions `json:"flagOptions,omitempty"`
}

type AddOnManagerConfiguration struct {
Expand All @@ -126,6 +138,12 @@ type AddOnManagerConfiguration 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"`

// FlagOptions represents a list of flag options for the component binary.
// The key is the option name, the value is the option value.
// The FlagOptions can override all configured options including the default options and FeatureGates, etc.
// +optional
FlagOptions []FlagOptions `json:"flagOptions,omitempty"`
}

type FeatureGate struct {
Expand All @@ -152,6 +170,13 @@ const (
FeatureGateModeTypeDisable FeatureGateModeType = "Disable"
)

type FlagOptions struct {
// Key is the flag option name of the component binary.
Key string `json:"key,omitempty"`
// Value is the value of the flag option.
Value string `json:"value,omitempty"`
}

// HostedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the Hosted mode.
type HostedClusterManagerConfiguration struct {
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
Expand Down
6 changes: 6 additions & 0 deletions operator/v1/types_klusterlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ type RegistrationConfiguration struct {
// ManagedCluster when creating only, other actors can update it afterwards.
// +optional
ClusterAnnotations map[string]string `json:"clusterAnnotations,omitempty"`

// FlagOptions represents a list of flag options for the component binary.
// The key is the option name, the value is the option value.
// The FlagOptions can override all configured options including the default options and FeatureGates, etc.
// +optional
FlagOptions []FlagOptions `json:"flagOptions,omitempty"`
}

const (
Expand Down
13 changes: 13 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 c79ec22

Please sign in to comment.