Skip to content

Commit

Permalink
Fix bug due to empty ImagePullSecret (#138)
Browse files Browse the repository at this point in the history
Set ImagePullSecret only if not empty.

Ref: kubernetes/kubernetes#85332

Signed-off-by: Ritesh H Shukla <[email protected]>
  • Loading branch information
kerneltime authored Jun 4, 2020
1 parent 4444708 commit bd1d623
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/resources/statefulsets/minio-statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit bd1d623

Please sign in to comment.