Skip to content

Commit e1fe2f0

Browse files
authored
Injects configured environment variables into all containers running in the pod (#77)
* this injects the right FLAGD_PORT into all containers running in the pod * this injects the right FLAGD_PORT into all containers running in the pod
1 parent bd81297 commit e1fe2f0

File tree

2 files changed

+4
-168
lines changed

2 files changed

+4
-168
lines changed

pkg/utils/flagd-definitions.json

Lines changed: 0 additions & 168 deletions
This file was deleted.

webhooks/pod_webhook.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ func (m *PodMutator) injectSidecar(pod *corev1.Pod, configMap string, featureFla
178178
envs = featureFlag.Spec.FlagDSpec.Envs
179179
}
180180

181+
// Add additional environment variables to existing containers
182+
for _, container := range pod.Spec.Containers {
183+
container.Env = append(container.Env, envs...)
184+
}
181185
pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{
182186
Name: "flagd",
183187
Image: "ghcr.io/open-feature/flagd:" + FlagDTag,

0 commit comments

Comments
 (0)