mittwald / kubernetes-replicator

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

fix: secret is replicated to only partial namespaces #306

Open jjangga0214 opened 10 months ago

jjangga0214 commented 10 months ago

Describe the bug Secret is replicated to only partial namespaces.

To Reproduce

# 1. Create secret for oci registry
kubectl create secret -n etc docker-registry regcred \
--docker-server=example.com \
--docker-username=example \
--docker-password=example

# 2. Annotate 
kubectl annotate secret -n etc regcred replicator.v1.mittwald.de/replicate-to=”kia,kia-stg,kip,kip-stg”
  1. Check log
time="2023-10-14T05:57:07Z" level=info msg="Secret etc/regcred to be replicated to: [”kia,kia-stg,kip,kip-stg”]" kind=Secret source=etc/regcred
time="2023-10-14T05:57:07Z" level=info msg="Checking if kip/regcred exists? false" kind=Secret source=etc/regcred target=kip/regcred
time="2023-10-14T05:57:07Z" level=info msg="Replicated etc/regcred to: kip" source=etc/regcred
time="2023-10-14T05:57:07Z" level=info msg="Checking if kia-stg/regcred exists? false" kind=Secret source=etc/regcred target=kia-stg/regcred
time="2023-10-14T05:57:08Z" level=info msg="Replicated etc/regcred to: kia-stg" source=etc/regcred

As we can see, the secret is only replicated to kia-stg and kip, which is very strange.

When I change the namespace order(e.g. to [”kip,kip-stg,kia,kia-stg”]), this happens again with different partial namespaces chosen.

Expected behavior A clear and concise description of what you expected to happen.

Environment:

Additional context

I injected linkerd sidecar into the replicator pod.

oubeichen commented 8 months ago

You used Chinese character quotation marks in this line: kubectl annotate secret -n etc regcred replicator.v1.mittwald.de/replicate-to=”kia,kia-stg,kip,kip-stg”