@@ -66,7 +66,7 @@ type ByObject struct {
66
66
// An empty map prevents this.
67
67
//
68
68
// This must be unset for cluster-scoped objects.
69
- Namespaces map[string]* Config
69
+ Namespaces map[string]Config
70
70
71
71
// Config will be used for cluster-scoped objects and to default
72
72
// Config in the Namespaces field.
@@ -79,7 +79,7 @@ type ByObject struct {
79
79
type Options struct {
80
80
// ByObject specifies per-object cache settings. If unset for a given
81
81
// object, this will fall through to Default* settings.
82
- ByObject map[client.Object]* ByObject
82
+ ByObject map[client.Object]ByObject
83
83
84
84
// DefaultNamespaces maps namespace names to cache settings. If set, it
85
85
// will be used for all objects that have a nil Namespaces setting.
@@ -91,7 +91,7 @@ type Options struct {
91
91
//
92
92
// The options in the Config that are nil will be defaulted from
93
93
// the respective Default* settings.
94
- DefaultNamespaces map[string]* Config
94
+ DefaultNamespaces map[string]Config
95
95
96
96
// DefaultLabelSelector is the label selector that will be used as
97
97
// the default field label selector for everything that doesn't
@@ -158,14 +158,14 @@ type Options struct {
158
158
159
159
```
160
160
cache.Options{
161
- ByObject: map[client.Object]* cache.ByObject{
161
+ ByObject: map[client.Object]cache.ByObject{
162
162
&corev1.ConfigMap{}: {
163
- Namespaces: map[string]* cache.Config{
163
+ Namespaces: map[string]cache.Config{
164
164
"public": {},
165
165
"kube-system": {},
166
166
},
167
167
},
168
- &corev1.Secret{}: {Namespaces: map[string]* Config{
168
+ &corev1.Secret{}: {Namespaces: map[string]Config{
169
169
"operator": {},
170
170
}},
171
171
},
@@ -176,9 +176,9 @@ cache.Options{
176
176
177
177
```
178
178
cache.Options{
179
- ByObject: map[client.Object]* cache.ByObject{
179
+ ByObject: map[client.Object]cache.ByObject{
180
180
&corev1.ConfigMap{}: {
181
- Namespaces: map[string]* cache.Config{
181
+ Namespaces: map[string]cache.Config{
182
182
cache.AllNamespaces: nil, // No selector for all namespaces...
183
183
"operator": {LabelSelector: labelSelector}, // except for the operator namespace
184
184
},
@@ -192,13 +192,13 @@ cache.Options{
192
192
193
193
```
194
194
cache.Options{
195
- ByObject: map[client.Object]* cache.ByObject{
196
- &appsv1.Deployment: {Namespaces: map[string]* cache.Config{
197
- cache.AllNamespaces: nil ,
195
+ ByObject: map[client.Object]cache.ByObject{
196
+ &appsv1.Deployment: {Namespaces: map[string]cache.Config{
197
+ cache.AllNamespaces: {}} ,
198
198
}},
199
199
},
200
- DefaultNamespaces: map[string]* cache.Config{
201
- "operator": nil ,
200
+ DefaultNamespaces: map[string]cache.Config{
201
+ "operator": {}} ,
202
202
},
203
203
}
204
204
```
@@ -207,7 +207,7 @@ cache.Options{
207
207
208
208
```
209
209
cache.Options{
210
- ByObject: map[client.Object]* cache.ByObject{
210
+ ByObject: map[client.Object]cache.ByObject{
211
211
&corev1.Node: {LabelSelector: labels.Everything()},
212
212
},
213
213
DefaultLabelSelector: myLabelSelector,
@@ -218,9 +218,9 @@ cache.Options{
218
218
219
219
```
220
220
cache.Options{
221
- DefaultNamespaces: map[string]* cache.Config{
222
- "foo": nil ,
223
- "bar": nil ,
221
+ DefaultNamespaces: map[string]cache.Config{
222
+ "foo": {} ,
223
+ "bar": {} ,
224
224
}
225
225
}
226
226
```
0 commit comments