From e420327744ab40744a8fb440c1bb5af84efdd3ad Mon Sep 17 00:00:00 2001 From: rksharma95 Date: Tue, 12 Nov 2024 17:51:40 +0530 Subject: [PATCH] update relay env vars with initial config Signed-off-by: rksharma95 --- .../internal/controller/resources.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/KubeArmorOperator/internal/controller/resources.go b/pkg/KubeArmorOperator/internal/controller/resources.go index e848be8333..499bf3f663 100644 --- a/pkg/KubeArmorOperator/internal/controller/resources.go +++ b/pkg/KubeArmorOperator/internal/controller/resources.go @@ -534,6 +534,22 @@ func (clusterWatcher *ClusterWatcher) WatchRequiredResources() { controller := deployments.GetKubeArmorControllerDeployment(common.Namespace) relayServer := deployments.GetRelayDeployment(common.Namespace) + // update relay env vars + relayServer.Spec.Template.Spec.Containers[0].Env = []corev1.EnvVar{ + { + Name: "ENABLE_STDOUT_LOGS", + Value: common.KubearmorRelayEnvMap[common.EnableStdOutLogs], + }, + { + Name: "ENABLE_STDOUT_ALERTS", + Value: common.KubearmorRelayEnvMap[common.EnableStdOutAlerts], + }, + { + Name: "ENABLE_STDOUT_MSGS", + Value: common.KubearmorRelayEnvMap[common.EnableStdOutMsgs], + }, + } + if common.EnableTls { relayServer.Spec.Template.Spec.Containers[0].VolumeMounts = append(relayServer.Spec.Template.Spec.Containers[0].VolumeMounts, common.KubeArmorRelayTlsVolumeMount...)