diff --git a/README.md b/README.md index 3fcd6a590..15ac08f23 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/olm/olm.sh b/olm/olm.sh index 66746d73d..2c449498a 100755 --- a/olm/olm.sh +++ b/olm/olm.sh @@ -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") diff --git a/pkg/deploy/dev-workspace/dev_workspace.go b/pkg/deploy/dev-workspace/dev_workspace.go index 14f9099e7..cb54c34ac 100644 --- a/pkg/deploy/dev-workspace/dev_workspace.go +++ b/pkg/deploy/dev-workspace/dev_workspace.go @@ -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"