Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ type DefaultNamespace struct {
// +optional
// +kubebuilder:default:=true
AutoProvision *bool `json:"autoProvision,omitempty"`
// For OpenShift clusters only, setting this to `true` creates
// a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
// is used instead to trigger cluster-specific Project Templates.
DirectNamespaceCreation *bool `json:"directNamespaceCreation,omitempty"`
}

type DashboardHeaderMessage struct {
Expand Down
5 changes: 5 additions & 0 deletions api/v2/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 @@ -86,7 +86,7 @@ metadata:
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:next
createdAt: "2026-03-19T13:07:33Z"
createdAt: "2026-03-23T09:20:08Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
features.operators.openshift.io/cnf: "false"
Expand All @@ -108,7 +108,7 @@ metadata:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.arm64: supported
operatorframework.io/os.linux: supported
name: eclipse-che.v7.116.0-956.next
name: eclipse-che.v7.116.0-958.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1144,7 +1144,7 @@ spec:
name: gateway-authorization-sidecar-k8s
- image: quay.io/che-incubator/header-rewrite-proxy:latest
name: gateway-header-sidecar
version: 7.116.0-956.next
version: 7.116.0-958.next
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7708,6 +7708,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7662,6 +7662,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
6 changes: 6 additions & 0 deletions deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7683,6 +7683,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7678,6 +7678,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
6 changes: 6 additions & 0 deletions deploy/deployment/openshift/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7683,6 +7683,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7678,6 +7678,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7678,6 +7678,12 @@ spec:
Indicates if is allowed to automatically create a user namespace.
If it set to false, then user namespace must be pre-created by a cluster administrator.
type: boolean
directNamespaceCreation:
description: |-
For OpenShift clusters only, setting this to `true` creates
a standard Kubernetes Namespace directly. When false (default), the OpenShift ProjectRequest API
is used instead to trigger cluster-specific Project Templates.
type: boolean
template:
default: <username>-che
description: |-
Expand Down
15 changes: 8 additions & 7 deletions pkg/common/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ const (
ConfigOpenShiftIOInjectTrustedCaBundle = "config.openshift.io/inject-trusted-cabundle"

// DevEnvironments
PerUserPVCStorageStrategy = "per-user"
DefaultPvcStorageStrategy = "per-user"
PerWorkspacePVCStorageStrategy = "per-workspace"
EphemeralPVCStorageStrategy = "ephemeral"
CommonPVCStorageStrategy = "common"
DefaultDeploymentStrategy = "Recreate"
DefaultAutoProvision = true
PerUserPVCStorageStrategy = "per-user"
DefaultPvcStorageStrategy = "per-user"
PerWorkspacePVCStorageStrategy = "per-workspace"
EphemeralPVCStorageStrategy = "ephemeral"
CommonPVCStorageStrategy = "common"
DefaultDeploymentStrategy = "Recreate"
DefaultAutoProvision = true
OpenShiftDirectNamespaceCreation = false

// Ingress
DefaultSelfSignedCertificateSecretName = "self-signed-certificate"
Expand Down
55 changes: 32 additions & 23 deletions pkg/deploy/server/server_configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ import (
)

type CheConfigMap struct {
JavaOpts string `json:"JAVA_OPTS"`
CheHost string `json:"CHE_HOST"`
ChePort string `json:"CHE_PORT"`
CheDebugServer string `json:"CHE_DEBUG_SERVER"`
CheLogLevel string `json:"CHE_LOG_LEVEL"`
CheMetricsEnabled string `json:"CHE_METRICS_ENABLED"`
CheInfrastructure string `json:"CHE_INFRASTRUCTURE_ACTIVE"`
UserClusterRoles string `json:"CHE_INFRA_KUBERNETES_USER__CLUSTER__ROLES"`
NamespaceDefault string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_DEFAULT"`
NamespaceCreationAllowed string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_CREATION__ALLOWED"`
Http2Disable string `json:"HTTP2_DISABLE"`
KubernetesLabels string `json:"KUBERNETES_LABELS"`
JavaOpts string `json:"JAVA_OPTS"`
CheHost string `json:"CHE_HOST"`
ChePort string `json:"CHE_PORT"`
CheDebugServer string `json:"CHE_DEBUG_SERVER"`
CheLogLevel string `json:"CHE_LOG_LEVEL"`
CheMetricsEnabled string `json:"CHE_METRICS_ENABLED"`
CheInfrastructure string `json:"CHE_INFRASTRUCTURE_ACTIVE"`
UserClusterRoles string `json:"CHE_INFRA_KUBERNETES_USER__CLUSTER__ROLES"`
NamespaceDefault string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_DEFAULT"`
NamespaceCreationAllowed string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_CREATION__ALLOWED"`
Http2Disable string `json:"HTTP2_DISABLE"`
KubernetesLabels string `json:"KUBERNETES_LABELS"`
OpenShiftDirectNamespaceCreation string `json:"CHE_INFRA_OPENSHIFT__DIRECT_NAMESPACE_CREATION"`

// TODO remove when keycloak codebase is removed from che-server component
CheOIDCAuthServerUrl string `json:"CHE_OIDC_AUTH__SERVER__URL,omitempty"`
Expand Down Expand Up @@ -136,18 +137,26 @@ func (s *CheServerReconciler) getConfigMapData(ctx *chetypes.DeployContext) (che

kubernetesLabels := labels.FormatLabels(deploy.GetLabels(defaults.GetCheFlavor()))

openShiftDirectNamespaceCreation := strconv.FormatBool(
pointer.BoolDeref(
ctx.CheCluster.Spec.DevEnvironments.DefaultNamespace.DirectNamespaceCreation,
constants.OpenShiftDirectNamespaceCreation,
),
)

data := &CheConfigMap{
JavaOpts: javaOpts,
CheHost: ctx.CheHost,
ChePort: chePort,
CheDebugServer: cheDebugServer,
CheLogLevel: cheLogLevel,
CheMetricsEnabled: cheMetricsEnabled,
CheInfrastructure: cheInfrastructure,
CheOIDCAuthServerUrl: ctx.CheCluster.Spec.Networking.Auth.IdentityProviderURL,
NamespaceDefault: namespaceDefault,
NamespaceCreationAllowed: namespaceCreationAllowed,
KubernetesLabels: kubernetesLabels,
JavaOpts: javaOpts,
CheHost: ctx.CheHost,
ChePort: chePort,
CheDebugServer: cheDebugServer,
CheLogLevel: cheLogLevel,
CheMetricsEnabled: cheMetricsEnabled,
CheInfrastructure: cheInfrastructure,
CheOIDCAuthServerUrl: ctx.CheCluster.Spec.Networking.Auth.IdentityProviderURL,
NamespaceDefault: namespaceDefault,
NamespaceCreationAllowed: namespaceCreationAllowed,
KubernetesLabels: kubernetesLabels,
OpenShiftDirectNamespaceCreation: openShiftDirectNamespaceCreation,
// Disable HTTP2 protocol.
// Fix issue with creating config maps on the cluster https://issues.redhat.com/browse/CRW-2677
// The root cause is in the HTTP2 protocol support of the okttp3 library that is used by fabric8.kubernetes-client that is used by che-server
Expand Down
1 change: 1 addition & 0 deletions pkg/deploy/server/server_configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func TestGetConfigMapData(t *testing.T) {
"KUBERNETES_LABELS": labels.FormatLabels(deploy.GetLabels(defaults.GetCheFlavor())),
"HTTP2_DISABLE": "true",
"CHE_OIDC_AUTH__SERVER__URL": "http://identity-provider",
"CHE_INFRA_OPENSHIFT__DIRECT_NAMESPACE_CREATION": "false",
},
},
}
Expand Down
Loading