Skip to content

Commit

Permalink
Fix mount for sidecars (#1667)
Browse files Browse the repository at this point in the history
Fix bug with sidecar mount. When we have a good post-processor
it will be easier to add tests for this.

Signed-off-by: John Schnake <jschnake@vmware.com>
  • Loading branch information
johnSchnake authored Apr 2, 2022
1 parent 0151ee8 commit 24480fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/client/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ 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 {
if p.PodSpec != nil {
for i := range p.PodSpec.Containers {
p.PodSpec.Containers[i].VolumeMounts = append(p.Spec.VolumeMounts,
p.PodSpec.Containers[i].VolumeMounts = append(p.PodSpec.Containers[i].VolumeMounts,
corev1.VolumeMount{
Name: fmt.Sprintf("sonobuoy-%v-vol", p.SonobuoyConfig.PluginName),
MountPath: sonobuoyDefaultConfigDir,
Expand Down

0 comments on commit 24480fa

Please sign in to comment.