From 5fca09392e2d1d57a28cbfa86fda7b7d8d0eeb49 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 25 Sep 2020 11:40:47 +0300 Subject: [PATCH] Change structure Signed-off-by: Anatolii Bazko --- deploy/crds/org_v1_che_crd.yaml | 8 ++-- pkg/apis/org/v1/che_types.go | 27 ++++++++----- pkg/apis/org/v1/zz_generated.deepcopy.go | 48 ++++++++++++++++-------- pkg/apis/org/v1/zz_generated.openapi.go | 40 +++++--------------- 4 files changed, 63 insertions(+), 60 deletions(-) diff --git a/deploy/crds/org_v1_che_crd.yaml b/deploy/crds/org_v1_che_crd.yaml index 5d338c51e4..dc9b2efe4a 100644 --- a/deploy/crds/org_v1_che_crd.yaml +++ b/deploy/crds/org_v1_che_crd.yaml @@ -130,7 +130,7 @@ spec: operator. type: string ingress: - description: Additional labels to add into an Ingress + description: Ingress custom settings properties: labels: description: Comma separated list of labels that can be used @@ -157,7 +157,7 @@ spec: the Che Dashboard.' type: boolean route: - description: Additional labels to add into a Route + description: Route custom settings properties: labels: description: Comma separated list of labels that can be used @@ -409,7 +409,7 @@ spec: particular configuration for Git. type: boolean ingress: - description: Additional labels to add into an Ingress + description: Ingress custom settings properties: labels: description: Comma separated list of labels that can be used @@ -490,7 +490,7 @@ spec: and `proxySecret` fields). type: string route: - description: Additional labels to add into a Route + description: Route custom settings properties: labels: description: Comma separated list of labels that can be used diff --git a/pkg/apis/org/v1/che_types.go b/pkg/apis/org/v1/che_types.go index ba2dcd94d9..f4e782ab6d 100644 --- a/pkg/apis/org/v1/che_types.go +++ b/pkg/apis/org/v1/che_types.go @@ -273,12 +273,12 @@ type CheClusterSpecServer struct { // The labels that need to be present (and are put) on the configmaps representing the gateway configuration. // +optional SingleHostGatewayConfigMapLabels labels.Set `json:"singleHostGatewayConfigMapLabels,omitempty"` - // Additional labels to add into an Ingress + // Ingress custom settings // +optional - Ingress CheClusterSpecLabels `json:"ingress,omitempty"` - // Additional labels to add into a Route + Ingress IngressCustomSettings `json:"ingress,omitempty"` + // Route custom settings // +optional - Route CheClusterSpecLabels `json:"route,omitempty"` + Route RouteCustomSettings `json:"route,omitempty"` } // +k8s:openapi-gen=true @@ -409,16 +409,23 @@ type CheClusterSpecAuth struct { // Default value is `Always` for `nightly` or `latest` images, and `IfNotPresent` in other cases. // +optional IdentityProviderImagePullPolicy corev1.PullPolicy `json:"identityProviderImagePullPolicy,omitempty"` - // Additional labels to add into an Ingress + // Ingress custom settings // +optional - Ingress CheClusterSpecLabels `json:"ingress,omitempty"` - // Additional labels to add into a Route + Ingress IngressCustomSettings `json:"ingress,omitempty"` + // Route custom settings // +optional - Route CheClusterSpecLabels `json:"route,omitempty"` + Route RouteCustomSettings `json:"route,omitempty"` } -// +k8s:openapi-gen=true -type CheClusterSpecLabels struct { +// Ingress custom settings, can be extended in the future +type IngressCustomSettings struct { + // Comma separated list of labels that can be used to organize and categorize (scope and select) objects. + // +optional + Labels string `json:"labels,omitempty"` +} + +// Route custom settings, can be extended in the future +type RouteCustomSettings struct { // Comma separated list of labels that can be used to organize and categorize (scope and select) objects. // +optional Labels string `json:"labels,omitempty"` diff --git a/pkg/apis/org/v1/zz_generated.deepcopy.go b/pkg/apis/org/v1/zz_generated.deepcopy.go index 466b2965fd..24462961c5 100644 --- a/pkg/apis/org/v1/zz_generated.deepcopy.go +++ b/pkg/apis/org/v1/zz_generated.deepcopy.go @@ -142,22 +142,6 @@ func (in *CheClusterSpecK8SOnly) DeepCopy() *CheClusterSpecK8SOnly { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CheClusterSpecLabels) DeepCopyInto(out *CheClusterSpecLabels) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheClusterSpecLabels. -func (in *CheClusterSpecLabels) DeepCopy() *CheClusterSpecLabels { - if in == nil { - return nil - } - out := new(CheClusterSpecLabels) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CheClusterSpecMetrics) DeepCopyInto(out *CheClusterSpecMetrics) { *out = *in @@ -237,3 +221,35 @@ func (in *CheClusterStatus) DeepCopy() *CheClusterStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressCustomSettings) DeepCopyInto(out *IngressCustomSettings) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressCustomSettings. +func (in *IngressCustomSettings) DeepCopy() *IngressCustomSettings { + if in == nil { + return nil + } + out := new(IngressCustomSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteCustomSettings) DeepCopyInto(out *RouteCustomSettings) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteCustomSettings. +func (in *RouteCustomSettings) DeepCopy() *RouteCustomSettings { + if in == nil { + return nil + } + out := new(RouteCustomSettings) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/org/v1/zz_generated.openapi.go b/pkg/apis/org/v1/zz_generated.openapi.go index 2459977245..bce66f10f3 100644 --- a/pkg/apis/org/v1/zz_generated.openapi.go +++ b/pkg/apis/org/v1/zz_generated.openapi.go @@ -16,7 +16,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecAuth": schema_pkg_apis_org_v1_CheClusterSpecAuth(ref), "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecDB": schema_pkg_apis_org_v1_CheClusterSpecDB(ref), "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecK8SOnly": schema_pkg_apis_org_v1_CheClusterSpecK8SOnly(ref), - "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels": schema_pkg_apis_org_v1_CheClusterSpecLabels(ref), "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecServer": schema_pkg_apis_org_v1_CheClusterSpecServer(ref), "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecStorage": schema_pkg_apis_org_v1_CheClusterSpecStorage(ref), } @@ -230,21 +229,21 @@ func schema_pkg_apis_org_v1_CheClusterSpecAuth(ref common.ReferenceCallback) com }, "ingress": { SchemaProps: spec.SchemaProps{ - Description: "Additional labels to add into an Ingress", - Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels"), + Description: "Ingress custom settings", + Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.IngressCustomSettings"), }, }, "route": { SchemaProps: spec.SchemaProps{ - Description: "Additional labels to add into a Route", - Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels"), + Description: "Route custom settings", + Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.RouteCustomSettings"), }, }, }, }, }, Dependencies: []string{ - "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels"}, + "github.com/eclipse/che-operator/pkg/apis/org/v1.IngressCustomSettings", "github.com/eclipse/che-operator/pkg/apis/org/v1.RouteCustomSettings"}, } } @@ -386,25 +385,6 @@ func schema_pkg_apis_org_v1_CheClusterSpecK8SOnly(ref common.ReferenceCallback) } } -func schema_pkg_apis_org_v1_CheClusterSpecLabels(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "Comma separated list of labels that can be used to organize and categorize (scope and select) objects.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - func schema_pkg_apis_org_v1_CheClusterSpecServer(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -749,21 +729,21 @@ func schema_pkg_apis_org_v1_CheClusterSpecServer(ref common.ReferenceCallback) c }, "ingress": { SchemaProps: spec.SchemaProps{ - Description: "Additional labels to add into an Ingress", - Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels"), + Description: "Ingress custom settings", + Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.IngressCustomSettings"), }, }, "route": { SchemaProps: spec.SchemaProps{ - Description: "Additional labels to add into a Route", - Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels"), + Description: "Route custom settings", + Ref: ref("github.com/eclipse/che-operator/pkg/apis/org/v1.RouteCustomSettings"), }, }, }, }, }, Dependencies: []string{ - "github.com/eclipse/che-operator/pkg/apis/org/v1.CheClusterSpecLabels"}, + "github.com/eclipse/che-operator/pkg/apis/org/v1.IngressCustomSettings", "github.com/eclipse/che-operator/pkg/apis/org/v1.RouteCustomSettings"}, } }