From d060688a9c0acb4bd9b8c445038e123f49167a6d Mon Sep 17 00:00:00 2001 From: Tyler Flint Date: Tue, 26 Dec 2023 10:46:12 -0500 Subject: [PATCH] Allow setting the api endpoint for local development workflows --- api/v1/egress.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v1/egress.go b/api/v1/egress.go index 0286438..1d84028 100644 --- a/api/v1/egress.go +++ b/api/v1/egress.go @@ -277,6 +277,14 @@ func MutateInjection(pod *corev1.Pod, config *Config) error { }) } + // API_ENDPOINT + if apiEndpoint := config.GetAnnotation("api-endpoint"); apiEndpoint != "" { + qtapContainer.Env = append(qtapContainer.Env, corev1.EnvVar{ + Name: "ENDPOINT", + Value: apiEndpoint, + }) + } + // append to the list pod.Spec.Containers = append(pod.Spec.Containers, qtapContainer)