Skip to content

Commit

Permalink
Merge pull request #92 from metlos/bug/14795-use-new-props-for-wrkspc…
Browse files Browse the repository at this point in the history
…-namespace

Support for the new way of specifying the workspace namespace in Che.
  • Loading branch information
sleshchenko authored Nov 13, 2019
2 parents 36e666c + 4d15f5d commit d121ea8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deploy/crds/org_v1_che_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
storage:
# persistent volume claim strategy for Che server. Can be common (all workspaces PVCs in one volume),
# per-workspace (one PVC per workspace for all declared volumes) and unique (one PVC per declared volume). Defaults to common
pvcStrategy: 'per-workspace'
pvcStrategy: 'common'
# size of a persistent volume claim for workspaces. Defaults to 1Gi
pvcClaimSize: '1Gi'
# instruct Che server to launch a special pod to precreate a subpath in a PV
Expand Down
9 changes: 4 additions & 5 deletions pkg/deploy/che_configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type CheConfigMap struct {
CheDebugServer string `json:"CHE_DEBUG_SERVER"`
CheInfrastructureActive string `json:"CHE_INFRASTRUCTURE_ACTIVE"`
CheInfraKubernetesServiceAccountName string `json:"CHE_INFRA_KUBERNETES_SERVICE__ACCOUNT__NAME"`
WorkspacesNamespace string `json:"CHE_INFRA_OPENSHIFT_PROJECT"`
DefaultTargetNamespace string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_DEFAULT"`
PvcStrategy string `json:"CHE_INFRA_KUBERNETES_PVC_STRATEGY"`
PvcClaimSize string `json:"CHE_INFRA_KUBERNETES_PVC_QUANTITY"`
PvcJobsImage string `json:"CHE_INFRA_KUBERNETES_PVC_JOBS_IMAGE"`
Expand Down Expand Up @@ -84,12 +84,12 @@ func GetConfigMapData(cr *orgv1.CheCluster) (cheEnv map[string]string) {
if isOpenShift {
infra = "openshift"
}
workspacesNamespace := cr.Namespace
defaultTargetNamespace := cr.Namespace
tls := "false"
openShiftIdentityProviderId := "NULL"
openshiftOAuth := cr.Spec.Auth.OpenShiftoAuth
if openshiftOAuth && isOpenShift {
workspacesNamespace = ""
defaultTargetNamespace = "<username>-" + cheFlavor
openShiftIdentityProviderId = "openshift-v3"
if isOpenshift4 {
openShiftIdentityProviderId = "openshift-v4"
Expand Down Expand Up @@ -158,7 +158,7 @@ func GetConfigMapData(cr *orgv1.CheCluster) (cheEnv map[string]string) {
CheDebugServer: cheDebug,
CheInfrastructureActive: infra,
CheInfraKubernetesServiceAccountName: "che-workspace",
WorkspacesNamespace: workspacesNamespace,
DefaultTargetNamespace: defaultTargetNamespace,
PvcStrategy: pvcStrategy,
PvcClaimSize: pvcClaimSize,
WorkspacePvcStorageClassName: workspacePvcStorageClassName,
Expand Down Expand Up @@ -196,7 +196,6 @@ func GetConfigMapData(cr *orgv1.CheCluster) (cheEnv map[string]string) {
k8sCheEnv := map[string]string{
"CHE_INFRA_KUBERNETES_POD_SECURITY__CONTEXT_FS__GROUP": securityContextFsGroup,
"CHE_INFRA_KUBERNETES_POD_SECURITY__CONTEXT_RUN__AS__USER": securityContextRunAsUser,
"CHE_INFRA_KUBERNETES_NAMESPACE": workspacesNamespace,
"CHE_INFRA_KUBERNETES_INGRESS_DOMAIN": ingressDomain,
"CHE_INFRA_KUBERNETES_SERVER__STRATEGY": ingressStrategy,
"CHE_INFRA_KUBERNETES_TLS__SECRET": tlsSecretName,
Expand Down

0 comments on commit d121ea8

Please sign in to comment.