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

Method getCluster

internal/cmd/plugin/pgbench/pgbench.go:92–103  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

90}
91
92func (cmd *pgBenchRun) getCluster(ctx context.Context) (*apiv1.Cluster, error) {
93 var cluster apiv1.Cluster
94 err := plugin.Client.Get(
95 ctx,
96 client.ObjectKey{Namespace: plugin.Namespace, Name: cmd.clusterName},
97 &cluster)
98 if err != nil {
99 return nil, fmt.Errorf("could not get cluster: %v", err)
100 }
101
102 return &cluster, nil
103}
104
105func (cmd *pgBenchRun) getJobName() string {
106 if cmd.jobName == "" {

Callers 1

executeMethod · 0.95

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected