@@ -37,6 +37,7 @@ import (
3737 "github.com/arangodb/kube-arangodb/pkg/util/globals"
3838 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
3939 inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector"
40+ "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tools"
4041)
4142
4243type PatchFunc func (name string , d []byte ) error
@@ -180,7 +181,7 @@ func (r *Resources) ensureSecretsAnnotations(patch PatchFunc, cachedStatus inspe
180181 r .ensureAnnotationsMap (secret .Kind , secret , spec , patch )
181182 return nil
182183 }, func (secret * core.Secret ) bool {
183- return k8sutil .IsChildResource (kind , name , namespace , secret )
184+ return tools .IsChildResource (kind , name , namespace , secret )
184185 }); err != nil {
185186 return err
186187 }
@@ -193,7 +194,7 @@ func (r *Resources) ensureServiceAccountsAnnotations(patch PatchFunc, cachedStat
193194 r .ensureAnnotationsMap (serviceAccount .Kind , serviceAccount , spec , patch )
194195 return nil
195196 }, func (serviceAccount * core.ServiceAccount ) bool {
196- return k8sutil .IsChildResource (kind , name , namespace , serviceAccount )
197+ return tools .IsChildResource (kind , name , namespace , serviceAccount )
197198 }); err != nil {
198199 return err
199200 }
@@ -206,7 +207,7 @@ func (r *Resources) ensureServicesAnnotations(patch PatchFunc, cachedStatus insp
206207 r .ensureAnnotationsMap (service .Kind , service , spec , patch )
207208 return nil
208209 }, func (service * core.Service ) bool {
209- return k8sutil .IsChildResource (kind , name , namespace , service )
210+ return tools .IsChildResource (kind , name , namespace , service )
210211 }); err != nil {
211212 return err
212213 }
@@ -221,7 +222,7 @@ func (r *Resources) ensurePdbsAnnotations(patch PatchFunc, cachedStatus inspecto
221222 r .ensureAnnotationsMap (podDisruptionBudget .Kind , podDisruptionBudget , spec , patch )
222223 return nil
223224 }, func (podDisruptionBudget * policyv1.PodDisruptionBudget ) bool {
224- return k8sutil .IsChildResource (kind , name , namespace , podDisruptionBudget )
225+ return tools .IsChildResource (kind , name , namespace , podDisruptionBudget )
225226 }); err != nil {
226227 return err
227228 }
@@ -237,7 +238,7 @@ func (r *Resources) ensurePdbsAnnotations(patch PatchFunc, cachedStatus inspecto
237238 r .ensureAnnotationsMap (podDisruptionBudget .Kind , podDisruptionBudget , spec , patch )
238239 return nil
239240 }, func (podDisruptionBudget * policyv1beta1.PodDisruptionBudget ) bool {
240- return k8sutil .IsChildResource (kind , name , namespace , podDisruptionBudget )
241+ return tools .IsChildResource (kind , name , namespace , podDisruptionBudget )
241242 }); err != nil {
242243 return err
243244 }
@@ -250,7 +251,7 @@ func (r *Resources) ensurePvcsAnnotations(patch PatchFunc, cachedStatus inspecto
250251 r .ensureGroupAnnotationsMap (persistentVolumeClaim .Kind , persistentVolumeClaim , spec , patch )
251252 return nil
252253 }, func (persistentVolumeClaim * core.PersistentVolumeClaim ) bool {
253- return k8sutil .IsChildResource (kind , name , namespace , persistentVolumeClaim )
254+ return tools .IsChildResource (kind , name , namespace , persistentVolumeClaim )
254255 }); err != nil {
255256 return err
256257 }
@@ -270,7 +271,7 @@ func (r *Resources) ensureServiceMonitorsAnnotations(patch PatchFunc, cachedStat
270271 r .ensureAnnotationsMap (serviceMonitor .Kind , serviceMonitor , spec , patch )
271272 return nil
272273 }, func (serviceMonitor * monitoring.ServiceMonitor ) bool {
273- return k8sutil .IsChildResource (kind , name , namespace , serviceMonitor )
274+ return tools .IsChildResource (kind , name , namespace , serviceMonitor )
274275 }); err != nil {
275276 return err
276277 }
@@ -298,7 +299,7 @@ func (r *Resources) ensurePodsAnnotations(patch PatchFunc, cachedStatus inspecto
298299 r .ensureGroupAnnotationsMap (pod .Kind , pod , spec , patch )
299300 return nil
300301 }, func (pod * core.Pod ) bool {
301- return k8sutil .IsChildResource (kind , name , namespace , pod )
302+ return tools .IsChildResource (kind , name , namespace , pod )
302303 }); err != nil {
303304 return err
304305 }
@@ -307,7 +308,7 @@ func (r *Resources) ensurePodsAnnotations(patch PatchFunc, cachedStatus inspecto
307308}
308309
309310func (r * Resources ) isChildResource (obj meta.Object ) bool {
310- return k8sutil .IsChildResource (deployment .ArangoDeploymentResourceKind ,
311+ return tools .IsChildResource (deployment .ArangoDeploymentResourceKind ,
311312 r .context .GetAPIObject ().GetName (),
312313 r .context .GetAPIObject ().GetNamespace (),
313314 obj )
0 commit comments