Update the kubelet volume mount of non-root enabler container on the real object not on a copy of it
@@ -526,8 +526,8 @@ func (r *ReconcileSPOd) getConfiguredSPOd(
volume, mount := bindata.CustomHostKubeletVolume(config.KubeletDir())
templateSpec.Volumes = append(templateSpec.Volumes, volume)
- nonRootEnabler := templateSpec.InitContainers[bindata.InitContainerIDNonRootenabler]
- nonRootEnabler.VolumeMounts = append(nonRootEnabler.VolumeMounts, mount)
+ templateSpec.InitContainers[bindata.InitContainerIDNonRootenabler].VolumeMounts =
+ append(templateSpec.InitContainers[bindata.InitContainerIDNonRootenabler].VolumeMounts, mount)
}
// Custom host proc volume
