Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nimakaviani committed Nov 16, 2023
1 parent 1440d25 commit 03bbce0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/controllers/localbuild/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (

//go:embed resources/nginx/k8s/*
var installNginxFS embed.FS
var timeout = time.After(5 * time.Minute)
var timeout = time.After(3 * time.Minute)

func RawNginxInstallResources() ([][]byte, error) {
return util.ConvertFSToBytes(installNginxFS, "resources/nginx/k8s")
Expand Down Expand Up @@ -68,7 +68,7 @@ func (r LocalbuildReconciler) ReconcileNginx(ctx context.Context, req ctrl.Reque
}
}

log.Info("Installing Nginx resources")
log.Info("Installing/Reconciling Nginx resources")
for _, obj := range installObjs {
if obj.GetObjectKind().GroupVersionKind().Kind == "Deployment" {
switch obj.GetName() {
Expand Down Expand Up @@ -110,8 +110,8 @@ func (r LocalbuildReconciler) ReconcileNginx(ctx context.Context, req ctrl.Reque
}
}
}

time.Sleep(1 * time.Second)
log.Info("Waiting for Nginx to become ready")
time.Sleep(30 * time.Second)
}
}(installObjs)

Expand All @@ -126,6 +126,7 @@ func (r LocalbuildReconciler) ReconcileNginx(ctx context.Context, req ctrl.Reque
resource.Status.NginxAvailable = true
} else {
log.Error(err, "failed to reconcile the Nginx resources")
resource.Status.NginxAvailable = false
return ctrl.Result{}, err
}
}
Expand Down

0 comments on commit 03bbce0

Please sign in to comment.