From 1000cd3af8fcaad4bf6a0492faa0c9e5d0a2a21a Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Tue, 21 Mar 2023 18:34:52 +0100 Subject: [PATCH 1/6] feat: allow to configure specific annotations Signed-off-by: Guilhem Bonnefille --- .../devworkspaceoperatorconfig_types.go | 5 + .../solvers/basic_solver.go | 37 ++++-- .../devworkspacerouting/solvers/common.go | 16 +-- .../solvers/common_test.go | 125 ++++++++++++++++++ 4 files changed, 163 insertions(+), 20 deletions(-) create mode 100644 controllers/controller/devworkspacerouting/solvers/common_test.go diff --git a/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go b/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go index 567826695..5d66fc86c 100644 --- a/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go +++ b/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go @@ -57,6 +57,11 @@ type RoutingConfig struct { // DevWorkspaces. However, changing the proxy configuration for the DevWorkspace Operator itself // requires restarting the controller deployment. ProxyConfig *Proxy `json:"proxyConfig,omitempty"` + // Annotations defines the collection of annotations to add on the routing object. + // + // Use this property to set the annotations expected by the routing framework used + // in your cluster (nginx, traefik, ...) + Annotations map[string]string `json:"annotations,omitempty"` } type Proxy struct { diff --git a/controllers/controller/devworkspacerouting/solvers/basic_solver.go b/controllers/controller/devworkspacerouting/solvers/basic_solver.go index a109a65a0..fccca59a3 100644 --- a/controllers/controller/devworkspacerouting/solvers/basic_solver.go +++ b/controllers/controller/devworkspacerouting/solvers/basic_solver.go @@ -22,20 +22,33 @@ import ( "github.com/devfile/devworkspace-operator/pkg/infrastructure" ) -var routeAnnotations = func(endpointName string) map[string]string { - return map[string]string{ - "haproxy.router.openshift.io/rewrite-target": "/", - constants.DevWorkspaceEndpointNameAnnotation: endpointName, +func appendMap[K, V comparable](dst map[K]V, m map[K]V) { + for k, v := range m { + dst[k] = v } } -var nginxIngressAnnotations = func(endpointName string) map[string]string { - return map[string]string{ - "kubernetes.io/ingress.class": "nginx", - "nginx.ingress.kubernetes.io/rewrite-target": "/", - "nginx.ingress.kubernetes.io/ssl-redirect": "false", +var routeAnnotations = map[string]string{ + "haproxy.router.openshift.io/rewrite-target": "/", +} + +var nginxIngressAnnotations = map[string]string{ + "kubernetes.io/ingress.class": "nginx", + "nginx.ingress.kubernetes.io/rewrite-target": "/", + "nginx.ingress.kubernetes.io/ssl-redirect": "false", +} + +func createAnnotations(endpointName string, routingAnnotations map[string]string, defaultAnnotations map[string]string) map[string]string { + annotations := map[string]string{ constants.DevWorkspaceEndpointNameAnnotation: endpointName, } + + if routingAnnotations == nil || len(routingAnnotations) == 0 { + appendMap(annotations, defaultAnnotations) + } else { + appendMap(annotations, routingAnnotations) + } + return annotations } // Basic solver exposes endpoints without any authentication @@ -67,12 +80,12 @@ func (s *BasicSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRou services := getServicesForEndpoints(spec.Endpoints, workspaceMeta) services = append(services, GetDiscoverableServicesForEndpoints(spec.Endpoints, workspaceMeta)...) routingObjects.Services = services + routingAnnotations := config.GetGlobalConfig().Routing.Annotations if infrastructure.IsOpenShift() { - routingObjects.Routes = getRoutesForSpec(routingSuffix, spec.Endpoints, workspaceMeta) + routingObjects.Routes = getRoutesForSpec(routingSuffix, spec.Endpoints, workspaceMeta, routingAnnotations) } else { - routingObjects.Ingresses = getIngressesForSpec(routingSuffix, spec.Endpoints, workspaceMeta) + routingObjects.Ingresses = getIngressesForSpec(routingSuffix, spec.Endpoints, workspaceMeta, routingAnnotations) } - return routingObjects, nil } diff --git a/controllers/controller/devworkspacerouting/solvers/common.go b/controllers/controller/devworkspacerouting/solvers/common.go index 5f17beb81..8e6dc0000 100644 --- a/controllers/controller/devworkspacerouting/solvers/common.go +++ b/controllers/controller/devworkspacerouting/solvers/common.go @@ -153,33 +153,33 @@ func getServicesForEndpoints(endpoints map[string]controllerv1alpha1.EndpointLis } } -func getRoutesForSpec(routingSuffix string, endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata) []routeV1.Route { +func getRoutesForSpec(routingSuffix string, endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata, annotations map[string]string) []routeV1.Route { var routes []routeV1.Route for _, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { if endpoint.Exposure != controllerv1alpha1.PublicEndpointExposure { continue } - routes = append(routes, getRouteForEndpoint(routingSuffix, endpoint, meta)) + routes = append(routes, getRouteForEndpoint(routingSuffix, endpoint, meta, annotations)) } } return routes } -func getIngressesForSpec(routingSuffix string, endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata) []networkingv1.Ingress { +func getIngressesForSpec(routingSuffix string, endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata, annotations map[string]string) []networkingv1.Ingress { var ingresses []networkingv1.Ingress for _, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { if endpoint.Exposure != controllerv1alpha1.PublicEndpointExposure { continue } - ingresses = append(ingresses, getIngressForEndpoint(routingSuffix, endpoint, meta)) + ingresses = append(ingresses, getIngressForEndpoint(routingSuffix, endpoint, meta, annotations)) } } return ingresses } -func getRouteForEndpoint(routingSuffix string, endpoint controllerv1alpha1.Endpoint, meta DevWorkspaceMetadata) routeV1.Route { +func getRouteForEndpoint(routingSuffix string, endpoint controllerv1alpha1.Endpoint, meta DevWorkspaceMetadata, annotations map[string]string) routeV1.Route { targetEndpoint := intstr.FromInt(endpoint.TargetPort) endpointName := common.EndpointName(endpoint.Name) return routeV1.Route{ @@ -189,7 +189,7 @@ func getRouteForEndpoint(routingSuffix string, endpoint controllerv1alpha1.Endpo Labels: map[string]string{ constants.DevWorkspaceIDLabel: meta.DevWorkspaceId, }, - Annotations: routeAnnotations(endpointName), + Annotations: createAnnotations(endpoint.Name, annotations, routeAnnotations), }, Spec: routeV1.RouteSpec{ Host: common.WorkspaceHostname(routingSuffix, meta.DevWorkspaceId), @@ -209,7 +209,7 @@ func getRouteForEndpoint(routingSuffix string, endpoint controllerv1alpha1.Endpo } } -func getIngressForEndpoint(routingSuffix string, endpoint controllerv1alpha1.Endpoint, meta DevWorkspaceMetadata) networkingv1.Ingress { +func getIngressForEndpoint(routingSuffix string, endpoint controllerv1alpha1.Endpoint, meta DevWorkspaceMetadata, annotations map[string]string) networkingv1.Ingress { endpointName := common.EndpointName(endpoint.Name) hostname := common.EndpointHostname(routingSuffix, meta.DevWorkspaceId, endpointName, endpoint.TargetPort) ingressPathType := networkingv1.PathTypeImplementationSpecific @@ -220,7 +220,7 @@ func getIngressForEndpoint(routingSuffix string, endpoint controllerv1alpha1.End Labels: map[string]string{ constants.DevWorkspaceIDLabel: meta.DevWorkspaceId, }, - Annotations: nginxIngressAnnotations(endpoint.Name), + Annotations: createAnnotations(endpoint.Name, annotations, nginxIngressAnnotations), }, Spec: networkingv1.IngressSpec{ Rules: []networkingv1.IngressRule{ diff --git a/controllers/controller/devworkspacerouting/solvers/common_test.go b/controllers/controller/devworkspacerouting/solvers/common_test.go new file mode 100644 index 000000000..dcecebeaa --- /dev/null +++ b/controllers/controller/devworkspacerouting/solvers/common_test.go @@ -0,0 +1,125 @@ +package solvers + +import ( + "testing" + + "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" + "github.com/stretchr/testify/assert" +) + +func TestGetRouteForEndpointAnnotations(t *testing.T) { + tests := []struct { + name string + + routingSuffix string + endpoint v1alpha1.Endpoint + meta DevWorkspaceMetadata + annotations map[string]string + + expectedAnnotationsKeys []string + }{ + { + name: "nil", + + annotations: nil, + + expectedAnnotationsKeys: []string{ + "controller.devfile.io/endpoint_name", + "haproxy.router.openshift.io/rewrite-target", + }, + }, + { + name: "empty", + + annotations: map[string]string{}, + + expectedAnnotationsKeys: []string{ + "controller.devfile.io/endpoint_name", + "haproxy.router.openshift.io/rewrite-target", + }, + }, + { + name: "defined", + + annotations: map[string]string{ + "example.com/extra": "val", + }, + + expectedAnnotationsKeys: []string{ + "controller.devfile.io/endpoint_name", + "example.com/extra"}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + route := getRouteForEndpoint("routingSuffix", v1alpha1.Endpoint{Name: "Endpoint"}, DevWorkspaceMetadata{DevWorkspaceId: "WorkspaceTest"}, tt.annotations) + for _, expected := range tt.expectedAnnotationsKeys { + _, ok := route.Annotations[expected] + assert.True(t, ok, "Key %s does not exist", expected) + assert.Equal(t, len(tt.expectedAnnotationsKeys), len(route.Annotations)) + } + }) + } +} + +func TestGetIngressForEndpointAnnotations(t *testing.T) { + tests := []struct { + name string + + routingSuffix string + endpoint v1alpha1.Endpoint + meta DevWorkspaceMetadata + annotations map[string]string + + expectedAnnotationsKeys []string + }{ + { + name: "nil", + + annotations: nil, + + expectedAnnotationsKeys: []string{ + "controller.devfile.io/endpoint_name", + "kubernetes.io/ingress.class", + "nginx.ingress.kubernetes.io/rewrite-target", + "nginx.ingress.kubernetes.io/ssl-redirect", + }, + }, + { + name: "empty", + + annotations: map[string]string{}, + + expectedAnnotationsKeys: []string{ + "controller.devfile.io/endpoint_name", + "kubernetes.io/ingress.class", + "nginx.ingress.kubernetes.io/rewrite-target", + "nginx.ingress.kubernetes.io/ssl-redirect", + }, + }, + { + name: "defined", + + annotations: map[string]string{ + "kubernetes.io/ingress.class": "traefik", + }, + + expectedAnnotationsKeys: []string{ + "controller.devfile.io/endpoint_name", + "kubernetes.io/ingress.class", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ingress := getIngressForEndpoint("routingSuffix", v1alpha1.Endpoint{Name: "Endpoint"}, DevWorkspaceMetadata{DevWorkspaceId: "WorkspaceTest"}, tt.annotations) + for _, expected := range tt.expectedAnnotationsKeys { + _, ok := ingress.Annotations[expected] + assert.True(t, ok, "Key %s does not exist", expected) + assert.Equal(t, len(tt.expectedAnnotationsKeys), len(ingress.Annotations)) + } + }) + } +} From b5023ecc03c96bbe39af7175f98124527b946fb4 Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Wed, 22 Mar 2023 10:56:55 +0100 Subject: [PATCH 2/6] fix: sync the routing.annotations property Signed-off-by: Guilhem Bonnefille --- pkg/config/sync.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/config/sync.go b/pkg/config/sync.go index 5676b9d79..4c0f0815d 100644 --- a/pkg/config/sync.go +++ b/pkg/config/sync.go @@ -256,6 +256,9 @@ func mergeConfig(from, to *controller.OperatorConfiguration) { if from.Routing.DefaultRoutingClass != "" { to.Routing.DefaultRoutingClass = from.Routing.DefaultRoutingClass } + if from.Routing.Annotations != nil { + to.Routing.Annotations = from.Routing.Annotations + } if from.Routing.ClusterHostSuffix != "" { to.Routing.ClusterHostSuffix = from.Routing.ClusterHostSuffix } @@ -387,6 +390,9 @@ func GetCurrentConfigString(currConfig *controller.OperatorConfiguration) string routing := currConfig.Routing var config []string if routing != nil { + if routing.Annotations != nil && len(routing.Annotations) > 0 { + config = append(config, fmt.Sprintf("routing.Annotations=%s", routing.Annotations)) + } if routing.ClusterHostSuffix != "" && routing.ClusterHostSuffix != defaultConfig.Routing.ClusterHostSuffix { config = append(config, fmt.Sprintf("routing.clusterHostSuffix=%s", routing.ClusterHostSuffix)) } From 4321e9cfa23a270224896ce0f384c655dca1a975 Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Wed, 22 Mar 2023 11:10:26 +0100 Subject: [PATCH 3/6] fix: wording Signed-off-by: Guilhem Bonnefille --- apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go b/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go index 5d66fc86c..9b40ec621 100644 --- a/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go +++ b/apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go @@ -57,7 +57,7 @@ type RoutingConfig struct { // DevWorkspaces. However, changing the proxy configuration for the DevWorkspace Operator itself // requires restarting the controller deployment. ProxyConfig *Proxy `json:"proxyConfig,omitempty"` - // Annotations defines the collection of annotations to add on the routing object. + // Annotations defines the map of annotations to add on to the routing object. // // Use this property to set the annotations expected by the routing framework used // in your cluster (nginx, traefik, ...) From 240e0c9e8e7f5c7d0ba4c62e084cddf207abedca Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Wed, 22 Mar 2023 11:11:44 +0100 Subject: [PATCH 4/6] doc: TODO Co-authored-by: Andrew Obuchowicz Signed-off-by: Guilhem Bonnefille --- .../controller/devworkspacerouting/solvers/basic_solver.go | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/controller/devworkspacerouting/solvers/basic_solver.go b/controllers/controller/devworkspacerouting/solvers/basic_solver.go index fccca59a3..5cb8502cc 100644 --- a/controllers/controller/devworkspacerouting/solvers/basic_solver.go +++ b/controllers/controller/devworkspacerouting/solvers/basic_solver.go @@ -80,6 +80,7 @@ func (s *BasicSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRou services := getServicesForEndpoints(spec.Endpoints, workspaceMeta) services = append(services, GetDiscoverableServicesForEndpoints(spec.Endpoints, workspaceMeta)...) routingObjects.Services = services + // TODO: Use workspace-scoped routing annotations to allow overriding routingAnnotations := config.GetGlobalConfig().Routing.Annotations if infrastructure.IsOpenShift() { routingObjects.Routes = getRoutesForSpec(routingSuffix, spec.Endpoints, workspaceMeta, routingAnnotations) From a8992c03480995125758b163eb6ebc406b38949f Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Wed, 22 Mar 2023 11:12:30 +0100 Subject: [PATCH 5/6] fix: improve tests Co-authored-by: Andrew Obuchowicz Signed-off-by: Guilhem Bonnefille --- .../solvers/common_test.go | 84 ++++++++----------- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/controllers/controller/devworkspacerouting/solvers/common_test.go b/controllers/controller/devworkspacerouting/solvers/common_test.go index dcecebeaa..8ac2b083f 100644 --- a/controllers/controller/devworkspacerouting/solvers/common_test.go +++ b/controllers/controller/devworkspacerouting/solvers/common_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" + "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" ) @@ -11,54 +12,48 @@ func TestGetRouteForEndpointAnnotations(t *testing.T) { tests := []struct { name string - routingSuffix string - endpoint v1alpha1.Endpoint - meta DevWorkspaceMetadata - annotations map[string]string + annotations map[string]string - expectedAnnotationsKeys []string + expectedAnnotations map[string]string }{ { - name: "nil", + name: "Gets default OpenShift route annotation when annotations aren't defined", annotations: nil, - expectedAnnotationsKeys: []string{ - "controller.devfile.io/endpoint_name", - "haproxy.router.openshift.io/rewrite-target", + expectedAnnotations: map[string]string{ + "controller.devfile.io/endpoint_name": "Endpoint", + "haproxy.router.openshift.io/rewrite-target": "/", }, }, { - name: "empty", + name: "Gets default OpenShift route annotation when annotations are empty", annotations: map[string]string{}, - expectedAnnotationsKeys: []string{ - "controller.devfile.io/endpoint_name", - "haproxy.router.openshift.io/rewrite-target", + expectedAnnotations: map[string]string{ + "controller.devfile.io/endpoint_name": "Endpoint", + "haproxy.router.openshift.io/rewrite-target": "/", }, }, { - name: "defined", + name: "Gets default OpenShift route annotation when annotations are defined", annotations: map[string]string{ "example.com/extra": "val", }, - expectedAnnotationsKeys: []string{ - "controller.devfile.io/endpoint_name", - "example.com/extra"}, + expectedAnnotations: map[string]string{ + "controller.devfile.io/endpoint_name": "Endpoint", + "example.com/extra": "val", + }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { route := getRouteForEndpoint("routingSuffix", v1alpha1.Endpoint{Name: "Endpoint"}, DevWorkspaceMetadata{DevWorkspaceId: "WorkspaceTest"}, tt.annotations) - for _, expected := range tt.expectedAnnotationsKeys { - _, ok := route.Annotations[expected] - assert.True(t, ok, "Key %s does not exist", expected) - assert.Equal(t, len(tt.expectedAnnotationsKeys), len(route.Annotations)) - } + assert.Equal(t, tt.expectedAnnotations, route.Annotations, "Annotations should match: Diff: %s", cmp.Diff(tt.expectedAnnotations, route.Annotations)) }) } } @@ -67,47 +62,44 @@ func TestGetIngressForEndpointAnnotations(t *testing.T) { tests := []struct { name string - routingSuffix string - endpoint v1alpha1.Endpoint - meta DevWorkspaceMetadata - annotations map[string]string + annotations map[string]string - expectedAnnotationsKeys []string + expectedAnnotations map[string]string }{ { - name: "nil", + name: "Gets default Kubernetes ingress annotation when annotations aren't defined", annotations: nil, - expectedAnnotationsKeys: []string{ - "controller.devfile.io/endpoint_name", - "kubernetes.io/ingress.class", - "nginx.ingress.kubernetes.io/rewrite-target", - "nginx.ingress.kubernetes.io/ssl-redirect", + expectedAnnotations: map[string]string{ + "controller.devfile.io/endpoint_name": "Endpoint", + "kubernetes.io/ingress.class": "nginx", + "nginx.ingress.kubernetes.io/rewrite-target": "/", + "nginx.ingress.kubernetes.io/ssl-redirect": "false", }, }, { - name: "empty", + name: "Gets default Kubernetes ingress annotation when annotations are empty", annotations: map[string]string{}, - expectedAnnotationsKeys: []string{ - "controller.devfile.io/endpoint_name", - "kubernetes.io/ingress.class", - "nginx.ingress.kubernetes.io/rewrite-target", - "nginx.ingress.kubernetes.io/ssl-redirect", + expectedAnnotations: map[string]string{ + "controller.devfile.io/endpoint_name": "Endpoint", + "kubernetes.io/ingress.class": "nginx", + "nginx.ingress.kubernetes.io/rewrite-target": "/", + "nginx.ingress.kubernetes.io/ssl-redirect": "false", }, }, { - name: "defined", + name: "Gets default Kubernetes ingress annotation when annotations are defined", annotations: map[string]string{ "kubernetes.io/ingress.class": "traefik", }, - expectedAnnotationsKeys: []string{ - "controller.devfile.io/endpoint_name", - "kubernetes.io/ingress.class", + expectedAnnotations: map[string]string{ + "controller.devfile.io/endpoint_name": "Endpoint", + "kubernetes.io/ingress.class": "traefik", }, }, } @@ -115,11 +107,7 @@ func TestGetIngressForEndpointAnnotations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ingress := getIngressForEndpoint("routingSuffix", v1alpha1.Endpoint{Name: "Endpoint"}, DevWorkspaceMetadata{DevWorkspaceId: "WorkspaceTest"}, tt.annotations) - for _, expected := range tt.expectedAnnotationsKeys { - _, ok := ingress.Annotations[expected] - assert.True(t, ok, "Key %s does not exist", expected) - assert.Equal(t, len(tt.expectedAnnotationsKeys), len(ingress.Annotations)) - } + assert.Equal(t, tt.expectedAnnotations, ingress.Annotations, "Annotations should match: Diff: %s", cmp.Diff(tt.expectedAnnotations, ingress.Annotations)) }) } } From e28c740041472c59f8a8de8b3ca3feb14a303d24 Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Wed, 22 Mar 2023 11:34:24 +0100 Subject: [PATCH 6/6] fix: regenerate code and CRDs --- apis/controller/v1alpha1/zz_generated.deepcopy.go | 9 ++++++++- deploy/deployment/kubernetes/combined.yaml | 8 ++++++++ ...s.controller.devfile.io.CustomResourceDefinition.yaml | 8 ++++++++ deploy/deployment/openshift/combined.yaml | 8 ++++++++ ...s.controller.devfile.io.CustomResourceDefinition.yaml | 8 ++++++++ ...ontroller.devfile.io_devworkspaceoperatorconfigs.yaml | 8 ++++++++ 6 files changed, 48 insertions(+), 1 deletion(-) diff --git a/apis/controller/v1alpha1/zz_generated.deepcopy.go b/apis/controller/v1alpha1/zz_generated.deepcopy.go index 9ae8f1578..20a974372 100644 --- a/apis/controller/v1alpha1/zz_generated.deepcopy.go +++ b/apis/controller/v1alpha1/zz_generated.deepcopy.go @@ -22,7 +22,7 @@ package v1alpha1 import ( "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -467,6 +467,13 @@ func (in *RoutingConfig) DeepCopyInto(out *RoutingConfig) { *out = new(Proxy) **out = **in } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingConfig. diff --git a/deploy/deployment/kubernetes/combined.yaml b/deploy/deployment/kubernetes/combined.yaml index b56db24bc..519611420 100644 --- a/deploy/deployment/kubernetes/combined.yaml +++ b/deploy/deployment/kubernetes/combined.yaml @@ -43,6 +43,14 @@ spec: description: Routing defines configuration options related to DevWorkspace networking properties: + annotations: + additionalProperties: + type: string + description: "Annotations defines the map of annotations to add + on to the routing object. \n Use this property to set the annotations + expected by the routing framework used in your cluster (nginx, + traefik, ...)" + type: object clusterHostSuffix: description: ClusterHostSuffix is the hostname suffix to be used for DevWorkspace endpoints. On OpenShift, the DevWorkspace Operator diff --git a/deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml index 2924b7af3..377d960ea 100644 --- a/deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml @@ -43,6 +43,14 @@ spec: description: Routing defines configuration options related to DevWorkspace networking properties: + annotations: + additionalProperties: + type: string + description: "Annotations defines the map of annotations to add + on to the routing object. \n Use this property to set the annotations + expected by the routing framework used in your cluster (nginx, + traefik, ...)" + type: object clusterHostSuffix: description: ClusterHostSuffix is the hostname suffix to be used for DevWorkspace endpoints. On OpenShift, the DevWorkspace Operator diff --git a/deploy/deployment/openshift/combined.yaml b/deploy/deployment/openshift/combined.yaml index 404f76d8f..52b1ff3bf 100644 --- a/deploy/deployment/openshift/combined.yaml +++ b/deploy/deployment/openshift/combined.yaml @@ -43,6 +43,14 @@ spec: description: Routing defines configuration options related to DevWorkspace networking properties: + annotations: + additionalProperties: + type: string + description: "Annotations defines the map of annotations to add + on to the routing object. \n Use this property to set the annotations + expected by the routing framework used in your cluster (nginx, + traefik, ...)" + type: object clusterHostSuffix: description: ClusterHostSuffix is the hostname suffix to be used for DevWorkspace endpoints. On OpenShift, the DevWorkspace Operator diff --git a/deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml index 2924b7af3..377d960ea 100644 --- a/deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml @@ -43,6 +43,14 @@ spec: description: Routing defines configuration options related to DevWorkspace networking properties: + annotations: + additionalProperties: + type: string + description: "Annotations defines the map of annotations to add + on to the routing object. \n Use this property to set the annotations + expected by the routing framework used in your cluster (nginx, + traefik, ...)" + type: object clusterHostSuffix: description: ClusterHostSuffix is the hostname suffix to be used for DevWorkspace endpoints. On OpenShift, the DevWorkspace Operator diff --git a/deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml b/deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml index c6672c04b..eff3ab0ad 100644 --- a/deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml +++ b/deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml @@ -42,6 +42,14 @@ spec: description: Routing defines configuration options related to DevWorkspace networking properties: + annotations: + additionalProperties: + type: string + description: "Annotations defines the map of annotations to add + on to the routing object. \n Use this property to set the annotations + expected by the routing framework used in your cluster (nginx, + traefik, ...)" + type: object clusterHostSuffix: description: ClusterHostSuffix is the hostname suffix to be used for DevWorkspace endpoints. On OpenShift, the DevWorkspace Operator