File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
pkg/controller/configmap_ca_injector Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,16 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
60
60
//"config.openshift.io/inject-trusted-cabundle" annotation
61
61
pred := predicate.Funcs {
62
62
UpdateFunc : func (e event.UpdateEvent ) bool {
63
- return e .MetaNew .GetAnnotations ()[names .TRUST_BUNDLE_CONFIGMAP_ANNOTATION ] == "true" ||
64
- (e .MetaNew .GetName () == names .TRUST_BUNDLE_CONFIGMAP && e .MetaNew .GetNamespace () == names .TRUST_BUNDLE_CONFIGMAP_NS )
63
+ return shouldUpdateConfigMaps (e .MetaNew )
65
64
},
66
65
DeleteFunc : func (e event.DeleteEvent ) bool {
67
66
return false
68
67
},
69
68
CreateFunc : func (e event.CreateEvent ) bool {
70
- return e .Meta .GetAnnotations ()[names .TRUST_BUNDLE_CONFIGMAP_ANNOTATION ] == "true" ||
71
- (e .Meta .GetName () == names .TRUST_BUNDLE_CONFIGMAP && e .Meta .GetNamespace () == names .TRUST_BUNDLE_CONFIGMAP_NS )
69
+ return shouldUpdateConfigMaps (e .Meta )
72
70
},
73
71
GenericFunc : func (e event.GenericEvent ) bool {
74
- return e .Meta .GetAnnotations ()[names .TRUST_BUNDLE_CONFIGMAP_ANNOTATION ] == "true" ||
75
- (e .Meta .GetName () == names .TRUST_BUNDLE_CONFIGMAP && e .Meta .GetNamespace () == names .TRUST_BUNDLE_CONFIGMAP_NS )
72
+ return shouldUpdateConfigMaps (e .Meta )
76
73
},
77
74
}
78
75
@@ -178,3 +175,8 @@ func (r *ReconcileConfigMapInjector) validateTrustBundleConfigMap(cfgMap *corev1
178
175
179
176
return bundleData , nil
180
177
}
178
+
179
+ func shouldUpdateConfigMaps (meta metav1.Object ) bool {
180
+ return meta .GetAnnotations ()[names .TRUST_BUNDLE_CONFIGMAP_ANNOTATION ] == "true" ||
181
+ (meta .GetName () == names .TRUST_BUNDLE_CONFIGMAP && meta .GetNamespace () == names .TRUST_BUNDLE_CONFIGMAP_NS )
182
+ }
You can’t perform that action at this time.
0 commit comments