@@ -26,10 +26,11 @@ import (
2626
2727// we likely want these to be configurable, eventually
2828const (
29- FlagDImagePullPolicy corev1.PullPolicy = "Always"
30- clusterRoleBindingName string = "open-feature-operator-flagd-kubernetes-sync"
31- flagdMetricPortEnvVar string = "FLAGD_METRICS_PORT"
32- fileSyncMountPath string = "/etc/flagd/"
29+ FlagDImagePullPolicy corev1.PullPolicy = "Always"
30+ clusterRoleBindingName string = "open-feature-operator-flagd-kubernetes-sync"
31+ flagdMetricPortEnvVar string = "FLAGD_METRICS_PORT"
32+ fileSyncMountPath string = "/etc/flagd/"
33+ OpenFeatureEnabledAnnotationPath = "metadata.annotations.openfeature.dev/enabled"
3334)
3435
3536var FlagDTag = "main"
@@ -56,10 +57,10 @@ func (m *PodMutator) BackfillPermissions(ctx context.Context) {
5657 for i := 0 ; i < 5 ; i ++ {
5758 // fetch all pods with the "openfeature.dev/enabled" annotation set to "true"
5859 podList := & corev1.PodList {}
59- err := m .Client .List (ctx , podList , client.MatchingFields {"metadata.annotations.openfeature.dev/enabled" : "true" })
60+ err := m .Client .List (ctx , podList , client.MatchingFields {OpenFeatureEnabledAnnotationPath : "true" })
6061 if err != nil {
6162 if ! goErr .Is (err , & cache.ErrCacheNotStarted {}) {
62- m .Log .Error (err , "unable to list annotated pods" , "webhook" , "metadata.annotations.openfeature.dev/enabled" )
63+ m .Log .Error (err , "unable to list annotated pods" , "webhook" , OpenFeatureEnabledAnnotationPath )
6364 return
6465 }
6566 time .Sleep (1 * time .Second )
@@ -74,7 +75,7 @@ func (m *PodMutator) BackfillPermissions(ctx context.Context) {
7475 err ,
7576 fmt .Sprintf ("unable backfill permissions for pod %s/%s" , pod .Namespace , pod .Name ),
7677 "webhook" ,
77- "metadata.annotations.openfeature.dev/enabled" ,
78+ OpenFeatureEnabledAnnotationPath ,
7879 )
7980 }
8081 }
@@ -84,7 +85,7 @@ func (m *PodMutator) BackfillPermissions(ctx context.Context) {
8485 m .Log .Error (
8586 err ,
8687 "webhook" ,
87- "metadata.annotations.openfeature.dev/enabled" ,
88+ OpenFeatureEnabledAnnotationPath ,
8889 )
8990}
9091
0 commit comments