Skip to content

Commit

Permalink
main.go: improved cache configuration for watching pull secret
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Lanford <[email protected]>
  • Loading branch information
anik120 committed Oct 7, 2024
1 parent 3df7f87 commit bac538c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ func main() {
}
if globalPullSecretKey != nil {
cacheOptions.ByObject[&corev1.Secret{}] = crcache.ByObject{
Field: fields.SelectorFromSet(map[string]string{
"metadata.name": globalPullSecretKey.Name,
}),
}
cacheOptions.DefaultNamespaces[globalPullSecretKey.Namespace] = crcache.Config{
LabelSelector: k8slabels.Everything(),
Namespaces: map[string]crcache.Config{
globalPullSecretKey.Namespace: {
LabelSelector: k8slabels.Everything(),
FieldSelector: fields.SelectorFromSet(map[string]string{
"metadata.name": globalPullSecretKey.Name,
}),
},
},
}
}
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Expand Down

0 comments on commit bac538c

Please sign in to comment.