From bd1d62374180152a3344c458cc48bc3941f6b410 Mon Sep 17 00:00:00 2001 From: Ritesh H Shukla Date: Thu, 4 Jun 2020 12:36:10 -0700 Subject: [PATCH] Fix bug due to empty ImagePullSecret (#138) Set ImagePullSecret only if not empty. Ref: https://github.com/kubernetes/kubernetes/issues/85332 Signed-off-by: Ritesh H Shukla --- pkg/resources/statefulsets/minio-statefulset.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/resources/statefulsets/minio-statefulset.go b/pkg/resources/statefulsets/minio-statefulset.go index 1359d28668a..b1353d94824 100644 --- a/pkg/resources/statefulsets/minio-statefulset.go +++ b/pkg/resources/statefulsets/minio-statefulset.go @@ -361,7 +361,6 @@ func NewForMinIO(mi *miniov1.MinIOInstance, serviceName string) *appsv1.Stateful Spec: corev1.PodSpec{ Containers: containers, Volumes: podVolumes, - ImagePullSecrets: []corev1.LocalObjectReference{mi.Spec.ImagePullSecret}, RestartPolicy: corev1.RestartPolicyAlways, Affinity: mi.Spec.Affinity, SchedulerName: mi.Scheduler.Name, @@ -373,6 +372,11 @@ func NewForMinIO(mi *miniov1.MinIOInstance, serviceName string) *appsv1.Stateful }, } + // Address issue https://github.com/kubernetes/kubernetes/issues/85332 + if mi.Spec.ImagePullSecret.Name != "" { + ss.Spec.Template.Spec.ImagePullSecrets = []corev1.LocalObjectReference{mi.Spec.ImagePullSecret} + } + if mi.Spec.VolumeClaimTemplate != nil { pvClaim := *mi.Spec.VolumeClaimTemplate name := pvClaim.Name