From dc6c5e04bef8d8b64cdf540f97fcc1b5526bc51a Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 4 Mar 2021 13:37:30 +0200 Subject: [PATCH] Add logs Signed-off-by: Anatolii Bazko --- .ci/oci-nightly-olm.sh | 1 - .github/bin/common.sh | 30 ++++++------------- deploy/crds/org_v1_che_cr.yaml | 5 ++++ .../che-operator.clusterserviceversion.yaml | 9 ++++-- .../che-operator.clusterserviceversion.yaml | 9 ++++-- pkg/deploy/server/che_configmap.go | 2 ++ 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.ci/oci-nightly-olm.sh b/.ci/oci-nightly-olm.sh index 97fe1cd623..3a810ca306 100755 --- a/.ci/oci-nightly-olm.sh +++ b/.ci/oci-nightly-olm.sh @@ -44,7 +44,6 @@ runTests() { deployDevWorkspaceController waitDevWorkspaceControllerStarted createWorksaceDevWorkspaceController - waitWorkspaceStartedDevWorkspaceController } initDefaults diff --git a/.github/bin/common.sh b/.github/bin/common.sh index 1b8a576800..095de6e301 100755 --- a/.github/bin/common.sh +++ b/.github/bin/common.sh @@ -341,11 +341,13 @@ login() { deployDevWorkspaceController() { oc patch checluster eclipse-che -n ${NAMESPACE} --type=merge -p '{"spec":{"devWorkspaces": {"enable": "true"}}}' + oc get checluster eclipse-che -n ${NAMESPACE} -o yaml + oc get crd checlusters.org.eclipse.che -o yaml } waitDevWorkspaceControllerStarted() { n=0 - while [ $n -le 120 ] + while [ $n -le 5 ] do webhooks=$(oc get mutatingWebhookConfiguration --all-namespaces) echo "[INFO] Webhooks: ${webhooks}" @@ -354,8 +356,11 @@ waitDevWorkspaceControllerStarted() { return fi - sleep 5 + sleep 60 n=$(( n+1 )) + + OPERATOR_POD=$(oc get pods -o json -n ${NAMESPACE} | jq -r '.items[] | select(.metadata.name | test("che-operator-")).metadata.name') + oc logs ${OPERATOR_POD} -n ${NAMESPACE} done echo "Failed to deploy Dev Workspace controller" @@ -363,24 +368,7 @@ waitDevWorkspaceControllerStarted() { } createWorksaceDevWorkspaceController () { - oc apply -f https://raw.githubusercontent.com/devfile/devworkspace-operator/main/samples/flattened_theia-next.yaml -n default + oc create namespace che-che + oc apply -f https://raw.githubusercontent.com/devfile/devworkspace-operator/main/samples/flattened_theia-next.yaml -n che-che } -waitWorkspaceStartedDevWorkspaceController() { - n=0 - while [ $n -le 120 ] - do - pods=$(oc get pods -n default) - echo "[INFO] Pod status: ${pods}" - if [[ $pods =~ .*Running.* ]]; then - echo "[INFO] Wokrspace started succesfully" - return - fi - - sleep 5 - n=$(( n+1 )) - done - - echo "Failed to start a workspace" - exit 1 -} diff --git a/deploy/crds/org_v1_che_cr.yaml b/deploy/crds/org_v1_che_cr.yaml index 04da1ff9fa..e63c2b1da3 100644 --- a/deploy/crds/org_v1_che_cr.yaml +++ b/deploy/crds/org_v1_che_cr.yaml @@ -157,3 +157,8 @@ spec: metrics: # Enables '/metrics' endpoint of Che server. enable: true + devWorkspace: + # Deploys the DevWorkspace Operator in the cluster. + # Does nothing when a matching version of the Operator is already installed. + # Fails when a non-matching version of the Operator is already installed. + enable: false diff --git a/deploy/olm-catalog/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml b/deploy/olm-catalog/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml index b10146e02c..96f63be5b5 100644 --- a/deploy/olm-catalog/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml @@ -32,6 +32,9 @@ metadata: "externalDb": false, "postgresImage": "" }, + "devWorkspace": { + "enable": false + }, "k8s": { "ingressClass": "", "ingressDomain": "", @@ -85,13 +88,13 @@ metadata: categories: Developer Tools certified: "false" containerImage: quay.io/eclipse/che-operator:nightly - createdAt: "2021-03-04T09:02:19Z" + createdAt: "2021-03-04T11:33:10Z" description: A Kube-native development solution that delivers portable and collaborative developer workspaces. operatorframework.io/suggested-namespace: eclipse-che repository: https://github.com/eclipse/che-operator support: Eclipse Foundation - name: eclipse-che-preview-kubernetes.v7.27.0-110.nightly + name: eclipse-che-preview-kubernetes.v7.27.0-114.nightly namespace: placeholder spec: apiservicedefinitions: {} @@ -720,4 +723,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.27.0-110.nightly + version: 7.27.0-114.nightly diff --git a/deploy/olm-catalog/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/deploy/olm-catalog/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index e4dfd9e8d3..c8e14cd06a 100644 --- a/deploy/olm-catalog/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml @@ -32,6 +32,9 @@ metadata: "externalDb": false, "postgresImage": "" }, + "devWorkspace": { + "enable": false + }, "metrics": { "enable": true }, @@ -76,13 +79,13 @@ metadata: categories: Developer Tools, OpenShift Optional certified: "false" containerImage: quay.io/eclipse/che-operator:nightly - createdAt: "2021-03-04T09:02:28Z" + createdAt: "2021-03-04T11:33:18Z" description: A Kube-native development solution that delivers portable and collaborative developer workspaces in OpenShift. operatorframework.io/suggested-namespace: eclipse-che repository: https://github.com/eclipse/che-operator support: Eclipse Foundation - name: eclipse-che-preview-openshift.v7.27.0-110.nightly + name: eclipse-che-preview-openshift.v7.27.0-114.nightly namespace: placeholder spec: apiservicedefinitions: {} @@ -797,4 +800,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.27.0-110.nightly + version: 7.27.0-114.nightly diff --git a/pkg/deploy/server/che_configmap.go b/pkg/deploy/server/che_configmap.go index 16b13befd8..2c72c88488 100644 --- a/pkg/deploy/server/che_configmap.go +++ b/pkg/deploy/server/che_configmap.go @@ -85,6 +85,7 @@ type CheConfigMap struct { ServerStrategy string `json:"CHE_INFRA_KUBERNETES_SERVER__STRATEGY"` WorkspaceExposure string `json:"CHE_INFRA_KUBERNETES_SINGLEHOST_WORKSPACE_EXPOSURE"` SingleHostGatewayConfigMapLabels string `json:"CHE_INFRA_KUBERNETES_SINGLEHOST_GATEWAY_CONFIGMAP__LABELS"` + CheDevWorkspacesEnabled string `json:"CHE_DEVWORKSPACES_ENABLED"` } func SyncCheConfigMapToCluster(deployContext *deploy.DeployContext) (*corev1.ConfigMap, error) { @@ -261,6 +262,7 @@ func GetCheConfigMapData(deployContext *deploy.DeployContext) (cheEnv map[string ServerStrategy: ingressStrategy, WorkspaceExposure: workspaceExposure, SingleHostGatewayConfigMapLabels: singleHostGatewayConfigMapLabels, + CheDevWorkspacesEnabled: strconv.FormatBool(deployContext.CheCluster.Spec.DevWorkspace.Enable), } if cheMultiUser == "true" {