k8snetworkplumbingwg / sriov-network-operator

Operator for provisioning and configuring SR-IOV CNI plugin and device plugin
Apache License 2.0
85 stars 114 forks source link

Fix merge annotation function #776

Closed SchSeba closed 2 months ago

SchSeba commented 2 months ago

if the current obj as annotation and the updated doesn't we still want to add the ones from the current object

github-actions[bot] commented 2 months ago

Thanks for your PR, To run vendors CIs, Maintainers can use one of:

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10939403064

Details


Files with Coverage Reduction New Missed Lines %
controllers/drain_controller.go 3 67.42%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 10935762250: -0.02%
Covered Lines: 6625
Relevant Lines: 14711

💛 - Coveralls
SchSeba commented 2 months ago

Right or from operators.

Where I was able to find this issue is in openshift we have an operator to generate the internal pull secret for every service account

apiVersion: v1
imagePullSecrets:
- name: network-resources-injector-sa-dockercfg-46j2c
kind: ServiceAccount
metadata:
  annotations:
    openshift.io/internal-registry-pull-secret-ref: network-resources-injector-sa-dockercfg-46j2c
creationTimestamp: "2024-09-16T12:15:10Z"
  name: network-resources-injector-sa
  namespace: openshift-sriov-network-operator
  ownerReferences:
  - apiVersion: sriovnetwork.openshift.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: SriovOperatorConfig
    name: default
    uid: 745df61d-68d7-4e97-a399-389bae71b7ba
  resourceVersion: "28652"
  uid: 6fe1b49e-943f-4c95-92aa-5cf0ab322151
secrets:
- name: network-resources-injector-sa-dockercfg-46j2c

without this change everytime we did a reconcile we remove this on and the openshift operator was creating a new imagepullSecret

after a few days this was running the number of secrets was huge