Skip to content

Commit

Permalink
controllers/vmagent: fixes regression with authorization
Browse files Browse the repository at this point in the history
with customConfigReloader image secret wasn't mount properly. It caused authorization errors
  • Loading branch information
f41gh7 committed Jul 12, 2023
1 parent c199848 commit f2b8cf7
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions controllers/factory/vmagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit f2b8cf7

Please sign in to comment.