From f2b8cf701a33f91cef19848c857fd6efb7db59dd Mon Sep 17 00:00:00 2001 From: f41gh7 Date: Wed, 12 Jul 2023 17:40:49 +0200 Subject: [PATCH] controllers/vmagent: fixes regression with authorization with customConfigReloader image secret wasn't mount properly. It caused authorization errors --- controllers/factory/vmagent.go | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/controllers/factory/vmagent.go b/controllers/factory/vmagent.go index 2b77d18e..6ad5d9e3 100644 --- a/controllers/factory/vmagent.go +++ b/controllers/factory/vmagent.go @@ -405,24 +405,21 @@ func makeSpecForVMAgent(cr *victoriametricsv1beta1.VMAgent, c *config.BaseOperat MountPath: StreamAggrConfigDir, }, ) - // no need to mount secret when using custom configReloader - if !c.UseCustomConfigReloader { - volumes = append(volumes, - corev1.Volume{ - Name: "config", - VolumeSource: corev1.VolumeSource{ - Secret: &corev1.SecretVolumeSource{ - SecretName: cr.PrefixedName(), - }, + volumes = append(volumes, + corev1.Volume{ + Name: "config", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: cr.PrefixedName(), }, - }) - agentVolumeMounts = append(agentVolumeMounts, - corev1.VolumeMount{ - Name: "config", - ReadOnly: true, - MountPath: vmAgentConfDir, - }) - } + }, + }) + agentVolumeMounts = append(agentVolumeMounts, + corev1.VolumeMount{ + Name: "config", + ReadOnly: true, + MountPath: vmAgentConfDir, + }) for _, s := range cr.Spec.Secrets { volumes = append(volumes, corev1.Volume{