From f379e5c0995ee18c7bf78a74a37c51b1712853ae Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 3 Jun 2022 10:58:54 +0300 Subject: [PATCH] Fixups Signed-off-by: Anatolii Bazko --- .github/bin/common.sh | 20 ++++++++--------- Makefile | 14 ++++++------ .../che-operator.clusterserviceversion.yaml | 22 +++++++++---------- config/samples/org_v2_checluster.yaml | 4 ++-- controllers/che/checluster_validator.go | 2 +- controllers/devworkspace/controller.go | 2 +- .../kubernetes/org_v2_checluster.yaml | 4 ++-- .../openshift/org_v2_checluster.yaml | 4 ++-- helmcharts/next/README.md | 8 +++---- .../next/templates/org_v2_checluster.yaml | 12 +++++----- helmcharts/next/values.yaml | 2 +- helmcharts/stable/README.md | 8 +++---- .../on-reconcile-one-time-migration.go | 2 +- 13 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.github/bin/common.sh b/.github/bin/common.sh index 9759d30f4f..52d2c021f4 100755 --- a/.github/bin/common.sh +++ b/.github/bin/common.sh @@ -202,10 +202,10 @@ deployEclipseCheWithHelm() { deployEclipseCheWithOperator "${chectlbin}" "${platform}" "${templates}" "${customimage}" # Get configuration - local identityProvider=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.ingress.auth.identityProviderURL}') - local oAuthSecret=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.ingress.auth.oAuthSecret}') - local oAuthClientName=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.ingress.auth.oAuthClientName}') - local domain=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.ingress.domain}') + local identityProvider=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.networking.auth.identityProviderURL}') + local oAuthSecret=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.networking.auth.oAuthSecret}') + local oAuthClientName=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.networking.auth.oAuthClientName}') + local domain=$(kubectl get checluster/eclipse-che -n ${NAMESPACE} -o jsonpath='{.spec.networking.domain}') # Delete Eclipse Che (Cert Manager and Dex are still there) ${chectlbin} server:delete -y -n ${NAMESPACE} @@ -226,10 +226,10 @@ deployEclipseCheWithHelm() { helm install che \ --create-namespace \ --namespace eclipse-che \ - --set ingress.domain="${domain}" \ - --set ingress.auth.oAuthSecret="${oAuthSecret}" \ - --set ingress.auth.oAuthClientName="${oAuthClientName}" \ - --set ingress.auth.identityProviderURL="${identityProvider}" . + --set networking.domain="${domain}" \ + --set networking.auth.oAuthSecret="${oAuthSecret}" \ + --set networking.auth.oAuthClientName="${oAuthClientName}" \ + --set networking.auth.identityProviderURL="${identityProvider}" . popd local cheVersion=$(yq -r '.spec.template.spec.containers[0].env[] | select(.name == "CHE_VERSION") | .value' < "${OPERATOR_DEPLOYMENT}") @@ -258,8 +258,8 @@ deployEclipseCheWithOperator() { checluster=$(grep -rlx "kind: CheCluster" /tmp/chectl-templates/che-operator/) apiVersion=$(yq -r '.apiVersion' ${checluster}) if [[ ${apiVersion} == "org.eclipse.che/v2" ]]; then - yq -riY '.spec.ingress.domain = "'$(minikube ip).nip.io'"' ${checluster} - yq -riY '.spec.ingress.tlsSecretName = "che-tls"' ${checluster} + yq -riY '.spec.networking.domain = "'$(minikube ip).nip.io'"' ${checluster} + yq -riY '.spec.networking.tlsSecretName = "che-tls"' ${checluster} else yq -riY '.spec.k8s.ingressDomain = "'$(minikube ip).nip.io'"' ${checluster} fi diff --git a/Makefile b/Makefile index 937ac44317..5ad441b264 100644 --- a/Makefile +++ b/Makefile @@ -215,11 +215,11 @@ update-helmcharts: ## Update Helm Charts yq -rYi --arg examples "$${CRDS_SAMPLES}" ".annotations.\"artifacthub.io/crdsExamples\" = \$$examples" $${chartYaml} rm -rf $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml else - yq -riY '.spec.ingress.tlsSecretName = "che-tls"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml - yq -riY '.spec.ingress.domain = "{{ .Values.ingress.domain }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml - yq -riY '.spec.ingress.auth.oAuthSecret = "{{ .Values.ingress.auth.oAuthSecret }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml - yq -riY '.spec.ingress.auth.oAuthClientName = "{{ .Values.ingress.auth.oAuthClientName }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml - yq -riY '.spec.ingress.auth.identityProviderURL = "{{ .Values.ingress.auth.identityProviderURL }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml + yq -riY '.spec.networking.tlsSecretName = "che-tls"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml + yq -riY '.spec.networking.domain = "{{ .Values.networking.domain }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml + yq -riY '.spec.networking.auth.oAuthSecret = "{{ .Values.networking.auth.oAuthSecret }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml + yq -riY '.spec.networking.auth.oAuthClientName = "{{ .Values.networking.auth.oAuthClientName }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml + yq -riY '.spec.networking.auth.identityProviderURL = "{{ .Values.networking.auth.identityProviderURL }}"' $${HELMCHARTS_TEMPLATES}/org_v2_checluster.yaml fi echo "[INFO] HelmCharts updated $${HELM_DIR}" @@ -463,12 +463,12 @@ create-checluster-cr: ## Creates CheCluster Custom Resource V2 CHECLUSTER_CR_2_APPLY=/tmp/checluster_cr.yaml cp $(CHECLUSTER_CR_PATH) $${CHECLUSTER_CR_2_APPLY} - # Update ingress.domain field with an actual value + # Update networking.domain field with an actual value if [[ $(PLATFORM) == "kubernetes" ]]; then # kubectl does not have `whoami` command CLUSTER_API_URL=$$(oc whoami --show-server=true) || true; CLUSTER_DOMAIN=$$(echo $${CLUSTER_API_URL} | sed -E 's/https:\/\/(.*):.*/\1/g') - yq -riY '.spec.ingress.domain = "'$${CLUSTER_DOMAIN}'.nip.io"' $${CHECLUSTER_CR_2_APPLY} + yq -riY '.spec.networking.domain = "'$${CLUSTER_DOMAIN}'.nip.io"' $${CHECLUSTER_CR_2_APPLY} fi $(K8S_CLI) apply -f $${CHECLUSTER_CR_2_APPLY} -n $(ECLIPSE_CHE_NAMESPACE) fi diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index 0d999b6335..f9d91c0680 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml @@ -63,7 +63,15 @@ metadata: "enable": true } }, - "ingress": { + "devEnvironments": { + "defaultNamespace": { + "template": "-che" + }, + "storage": { + "pvcStrategy": "common" + } + }, + "networking": { "auth": { "identityProviderURL": "", "oAuthClientName": "", @@ -71,14 +79,6 @@ metadata: }, "domain": "", "tlsSecretName": "" - }, - "workspaces": { - "defaultNamespace": { - "template": "-che" - }, - "storage": { - "pvcStrategy": "common" - } } } } @@ -97,7 +97,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.49.0-560.next + name: eclipse-che-preview-openshift.v7.49.0-561.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1410,7 +1410,7 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.49.0-560.next + version: 7.49.0-561.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/config/samples/org_v2_checluster.yaml b/config/samples/org_v2_checluster.yaml index 318a34bc2b..44f6f381c5 100644 --- a/config/samples/org_v2_checluster.yaml +++ b/config/samples/org_v2_checluster.yaml @@ -16,7 +16,7 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - workspaces: + devEnvironments: defaultNamespace: template: '-che' storage: @@ -26,7 +26,7 @@ spec: externalDb: false metrics: enable: true - ingress: + networking: domain: '' tlsSecretName: '' auth: diff --git a/controllers/che/checluster_validator.go b/controllers/che/checluster_validator.go index 1c95229fb5..becbb9fd12 100644 --- a/controllers/che/checluster_validator.go +++ b/controllers/che/checluster_validator.go @@ -42,7 +42,7 @@ func NewCheClusterValidator() *CheClusterValidator { func (v *CheClusterValidator) Reconcile(ctx *chetypes.DeployContext) (reconcile.Result, bool, error) { if !infrastructure.IsOpenShift() { if ctx.CheCluster.Spec.Networking.Domain == "" { - return reconcile.Result{}, false, fmt.Errorf("Required field \"spec.auth.gateway.ingress.domain\" is not set") + return reconcile.Result{}, false, fmt.Errorf("Required field \"spec.networking.domain\" is not set") } } diff --git a/controllers/devworkspace/controller.go b/controllers/devworkspace/controller.go index a0f3a6d9e7..78278cafa4 100644 --- a/controllers/devworkspace/controller.go +++ b/controllers/devworkspace/controller.go @@ -260,7 +260,7 @@ func (r *CheClusterReconciler) validate(cluster *chev2.CheCluster) error { if !infrastructure.IsOpenShift() { if cluster.Spec.Networking.Domain == "" { - validationErrors = append(validationErrors, "spec.ingress.domain must be specified") + validationErrors = append(validationErrors, "spec.networking.domain must be specified") } } diff --git a/deploy/deployment/kubernetes/org_v2_checluster.yaml b/deploy/deployment/kubernetes/org_v2_checluster.yaml index 318a34bc2b..44f6f381c5 100644 --- a/deploy/deployment/kubernetes/org_v2_checluster.yaml +++ b/deploy/deployment/kubernetes/org_v2_checluster.yaml @@ -16,7 +16,7 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - workspaces: + devEnvironments: defaultNamespace: template: '-che' storage: @@ -26,7 +26,7 @@ spec: externalDb: false metrics: enable: true - ingress: + networking: domain: '' tlsSecretName: '' auth: diff --git a/deploy/deployment/openshift/org_v2_checluster.yaml b/deploy/deployment/openshift/org_v2_checluster.yaml index 318a34bc2b..44f6f381c5 100644 --- a/deploy/deployment/openshift/org_v2_checluster.yaml +++ b/deploy/deployment/openshift/org_v2_checluster.yaml @@ -16,7 +16,7 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - workspaces: + devEnvironments: defaultNamespace: template: '-che' storage: @@ -26,7 +26,7 @@ spec: externalDb: false metrics: enable: true - ingress: + networking: domain: '' tlsSecretName: '' auth: diff --git a/helmcharts/next/README.md b/helmcharts/next/README.md index 162be246bd..418976e485 100644 --- a/helmcharts/next/README.md +++ b/helmcharts/next/README.md @@ -23,8 +23,8 @@ Install the Helm Charts for Eclipse Che Operator helm install che \ --create-namespace \ --namespace eclipse-che \ - --set ingress.domain= \ - --set ingress.auth.oAuthSecret= \ - --set ingress.auth.oAuthClientName= \ - --set ingress.auth.identityProviderURL= . + --set networking.domain= \ + --set networking.auth.oAuthSecret= \ + --set networking.auth.oAuthClientName= \ + --set networking.auth.identityProviderURL= . ``` diff --git a/helmcharts/next/templates/org_v2_checluster.yaml b/helmcharts/next/templates/org_v2_checluster.yaml index 4e08cd203f..c9cfb61519 100644 --- a/helmcharts/next/templates/org_v2_checluster.yaml +++ b/helmcharts/next/templates/org_v2_checluster.yaml @@ -16,7 +16,7 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - workspaces: + devEnvironments: defaultNamespace: template: '-che' storage: @@ -26,10 +26,10 @@ spec: externalDb: false metrics: enable: true - ingress: - domain: '{{ .Values.ingress.domain }}' + networking: + domain: '{{ .Values.networking.domain }}' tlsSecretName: 'che-tls' auth: - identityProviderURL: '{{ .Values.ingress.auth.identityProviderURL }}' - oAuthClientName: '{{ .Values.ingress.auth.oAuthClientName }}' - oAuthSecret: '{{ .Values.ingress.auth.oAuthSecret }}' + identityProviderURL: '{{ .Values.networking.auth.identityProviderURL }}' + oAuthClientName: '{{ .Values.networking.auth.oAuthClientName }}' + oAuthSecret: '{{ .Values.networking.auth.oAuthSecret }}' diff --git a/helmcharts/next/values.yaml b/helmcharts/next/values.yaml index 81930c53a0..79de04aa20 100644 --- a/helmcharts/next/values.yaml +++ b/helmcharts/next/values.yaml @@ -10,7 +10,7 @@ # Red Hat, Inc. - initial API and implementation # -ingress: +networking: domain: "" auth: identityProviderURL: "" diff --git a/helmcharts/stable/README.md b/helmcharts/stable/README.md index 2647dc6db4..bb4ba16190 100644 --- a/helmcharts/stable/README.md +++ b/helmcharts/stable/README.md @@ -35,10 +35,10 @@ eclipse-che che-operator-554c564476-fl98z 1/1 Ru Click `CRDS` button, select `CheCluster` template and copy custom resource Eclipse Che to file `org_v2_checluster.yaml`. Set the following fields: -- `spec.ingress.domain` -- `spec.ingress.auth.identityProviderURL` -- `spec.ingress.auth.oAuthClientName` -- `spec.ingress.auth.oAuthSecret` +- `spec.networking.domain` +- `spec.networking.auth.identityProviderURL` +- `spec.networking.auth.oAuthClientName` +- `spec.networking.auth.oAuthSecret` 4. Apply CR: ```bash diff --git a/pkg/deploy/migration/on-reconcile-one-time-migration.go b/pkg/deploy/migration/on-reconcile-one-time-migration.go index 124b53b9a9..5928f4a039 100644 --- a/pkg/deploy/migration/on-reconcile-one-time-migration.go +++ b/pkg/deploy/migration/on-reconcile-one-time-migration.go @@ -94,7 +94,7 @@ func (m *Migrator) migrate(ctx *chetypes.DeployContext) (bool, error) { // - spec.server.serverTrustStoreConfigMapName // - spec.server.proxy.credentialssecretname // - spec.database.credentialssecretname -// - spec.ingress.tlsSecretName +// - spec.networking.tlsSecretName // Note, most of the objects above are autogenerated and do not require any migration, // but to handle the case when some were created manually or operator updated, the check is done here. func addPartOfCheLabeltoUserDefinedObjects(ctx *chetypes.DeployContext) error {