Skip to content

Commit 389a044

Browse files
committed
c/r changes: use the new mechanism to build non-caching client
Following c/r change in kubernetes-sigs/controller-runtime#2150 Signed-off-by: irbekrm <[email protected]>
1 parent c27c1c8 commit 389a044

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/controller/configmap.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ type configmap struct {
8181
}
8282

8383
func AddConfigMapController(ctx context.Context, log logr.Logger, opts Options) error {
84-
noCacheClient, err := client.NewDelegatingClient(client.NewDelegatingClientInput{
85-
CacheReader: opts.Manager.GetCache(),
86-
Client: opts.Manager.GetClient(),
87-
UncachedObjects: []client.Object{new(corev1.ConfigMap)},
88-
CacheUnstructured: false,
84+
// noCacheClient is used to retrieve objects that we don't want to cache.
85+
noCacheClient, err := client.New(opts.Manager.GetConfig(), client.Options{
86+
Cache: &client.CacheOptions{
87+
Reader: opts.Manager.GetCache(),
88+
DisableFor: []client.Object{&corev1.ConfigMap{}},
89+
Unstructured: false,
90+
},
8991
})
9092
if err != nil {
9193
return fmt.Errorf("failed to build non-cached client for ConfigMaps: %w", err)

0 commit comments

Comments
 (0)