Skip to content

Commit 2f5e203

Browse files
committed
add work driver to cluster manager.
Signed-off-by: morvencao <[email protected]>
1 parent 29e1b1d commit 2f5e203

3 files changed

+35
-0
lines changed

operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ spec:
323323
type: string
324324
type: object
325325
workConfiguration:
326+
default:
327+
workDriver: kube
326328
description: WorkConfiguration contains the configuration of work
327329
properties:
328330
featureGates:
@@ -356,6 +358,22 @@ spec:
356358
- feature
357359
type: object
358360
type: array
361+
workDriver:
362+
default: kube
363+
description: "WorkDriver represents the type of work driver. Possible
364+
values are \"kube\", \"mqtt\", or \"grpc\". If not provided,
365+
the default value is \"kube\". If set to non-\"kube\" drivers,
366+
the klusterlet need to use the same driver. and the driver configuration
367+
must be provided in a secret named \"work-driver-config\" in
368+
the namespace where the cluster manager is running, adhering
369+
to the following structure: config.yaml: | <driver-config-in-yaml>
370+
\n For detailed driver configuration, please refer to the sdk-go
371+
documentation: https://github.com/open-cluster-management-io/sdk-go/blob/main/pkg/cloudevents/README.md#supported-protocols-and-drivers"
372+
enum:
373+
- kube
374+
- mqtt
375+
- grpc
376+
type: string
359377
type: object
360378
workImagePullSpec:
361379
default: quay.io/open-cluster-management/work

operator/v1/types_clustermanager.go

+16
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type ClusterManagerSpec struct {
6565

6666
// WorkConfiguration contains the configuration of work
6767
// +optional
68+
// +kubebuilder:default={workDriver: kube}
6869
WorkConfiguration *WorkConfiguration `json:"workConfiguration,omitempty"`
6970

7071
// AddOnManagerConfiguration contains the configuration of addon manager
@@ -119,6 +120,21 @@ type WorkConfiguration struct {
119120
// he can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.
120121
// +optional
121122
FeatureGates []FeatureGate `json:"featureGates,omitempty"`
123+
124+
// WorkDriver represents the type of work driver. Possible values are "kube", "mqtt", or "grpc".
125+
// If not provided, the default value is "kube".
126+
// If set to non-"kube" drivers, the klusterlet need to use the same driver.
127+
// and the driver configuration must be provided in a secret named "work-driver-config"
128+
// in the namespace where the cluster manager is running, adhering to the following structure:
129+
// config.yaml: |
130+
// <driver-config-in-yaml>
131+
//
132+
// For detailed driver configuration, please refer to the sdk-go documentation: https://github.com/open-cluster-management-io/sdk-go/blob/main/pkg/cloudevents/README.md#supported-protocols-and-drivers
133+
//
134+
// +optional
135+
// +kubebuilder:default:=kube
136+
// +kubebuilder:validation:Enum=kube;mqtt;grpc
137+
WorkDriver string `json:"workDriver,omitempty"`
122138
}
123139

124140
type AddOnManagerConfiguration struct {

operator/v1/zz_generated.swagger_doc_generated.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)