🐛 Fix .spec.template.spec.imagePullSecrets: element 0: associative list with keys has an element that omits key field \"name\" error

This commit is contained in:
M. Mert Yildiran
2023-01-08 21:47:00 +03:00
parent eaa21f0789
commit d6766a8ac5

View File

@@ -816,11 +816,13 @@ func (provider *Provider) ApplyWorkerDaemonSet(
podSpec.WithTolerations(noExecuteToleration, noScheduleToleration)
podSpec.WithVolumes(procfsVolume, sysfsVolume)
localObjectReference := applyconfcore.LocalObjectReference()
for _, secret := range imagePullSecrets {
localObjectReference.WithName(secret.Name)
if len(imagePullSecrets) > 0 {
localObjectReference := applyconfcore.LocalObjectReference()
for _, secret := range imagePullSecrets {
localObjectReference.WithName(secret.Name)
}
podSpec.WithImagePullSecrets(localObjectReference)
}
podSpec.WithImagePullSecrets(localObjectReference)
podTemplate := applyconfcore.PodTemplateSpec()
podTemplate.WithLabels(map[string]string{