Skip to content

Commit

Permalink
Improvements
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 2668a4a commit 33535cf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 77 deletions.
6 changes: 4 additions & 2 deletions .github/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ deployDevWorkspaceController() {

waitDevWorkspaceControllerStarted() {
n=0
while [ $n -le 24 ] # 2 minutes
while [ $n -le 120 ]
do
webhooks=$(oc get mutatingWebhookConfiguration --all-namespaces)
echo "[INFO] Webhooks: ${webhooks}"
if [[ $webhooks =~ .*controller.devfile.io.* ]]; then
echo "[INFO] Dev Workspace controller has been deployed"
return
Expand All @@ -367,9 +368,10 @@ createWorksaceDevWorkspaceController () {

waitWorkspaceStartedDevWorkspaceController() {
n=0
while [ $n -le 24 ] # 2 minutes
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
Expand Down
17 changes: 14 additions & 3 deletions pkg/deploy/dev-workspace/dev_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var (
// cachedObjects
cachedObj = make(map[string]metav1.Object)
syncItems = []func(*deploy.DeployContext) (bool, error){
syncNamespace,
createNamespace,
syncServiceAccount,
syncClusterRole,
syncProxyClusterRole,
Expand Down Expand Up @@ -134,8 +134,19 @@ func checkWebTerminalSubscription(deployContext *deploy.DeployContext) error {
return errors.New("A non matching version of the Dev Workspace operator is already installed")
}

func syncNamespace(deployContext *deploy.DeployContext) (bool, error) {
return deploy.CreateNamespace(deployContext, DevWorkspaceNamespace)
func createNamespace(deployContext *deploy.DeployContext) (bool, error) {
namespace := &corev1.Namespace{
TypeMeta: metav1.TypeMeta{
Kind: "Namespace",
APIVersion: corev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: DevWorkspaceNamespace,
},
Spec: corev1.NamespaceSpec{},
}

return deploy.CreateIfNotExists(deployContext, namespace)
}

func syncServiceAccount(deployContext *deploy.DeployContext) (bool, error) {
Expand Down
72 changes: 0 additions & 72 deletions pkg/deploy/namespace.go

This file was deleted.

0 comments on commit 33535cf

Please sign in to comment.