Skip to content

Commit 60a4c92

Browse files
committed
main.go: improved cache configuration for watching pull secret
Signed-off-by: Joe Lanford <[email protected]>
1 parent 0bfbf39 commit 60a4c92

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cmd/manager/main.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,14 @@ func main() {
159159
}
160160
if globalPullSecretKey != nil {
161161
cacheOptions.ByObject[&corev1.Secret{}] = crcache.ByObject{
162-
Field: fields.SelectorFromSet(map[string]string{
163-
"metadata.name": globalPullSecretKey.Name,
164-
}),
165-
}
166-
cacheOptions.DefaultNamespaces[globalPullSecretKey.Namespace] = crcache.Config{
167-
LabelSelector: k8slabels.Everything(),
162+
Namespaces: map[string]crcache.Config{
163+
globalPullSecretKey.Namespace: {
164+
LabelSelector: k8slabels.Everything(),
165+
FieldSelector: fields.SelectorFromSet(map[string]string{
166+
"metadata.name": globalPullSecretKey.Name,
167+
}),
168+
},
169+
},
168170
}
169171
}
170172
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{

0 commit comments

Comments
 (0)