-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Description: In the latest version of Reflector, secrets annotated for reflection are not being mirrored in newly created namespaces. Despite properly annotating the secret, it does not appear in the newly created namespace (test-namespace
). This issue did not exist in previous versions.Steps to Reproduce
-
Deploy the latest version of Reflector.
-
Create a secret in the
default
namespace with the following annotations:
kind: Secret
metadata:
name: test-secret
namespace: default
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: ""
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: ""
type: Opaque
data:
key: dGVzdA== # "test" in base64
- Create a new namespace:
kubectl create namespace test-namespace
- Check if the secret is mirrored in
test-namespace
:
kubectl get secrets -n test-namespace
Expected Behavior The secret should be automatically mirrored into the test-namespace
as per the reflection-auto-enabled: "true"
annotation.Actual Behavior The secret is not mirrored into the test-namespace
.Logs from Reflector
2025-02-26 10:30:38.461 +00:00 [INF] (ES.Kubernetes.Reflector.Core.NamespaceWatcher) Requesting V1Namespace resources
2025-02-26 10:30:38.537 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretWatcher) Requesting V1Secret resources
2025-02-26 10:30:38.545 +00:00 [INF] (ES.Kubernetes.Reflector.Core.ConfigMapWatcher) Requesting V1ConfigMap resources
2025-02-26 10:30:38.586 +00:00 [INF] (Microsoft.Hosting.Lifetime) Now listening on: http://[::]:8080
2025-02-26 10:30:38.586 +00:00 [INF] (Microsoft.Hosting.Lifetime) Application started. Press Ctrl+C to shut down.
2025-02-26 10:30:38.586 +00:00 [INF] (Microsoft.Hosting.Lifetime) Hosting environment: Production
2025-02-26 10:30:38.586 +00:00 [INF] (Microsoft.Hosting.Lifetime) Content root path: /app
2025-02-26 10:30:38.929 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created kube-node-lease/dockerhub as a reflection of default/dockerhub
2025-02-26 10:30:38.941 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created kube-public/dockerhub as a reflection of default/dockerhub
2025-02-26 10:30:38.951 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created kube-system/dockerhub as a reflection of default/dockerhub
2025-02-26 10:30:38.964 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created local-path-storage/dockerhub as a reflection of default/dockerhub
2025-02-26 10:30:38.964 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Auto-reflected default/dockerhub where permitted. Created 4 - Updated 0 - Deleted 0 - Validated 0.
2025-02-26 10:30:38.995 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created kube-node-lease/ghcr as a reflection of default/ghcr
2025-02-26 10:30:39.007 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created kube-public/ghcr as a reflection of default/ghcr
2025-02-26 10:30:39.017 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created kube-system/ghcr as a reflection of default/ghcr
2025-02-26 10:30:39.028 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Created local-path-storage/ghcr as a reflection of default/ghcr
2025-02-26 10:30:39.029 +00:00 [INF] (ES.Kubernetes.Reflector.Core.SecretMirror) Auto-reflected default/ghcr where permitted. Created 4 - Updated 0 - Deleted 0 - Validated 0.
Output of kubectl get secrets -A
(Secret Not Mirrored in test-namespace
)**
NAMESPACE NAME TYPE DATA AGE
default test-secret Opaque 1 4m39s
kube-node-lease test-secret Opaque 1 4m32s
kube-public test-secret Opaque 1 4m32s
kube-system test-secret Opaque 1 4m32s
local-path-storage test-secret Opaque 1 4m32s
# test-namespace missing from the list
Possible Regression?
This behavior worked in previous versions but is broken in the latest update.
Additional Context: Secrets are correctly mirrored into default system namespaces (kube-node-lease
, kube-public
, kube-system
, local-path-storage
), but the newly created namespace test-namespace
is missing.