MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / WaitForGetCluster

Function WaitForGetCluster

pkg/management/client.go:137–147  ·  view source on GitHub ↗

WaitForGetCluster will wait for a successful get cluster to be executed. Returns any error encountered.

(ctx context.Context, clusterObjectKey client.ObjectKey)

Source from the content-addressed store, hash-verified

135// WaitForGetCluster will wait for a successful get cluster to be executed.
136// Returns any error encountered.
137func WaitForGetCluster(ctx context.Context, clusterObjectKey client.ObjectKey) error {
138 logger := log.FromContext(ctx).WithName("wait-for-get-cluster")
139
140 cli, err := NewControllerRuntimeClient()
141 if err != nil {
142 logger.Error(err, "error while creating a standalone Kubernetes client")
143 return err
144 }
145
146 return WaitForGetClusterWithClient(ctx, cli, clusterObjectKey)
147}
148
149// WaitForGetClusterWithClient will wait for a successful get cluster to be executed
150func WaitForGetClusterWithClient(ctx context.Context, cli client.Client, clusterObjectKey client.ObjectKey) error {

Callers 4

NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92

Calls 4

WithNameMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected