File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -417,19 +417,25 @@ func setSecurityContext() *corev1.SecurityContext {
417417}
418418
419419func OpenFeatureEnabledAnnotationIndex (o client.Object ) []string {
420- val , ok := o .(* corev1.Pod ).ObjectMeta .Annotations ["openfeature.dev/enabled" ]
421- if ! ok || val != "true" {
422- val , ok := o .(* corev1.Pod ).ObjectMeta .Annotations ["openfeature.dev" ]
423- if ok && val == "enabled" {
424- return []string {
425- "true" ,
426- }
427- }
420+ pod := o .(* corev1.Pod )
421+ if pod .ObjectMeta .Annotations == nil {
428422 return []string {
429423 "false" ,
430424 }
431425 }
426+ val , ok := pod .ObjectMeta .Annotations ["openfeature.dev/enabled" ]
427+ if ok && val == "true" {
428+ return []string {
429+ "true" ,
430+ }
431+ }
432+ val , ok = pod .ObjectMeta .Annotations ["openfeature.dev" ]
433+ if ok && val == "enabled" {
434+ return []string {
435+ "true" ,
436+ }
437+ }
432438 return []string {
433- "true " ,
439+ "false " ,
434440 }
435441}
You can’t perform that action at this time.
0 commit comments