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

Function buildManager

internal/cmd/manager/instance/restore/cmd.go:132–160  ·  view source on GitHub ↗
(clusterName string, namespace string)

Source from the content-addressed store, hash-verified

130}
131
132func buildManager(clusterName string, namespace string) (manager.Manager, error) {
133 return controllerruntime.NewManager(controllerruntime.GetConfigOrDie(), controllerruntime.Options{
134 Scheme: scheme.BuildWithAllKnownScheme(),
135 Cache: cache.Options{
136 ByObject: map[client.Object]cache.ByObject{
137 &apiv1.Cluster{}: {
138 Field: fields.OneTermEqualSelector("metadata.name", clusterName),
139 Namespaces: map[string]cache.Config{
140 namespace: {},
141 },
142 },
143 },
144 },
145 Client: client.Options{
146 Cache: &client.CacheOptions{
147 DisableFor: []client.Object{
148 &corev1.Secret{},
149 &corev1.ConfigMap{},
150 // todo(armru): we should remove the backup endpoints from the local webserver
151 &apiv1.Backup{},
152 },
153 },
154 },
155 LeaderElection: false,
156 Metrics: metricsserver.Options{
157 BindAddress: "0",
158 },
159 })
160}

Callers 1

NewCmdFunction · 0.70

Calls 1

BuildWithAllKnownSchemeFunction · 0.92

Tested by

no test coverage detected