mittwald / kubernetes-replicator

Kubernetes controller for synchronizing secrets & config maps across namespaces
Apache License 2.0
886 stars 101 forks source link

ServiceAccount replication doesn't preserve annotations #286

Open vivek1612 opened 1 year ago

vivek1612 commented 1 year ago

Describe the bug

Replicated service accounts only have replicator.v1.mittwald.de/replicated-at and replicator.v1.mittwald.de/replicated-from-version. Annotations in the source service account are missing in the target.

To Reproduce

Create a service account and a namespace. Notice the service account will be replicated to the new namespace but the replicated service account will not have testAnnotation.

apiVersion: v1
kind: ServiceAccount
metadata:
  name: test-sa
  namespace: default
  annotations:
    replicator.v1.mittwald.de/replicate-to-matching: app=my-app
    testAnnotation: testAnnotation
apiVersion: v1
kind: Namespace
metadata:
  name: test-ns
  labels:
    app: my-app

Expected behavior

The target service account should have all the annotations that were present in the source, besides the ones that trigger replication.

Environment:

pschichtel commented 7 months ago

189 describes the same problem