Skip to content

Commit

Permalink
remove log error message stating hostname not populated (#220)
Browse files Browse the repository at this point in the history
* error not needed for validating clowdenv ready status

* updated error handling
  • Loading branch information
maknop authored Jan 22, 2024
1 parent 2975ac2 commit ec7ffcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions controllers/cloud.redhat.com/clowdenvironment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func (r *ClowdenvironmentReconciler) Reconcile(ctx context.Context, req ctrl.Req
"deployments", fmt.Sprintf("%d / %d", env.Status.Deployments.ReadyDeployments, env.Status.Deployments.ManagedDeployments),
)

if ready, err := helpers.VerifyClowdEnvReady(env); !ready {
return ctrl.Result{Requeue: true}, err
if ready := helpers.VerifyClowdEnvReady(env); !ready {
return ctrl.Result{Requeue: true}, nil
}

namespaceName := env.Spec.TargetNamespace
Expand Down
12 changes: 6 additions & 6 deletions controllers/cloud.redhat.com/helpers/clowdenvs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ func GetClowdEnv(ctx context.Context, cl client.Client, namespaceName string) (b
return false, nil, fmt.Errorf("could not retrieve clowdenvironment [%s]: %w", env.Name, err)
}

ready, err := VerifyClowdEnvReady(env)
if err != nil {
return ready, &env, fmt.Errorf("could not verify that the clowdenvironment [%s] was ready: %w", env.Name, err)
ready := VerifyClowdEnvReady(env)
if !ready {
return ready, &env, nil
}

return ready, &env, nil
}

func VerifyClowdEnvReady(env clowder.ClowdEnvironment) (bool, error) {
func VerifyClowdEnvReady(env clowder.ClowdEnvironment) bool {
// check that hostname is populated if ClowdEnvironment is operating in 'local' web mode
if env.Spec.Providers.Web.Mode == "local" && env.Status.Hostname == "" {
return false, fmt.Errorf("hostname not populated for clowdenvironment [%s]", env.Name)
return false
}

conditions := env.Status.Conditions
Expand All @@ -78,5 +78,5 @@ func VerifyClowdEnvReady(env clowder.ClowdEnvironment) (bool, error) {
}
}

return (reconciliationSuccessful && deploymentsReady), nil
return (reconciliationSuccessful && deploymentsReady)
}

0 comments on commit ec7ffcc

Please sign in to comment.