From 34a3e0def76135d97da0d803cbe6df6fe1597fe5 Mon Sep 17 00:00:00 2001 From: John Schnake Date: Fri, 1 Apr 2022 21:50:03 -0500 Subject: [PATCH] Add configmaps to sidecars Currently when a configmap is defined in a plugin it is only added to the main container and not the sidecars. This adds it in the same fashion to the others. Signed-off-by: John Schnake --- pkg/client/gen.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/client/gen.go b/pkg/client/gen.go index c83909017..40ab3a700 100644 --- a/pkg/client/gen.go +++ b/pkg/client/gen.go @@ -170,6 +170,16 @@ func (*SonobuoyClient) GenerateManifestAndPlugins(cfg *GenConfig) ([]byte, []*ma }}, }, }) + // Sidecars get mounts too so that they can leverage the feature too. + if p.PodSpec != nil && len(p.PodSpec.Containers) > 0 { + for i := range p.PodSpec.Containers { + p.PodSpec.Containers[i].VolumeMounts = append(p.Spec.VolumeMounts, + corev1.VolumeMount{ + Name: fmt.Sprintf("sonobuoy-%v-vol", p.SonobuoyConfig.PluginName), + MountPath: sonobuoyDefaultConfigDir, + }) + } + } p.Spec.VolumeMounts = append(p.Spec.VolumeMounts, corev1.VolumeMount{ Name: fmt.Sprintf("sonobuoy-%v-vol", p.SonobuoyConfig.PluginName),