Skip to content

Commit

Permalink
cluster: WaitForDeploymentAvailable: use logger from context
Browse files Browse the repository at this point in the history
The function is called only from component so it's save to use
logger from the context.

Signed-off-by: Yauheni Kaliuta <[email protected]>
  • Loading branch information
ykaliuta committed Sep 19, 2024
1 parent 1182f1e commit adce0b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cluster/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
logf "sigs.k8s.io/controller-runtime/pkg/log"

"github.com/opendatahub-io/opendatahub-operator/v2/pkg/metadata/labels"
)
Expand Down Expand Up @@ -192,7 +193,7 @@ func WaitForDeploymentAvailable(ctx context.Context, c client.Client, componentN
return false, fmt.Errorf("error fetching list of deployments: %w", err)
}

ctrl.Log.Info("waiting for " + strconv.Itoa(len(componentDeploymentList.Items)) + " deployment to be ready for " + componentName)
logf.FromContext(ctx).Info("waiting for " + strconv.Itoa(len(componentDeploymentList.Items)) + " deployment to be ready")
for _, deployment := range componentDeploymentList.Items {
if deployment.Status.ReadyReplicas != deployment.Status.Replicas {
return false, nil
Expand Down

0 comments on commit adce0b4

Please sign in to comment.