Fix e2e tests and devworkspace CRD creation

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
pull/721/head
Flavius Lacatusu 2021-03-17 10:05:47 +01:00
parent cb5788fa8f
commit 3d2c039637
No known key found for this signature in database
GPG Key ID: 3C0A7685C14681A8
3 changed files with 19 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# Che/CodeReady Workspaces Operator
[![codecov](https://codecov.io/gh/eclipse/che-operator/branch/master/graph/badge.svg?token=IlYvrVU5nB)](https://codecov.io/gh/eclipse/che-operator)
[![codecov](https://codecov.io/gh/eclipse-che/che-operator/branch/master/graph/badge.svg?token=IlYvrVU5nB)](https://codecov.io/gh/eclipse-che/che-operator)
Che/CodeReady workspaces operator uses [Operator SDK](https://github.com/operator-framework/operator-sdk) and [Go Kube client](https://github.com/kubernetes/client-go) to deploy, update and manage K8S/OpenShift resources that constitute a single or multi-user Eclipse Che/CodeReady Workspaces cluster.

View File

@ -499,6 +499,21 @@ waitCheServerDeploy() {
fi
}
waitCatalogSourcePod() {
CURRENT_TIME=$(date +%s)
ENDTIME=$(($CURRENT_TIME + 300))
CATALOG_POD=$(kubectl get pods -n "${namespace}" -o yaml | yq -r ".items[] | select(.metadata.name | startswith(\"${packageName}\")) | .metadata.name")
while [ $(date +%s) -lt $ENDTIME ]; do
if [[ -z "$CATALOG_POD" ]]
then
CATALOG_POD=$(kubectl get pods -n "${namespace}" -o yaml | yq -r ".items[] | select(.metadata.name | startswith(\"${packageName}\")) | .metadata.name")
sleep 10
else
break
fi
done
}
getBundleListFromCatalogSource() {
platform="${1}"
if [ -z "${platform}" ]; then
@ -511,9 +526,8 @@ getBundleListFromCatalogSource() {
exit 1
fi
packageName=$(getPackageName "${platform}")
CATALOG_POD=$(kubectl get pods -n "${namespace}" -o yaml | yq -r ".items[] | select(.metadata.name | startswith(\"${packageName}\")) | .metadata.name")
kubectl wait --for=condition=ready "pods/${CATALOG_POD}" --timeout=60s -n "${namespace}"
# Wait until catalog pod is created in cluster
waitCatalogSourcePod
CATALOG_SERVICE=$(kubectl get service "${packageName}" -n "${namespace}" -o yaml)
CATALOG_IP=$(echo "${CATALOG_SERVICE}" | yq -r ".spec.clusterIP")

View File

@ -50,7 +50,7 @@ const (
DevWorkspaceRoleBindingFile = DevWorkspaceTemplates + "/devworkspace-controller-leader-election-rolebinding.RoleBinding.yaml"
DevWorkspaceClusterRoleBindingFile = DevWorkspaceTemplates + "/devworkspace-controller-rolebinding.ClusterRoleBinding.yaml"
DevWorkspaceProxyClusterRoleBindingFile = DevWorkspaceTemplates + "/devworkspace-controller-proxy-rolebinding.ClusterRoleBinding.yaml"
DevWorkspaceWorkspaceRoutingCRDFile = DevWorkspaceTemplates + "/workspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml"
DevWorkspaceWorkspaceRoutingCRDFile = DevWorkspaceTemplates + "/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml"
DevWorkspaceTemplatesCRDFile = DevWorkspaceTemplates + "/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml"
DevWorkspaceComponentsCRDFile = DevWorkspaceTemplates + "/components.controller.devfile.io.CustomResourceDefinition.yaml"
DevWorkspaceCRDFile = DevWorkspaceTemplates + "/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml"