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

Function createClient

internal/cmd/plugin/plugin.go:113–128  ·  view source on GitHub ↗
(cfg *rest.Config)

Source from the content-addressed store, hash-verified

111}
112
113func createClient(cfg *rest.Config) error {
114 var err error
115
116 scheme := runtime.NewScheme()
117 _ = clientgoscheme.AddToScheme(scheme)
118 _ = apiv1.AddToScheme(scheme)
119 _ = volumesnapshotv1.AddToScheme(scheme)
120
121 cfg.UserAgent = fmt.Sprintf("kubectl-cnpg/v%s (%s)", versions.Version, versions.Info.Commit)
122
123 Client, err = client.New(cfg, client.Options{Scheme: scheme})
124 if err != nil {
125 return err
126 }
127 return nil
128}
129
130// CreateAndGenerateObjects creates provided k8s object or generate manifest collectively
131func CreateAndGenerateObjects(ctx context.Context, k8sObject []client.Object, option bool) error {

Callers 2

plugin_test.goFile · 0.85
SetupKubernetesClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected