MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / NewManager

Function NewManager

internal/controller/runtime/runtime.go:53–70  ·  view source on GitHub ↗

NewManager returns a Manager that interacts with the Kubernetes API of config. When config is nil, it reads from KUBECONFIG or the local service account. When options.Scheme is nil, it uses the Scheme from this package.

(config *rest.Config, options manager.Options)

Source from the content-addressed store, hash-verified

51// When config is nil, it reads from KUBECONFIG or the local service account.
52// When options.Scheme is nil, it uses the Scheme from this package.
53func NewManager(config *rest.Config, options manager.Options) (manager.Manager, error) {
54 var m manager.Manager
55 var err error
56
57 if config == nil {
58 config, err = GetConfig()
59 }
60
61 if options.Scheme == nil {
62 options.Scheme = Scheme
63 }
64
65 if err == nil {
66 m, err = manager.New(config, options)
67 }
68
69 return m, err
70}
71
72// SetLogger assigns the default Logger used by [sigs.k8s.io/controller-runtime].
73func SetLogger(logger logging.Logger) { log.SetLogger(logger) }

Callers 2

setupManagerFunction · 0.92
mainFunction · 0.92

Calls 1

GetConfigFunction · 0.85

Tested by 1

setupManagerFunction · 0.74