@@ -117,14 +117,14 @@ protected <P extends HasMetadata> ControllerConfiguration<P> configFor(Reconcile
117
117
final var associatedReconcilerClass =
118
118
ResolvedControllerConfiguration .getAssociatedReconcilerClassName (reconciler .getClass ());
119
119
120
+ final var context = Utils .contextFor (name );
120
121
final Class <? extends Retry > retryClass = annotation .retry ();
121
122
final var retry = Utils .instantiateAndConfigureIfNeeded (retryClass , Retry .class ,
122
- Utils . contextFor ( name , null , null ) , configuratorFor (Retry .class , reconciler ));
123
+ context , configuratorFor (Retry .class , reconciler ));
123
124
124
125
final Class <? extends RateLimiter > rateLimiterClass = annotation .rateLimiter ();
125
126
final var rateLimiter = Utils .instantiateAndConfigureIfNeeded (rateLimiterClass ,
126
- RateLimiter .class ,
127
- Utils .contextFor (name , null , null ), configuratorFor (RateLimiter .class , reconciler ));
127
+ RateLimiter .class , context , configuratorFor (RateLimiter .class , reconciler ));
128
128
129
129
final var reconciliationInterval = annotation .maxReconciliationInterval ();
130
130
long interval = -1 ;
@@ -133,21 +133,14 @@ protected <P extends HasMetadata> ControllerConfiguration<P> configFor(Reconcile
133
133
interval = reconciliationInterval .interval ();
134
134
timeUnit = reconciliationInterval .timeUnit ();
135
135
}
136
-
137
- final var itemStore =
138
- Utils .instantiateAndConfigureIfNeeded (annotation .itemStore (), ItemStore .class ,
139
- Utils .contextFor (name ), null );
140
-
136
+
141
137
final var config = new ResolvedControllerConfiguration <P >(
142
138
resourceClass , name , generationAware ,
143
139
associatedReconcilerClass , retry , rateLimiter ,
144
140
ResolvedControllerConfiguration .getMaxReconciliationInterval (interval , timeUnit ),
145
- Utils .instantiate (annotation .onAddFilter (), OnAddFilter .class ,
146
- Utils .contextFor (name , null , null )),
147
- Utils .instantiate (annotation .onUpdateFilter (), OnUpdateFilter .class ,
148
- Utils .contextFor (name , null , null )),
149
- Utils .instantiate (annotation .genericFilter (), GenericFilter .class ,
150
- Utils .contextFor (name , null , null )),
141
+ Utils .instantiate (annotation .onAddFilter (), OnAddFilter .class , context ),
142
+ Utils .instantiate (annotation .onUpdateFilter (), OnUpdateFilter .class , context ),
143
+ Utils .instantiate (annotation .genericFilter (), GenericFilter .class , context ),
151
144
Set .of (valueOrDefault (annotation ,
152
145
io .javaoperatorsdk .operator .api .reconciler .ControllerConfiguration ::namespaces ,
153
146
DEFAULT_NAMESPACES_SET .toArray (String []::new ))),
@@ -157,7 +150,8 @@ protected <P extends HasMetadata> ControllerConfiguration<P> configFor(Reconcile
157
150
valueOrDefault (annotation ,
158
151
io .javaoperatorsdk .operator .api .reconciler .ControllerConfiguration ::labelSelector ,
159
152
Constants .NO_VALUE_SET ),
160
- null , itemStore );
153
+ null ,
154
+ Utils .instantiate (annotation .itemStore (), ItemStore .class , context ));
161
155
162
156
ResourceEventFilter <P > answer = deprecatedEventFilter (annotation );
163
157
config .setEventFilter (answer != null ? answer : ResourceEventFilters .passthrough ());
0 commit comments