Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Mar 16, 2022
1 parent 169a51b commit 5552c48
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 25 deletions.
11 changes: 11 additions & 0 deletions api/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ func TestConvertTo(t *testing.T) {
DevWorkspace: v1.CheClusterSpecDevWorkspace{
Enable: true,
ControllerImage: "ControllerImage",
RunningLimit: "RunningLimit",
},
Dashboard: v1.CheClusterSpecDashboard{
Warning: "DashboardWarning",
},
},
Status: v1.CheClusterStatus{
Expand Down Expand Up @@ -252,6 +256,7 @@ func TestConvertTo(t *testing.T) {
assert.Equal(t, checlusterv2.Spec.Dashboard.Deployment.Container.Resources.Requests.Memory, "DashboardMemoryRequest")
assert.Equal(t, checlusterv2.Spec.Dashboard.Deployment.SecurityContext.FsGroup, "SecurityContextFsGroup")
assert.Equal(t, checlusterv2.Spec.Dashboard.Deployment.SecurityContext.RunAsUser, "SecurityContextRunAsUser")
assert.Equal(t, checlusterv2.Spec.Dashboard.Warning, "DashboardWarning")

assert.Equal(t, checlusterv2.Spec.Database.CredentialsSecretRef, "ChePostgresSecret")
assert.Equal(t, checlusterv2.Spec.Database.Deployment.Container.Image, "PostgresImage")
Expand All @@ -271,6 +276,7 @@ func TestConvertTo(t *testing.T) {
assert.Equal(t, checlusterv2.Spec.Database.Pvc.StorageClass, "PostgresPVCStorageClassName")

assert.Equal(t, checlusterv2.Spec.DevWorkspace.Deployment.Container.Image, "ControllerImage")
assert.Equal(t, checlusterv2.Spec.DevWorkspace.RunningLimit, "RunningLimit")
assert.Equal(t, checlusterv2.Spec.ImagePuller.Enable, true)
assert.Equal(t, checlusterv2.Spec.Metrics.Enable, true)

Expand Down Expand Up @@ -522,6 +528,7 @@ func TestConvertFrom(t *testing.T) {
FsGroup: "FsGroup",
},
},
Warning: "DashboardWarning",
},
Storage: v2.CheClusterSpecStorage{
Pvc: v2.PVC{
Expand All @@ -544,6 +551,7 @@ func TestConvertFrom(t *testing.T) {
Image: "DevWorkspaceImage",
},
},
RunningLimit: "RunningLimit",
},
},
Status: v2.CheClusterStatus{
Expand Down Expand Up @@ -595,6 +603,9 @@ func TestConvertFrom(t *testing.T) {
assert.Equal(t, checlusterv1.Spec.Database.PvcClaimSize, "DatabaseClaimSize")

assert.Equal(t, checlusterv1.Spec.DevWorkspace.ControllerImage, "DevWorkspaceImage")
assert.Equal(t, checlusterv1.Spec.DevWorkspace.RunningLimit, "RunningLimit")

assert.Equal(t, checlusterv1.Spec.Dashboard.Warning, "DashboardWarning")

assert.Equal(t, checlusterv1.Spec.ImagePuller.Enable, true)
assert.Equal(t, checlusterv1.Spec.Metrics.Enable, true)
Expand Down
6 changes: 6 additions & 0 deletions api/v1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (src *CheCluster) ConvertTo(dstRaw conversion.Hub) error {
FsGroup: src.Spec.K8s.SecurityContextFsGroup,
},
}
dst.Spec.Dashboard.Warning = src.Spec.Dashboard.Warning

// Devfile registry
dst.Spec.DevfileRegistry.DisableInternalRegistry = src.Spec.Server.ExternalDevfileRegistry
Expand Down Expand Up @@ -261,6 +262,7 @@ func (src *CheCluster) ConvertTo(dstRaw conversion.Hub) error {
Image: src.Spec.DevWorkspace.ControllerImage,
},
}
dst.Spec.DevWorkspace.RunningLimit = src.Spec.DevWorkspace.RunningLimit

// ImagePuller
dst.Spec.ImagePuller.Enable = src.Spec.ImagePuller.Enable
Expand Down Expand Up @@ -426,6 +428,7 @@ func (dst *CheCluster) ConvertFrom(srcRaw conversion.Hub) error {

// DevWorkspace
dst.Spec.DevWorkspace.ControllerImage = src.Spec.DevWorkspace.Deployment.Container.Image
dst.Spec.DevWorkspace.RunningLimit = src.Spec.DevWorkspace.RunningLimit

// ImagePuller
dst.Spec.ImagePuller.Enable = src.Spec.ImagePuller.Enable
Expand All @@ -434,6 +437,9 @@ func (dst *CheCluster) ConvertFrom(srcRaw conversion.Hub) error {
// Metrics
dst.Spec.Metrics.Enable = src.Spec.Metrics.Enable

// Dashboard
dst.Spec.Dashboard.Warning = src.Spec.Dashboard.Warning

// Storage
dst.Spec.Storage.PostgresPVCStorageClassName = src.Spec.Database.Pvc.StorageClass
dst.Spec.Storage.PreCreateSubPaths = src.Spec.Storage.PreCreateSubPaths
Expand Down
1 change: 0 additions & 1 deletion api/v1/zz_generated.deepcopy.go

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

6 changes: 6 additions & 0 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ type CheClusterSpecDashboard struct {
// Deployment override options.
// +optional
Deployment DeploymentCustomSettings `json:"deployment,omitempty"`
// Warning message that will be displayed on the User Dashboard
// +optional
Warning string `json:"warning,omitempty"`
}

// Configuration settings related to the Plugin Registry used by the Che installation.
Expand Down Expand Up @@ -289,6 +292,9 @@ type CheClusterSpecDevWorkspace struct {
// Deployment override options.
// +optional
Deployment DeploymentCustomSettings `json:"deployment,omitempty"`
// Maximum number of the running workspaces per user.
// +optional
RunningLimit string `json:"runningLimit,omitempty"`
}

type WorkspacesDefaultPlugins struct {
Expand Down
2 changes: 1 addition & 1 deletion api/v2/zz_generated.deepcopy.go

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

3 changes: 1 addition & 2 deletions api/v2alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.44.0-440.next
name: eclipse-che-preview-openshift.v7.45.0-441.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -122,15 +122,9 @@ spec:
by the Che installation.
displayName: Authentication
path: auth
- description: Deprecated. The value of this flag is ignored. Sidecar functionality
is now implemented in Traefik plugin.
displayName: Gateway Header Rewrite Sidecar Image
path: auth.gatewayHeaderRewriteSidecarImage
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Configuration settings related to the User Dashboard used
by the Che installation.
displayName: User Dashboard
- description: Configuration settings related to the Dashboard sed by the
Che installation.
displayName: Devfile registry
path: dashboard
- description: Configuration settings related to the database used by the
Che installation.
Expand Down Expand Up @@ -255,6 +249,10 @@ spec:
path: auth.gatewayHeaderRewriteSidecarImage
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Configuration settings related to the User Dashboard used
by the Che installation.
displayName: User Dashboard
path: dashboard
- description: Configuration settings related to the database used by the
Che installation.
displayName: Database
Expand Down Expand Up @@ -1421,7 +1419,7 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.44.0-440.next
version: 7.45.0-441.next
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,10 @@ spec:
type: string
type: object
type: object
warning:
description: Warning message that will be displayed on the User
Dashboard
type: string
type: object
database:
description: Configuration settings related to the database used
Expand Down Expand Up @@ -1627,6 +1631,9 @@ spec:
type: string
type: object
type: object
runningLimit:
description: Maximum number of the running workspaces per user.
type: string
type: object
devfileRegistry:
description: Configuration settings related to the Devfile registry
Expand Down
19 changes: 19 additions & 0 deletions config/crd/bases/org_v1_che_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ spec:
first login. Defaults to `false`.
type: boolean
type: object
dashboard:
description: Configuration settings related to the User Dashboard
used by the Che installation.
properties:
warning:
description: Warning message that will be displayed on the User
Dashboard
type: string
type: object
database:
description: Configuration settings related to the database used
by the Che installation.
Expand Down Expand Up @@ -401,6 +410,9 @@ spec:
installed. Fails when a non-matching version of the Operator
is already installed.
type: boolean
runningLimit:
description: Maximum number of the running workspaces per user.
type: string
required:
- enable
type: object
Expand Down Expand Up @@ -1421,6 +1433,10 @@ spec:
type: string
type: object
type: object
warning:
description: Warning message that will be displayed on the User
Dashboard
type: string
type: object
database:
description: Configuration settings related to the database used
Expand Down Expand Up @@ -1599,6 +1615,9 @@ spec:
type: string
type: object
type: object
runningLimit:
description: Maximum number of the running workspaces per user.
type: string
type: object
devfileRegistry:
description: Configuration settings related to the Devfile registry
Expand Down
16 changes: 7 additions & 9 deletions config/manifests/bases/che-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,9 @@ spec:
the Che installation.
displayName: Authentication
path: auth
- description: Deprecated. The value of this flag is ignored. Sidecar functionality
is now implemented in Traefik plugin.
displayName: Gateway Header Rewrite Sidecar Image
path: auth.gatewayHeaderRewriteSidecarImage
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Configuration settings related to the User Dashboard used by
the Che installation.
displayName: User Dashboard
- description: Configuration settings related to the Dashboard sed by the Che
installation.
displayName: Devfile registry
path: dashboard
- description: Configuration settings related to the database used by the Che
installation.
Expand Down Expand Up @@ -207,6 +201,10 @@ spec:
path: auth.gatewayHeaderRewriteSidecarImage
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Configuration settings related to the User Dashboard used by
the Che installation.
displayName: User Dashboard
path: dashboard
- description: Configuration settings related to the database used by the Che
installation.
displayName: Database
Expand Down
19 changes: 19 additions & 0 deletions helmcharts/next/crds/org_v1_che_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ spec:
first login. Defaults to `false`.
type: boolean
type: object
dashboard:
description: Configuration settings related to the User Dashboard
used by the Che installation.
properties:
warning:
description: Warning message that will be displayed on the User
Dashboard
type: string
type: object
database:
description: Configuration settings related to the database used
by the Che installation.
Expand Down Expand Up @@ -401,6 +410,9 @@ spec:
installed. Fails when a non-matching version of the Operator
is already installed.
type: boolean
runningLimit:
description: Maximum number of the running workspaces per user.
type: string
required:
- enable
type: object
Expand Down Expand Up @@ -1421,6 +1433,10 @@ spec:
type: string
type: object
type: object
warning:
description: Warning message that will be displayed on the User
Dashboard
type: string
type: object
database:
description: Configuration settings related to the database used
Expand Down Expand Up @@ -1599,6 +1615,9 @@ spec:
type: string
type: object
type: object
runningLimit:
description: Maximum number of the running workspaces per user.
type: string
type: object
devfileRegistry:
description: Configuration settings related to the Devfile registry
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "CheCluster")
os.Exit(1)
}

// +kubebuilder:scaffold:builder
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
Expand Down

0 comments on commit 5552c48

Please sign in to comment.