Skip to content

Commit

Permalink
Fix client creation after dependency update
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-demicev committed Apr 20, 2021
1 parent 7150544 commit d8c4832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/cache"
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/cluster"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand Down Expand Up @@ -203,10 +204,11 @@ func newConfigManagedClient(mgr manager.Manager) (runtimeclient.Client, manager.
Scheme: mgr.GetScheme(),
Mapper: mgr.GetRESTMapper(),
}
client, err := manager.NewClientBuilder().Build(cache, mgr.GetConfig(), clientOpts)

cachedClient, err := cluster.DefaultNewClient(cache, config.GetConfigOrDie(), clientOpts)
if err != nil {
return nil, nil, err
}

return client, cache, nil
return cachedClient, cache, nil
}

0 comments on commit d8c4832

Please sign in to comment.