Skip to content

Commit

Permalink
Change structure
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Sep 25, 2020
1 parent d3af035 commit 5fca093
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 60 deletions.
8 changes: 4 additions & 4 deletions deploy/crds/org_v1_che_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
27 changes: 17 additions & 10 deletions pkg/apis/org/v1/che_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand Down
48 changes: 32 additions & 16 deletions pkg/apis/org/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 10 additions & 30 deletions pkg/apis/org/v1/zz_generated.openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down Expand Up @@ -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"},
}
}

Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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"},
}
}

Expand Down

0 comments on commit 5fca093

Please sign in to comment.