Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Mar 4, 2021
1 parent 33535cf commit dc6c5e0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
1 change: 0 additions & 1 deletion .ci/oci-nightly-olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ runTests() {
deployDevWorkspaceController
waitDevWorkspaceControllerStarted
createWorksaceDevWorkspaceController
waitWorkspaceStartedDevWorkspaceController
}

initDefaults
Expand Down
30 changes: 9 additions & 21 deletions .github/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -354,33 +356,19 @@ 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"
exit 1
}

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
}
5 changes: 5 additions & 0 deletions deploy/crds/org_v1_che_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ metadata:
"externalDb": false,
"postgresImage": ""
},
"devWorkspace": {
"enable": false
},
"k8s": {
"ingressClass": "",
"ingressDomain": "",
Expand Down Expand Up @@ -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: {}
Expand Down Expand Up @@ -720,4 +723,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.27.0-110.nightly
version: 7.27.0-114.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ metadata:
"externalDb": false,
"postgresImage": ""
},
"devWorkspace": {
"enable": false
},
"metrics": {
"enable": true
},
Expand Down Expand Up @@ -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: {}
Expand Down Expand Up @@ -797,4 +800,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.27.0-110.nightly
version: 7.27.0-114.nightly
2 changes: 2 additions & 0 deletions pkg/deploy/server/che_configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit dc6c5e0

Please sign in to comment.