From b61b5eebafd0fc090ff66034d6bd2074a8d329b6 Mon Sep 17 00:00:00 2001 From: morvencao Date: Mon, 18 Mar 2024 14:02:10 +0000 Subject: [PATCH] add work driver to cluster manager. Signed-off-by: morvencao --- ...-cluster-management.io_clustermanagers.crd.yaml | 14 ++++++++++++++ operator/v1/types_clustermanager.go | 13 +++++++++++++ operator/v1/zz_generated.swagger_doc_generated.go | 1 + 3 files changed, 28 insertions(+) diff --git a/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml b/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml index 8cc24234b..2296b90fc 100644 --- a/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml +++ b/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml @@ -356,6 +356,20 @@ spec: - feature type: object type: array + workDriver: + default: kube + description: "WorkDriver represents the type of work driver. Possible + values are \"kube\", \"mqtt\", or \"grpc\". If not provided, + the default value is \"kube\". If the driver is not \"kube\", + the driver config must be provided in a secret named \"work-driver-config\" + with the following structure: config.yaml: | + \n 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" + enum: + - kube + - mqtt + - grpc + type: string type: object workImagePullSpec: default: quay.io/open-cluster-management/work diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 33b0804f9..795c64c20 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -119,6 +119,19 @@ 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"` + + // WorkDriver represents the type of work driver. Possible values are "kube", "mqtt", or "grpc". + // If not provided, the default value is "kube". + // If the driver is not "kube", the driver config must be provided in a secret named "work-driver-config" with the following structure: + // config.yaml: | + // + // + // 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 + // + // +optional + // +kubebuilder:default:=kube + // +kubebuilder:validation:Enum=kube;mqtt;grpc + WorkDriver string `json:"workDriver,omitempty"` } type AddOnManagerConfiguration struct { diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 373b77999..954c6265e 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -156,6 +156,7 @@ func (WebhookConfiguration) SwaggerDoc() map[string]string { var map_WorkConfiguration = map[string]string{ "featureGates": "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:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 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,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", + "workDriver": "WorkDriver represents the type of work driver. Possible values are \"kube\", \"mqtt\", or \"grpc\". If not provided, the default value is \"kube\". If the driver is not \"kube\", the driver config must be provided in a secret named \"work-driver-config\" with the following structure: config.yaml: |\n \n\nFor 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", } func (WorkConfiguration) SwaggerDoc() map[string]string {