Skip to content

Commit 32b4434

Browse files
committed
✨ Manager: Export defaultNewClient
There is a set of cases where ppl might want to wrap the defaultNewClient, for example: * To force dry run (currently possible via a manager opt) * To enforce usage of a given namespace
1 parent 1c83ff6 commit 32b4434

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/manager/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ func New(config *rest.Config, options Options) (Manager, error) {
343343
}, nil
344344
}
345345

346-
// defaultNewClient creates the default caching client
347-
func defaultNewClient(cache cache.Cache, config *rest.Config, options client.Options) (client.Client, error) {
346+
// DefaultNewClient creates the default caching client
347+
func DefaultNewClient(cache cache.Cache, config *rest.Config, options client.Options) (client.Client, error) {
348348
// Create the Client for Write operations.
349349
c, err := client.New(config, options)
350350
if err != nil {
@@ -389,7 +389,7 @@ func setOptionsDefaults(options Options) Options {
389389

390390
// Allow newClient to be mocked
391391
if options.NewClient == nil {
392-
options.NewClient = defaultNewClient
392+
options.NewClient = DefaultNewClient
393393
}
394394

395395
// Allow newCache to be mocked

0 commit comments

Comments
 (0)