kubernetes-replicator
kubernetes-replicator copied to clipboard
fix: secret is replicated to only partial namespaces
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”
- 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:
- Kubernetes version: v1.28.2
- kubernetes-replicator version:
- image: quay.io/mittwald/kubernetes-replicator:v2.9.1
- helm chart: v2.9.1
Additional context
I injected linkerd sidecar into the replicator pod.
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”