Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Fix ExtraLabels to be an optional field
Browse files Browse the repository at this point in the history
* Bug introduced in: 8238e10
  • Loading branch information
Dean-Coakley committed Mar 3, 2021
1 parent 56c5e69 commit cce9ff7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/nginxingresscontroller/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ import (
)

func serviceForNginxIngressController(instance *k8sv1alpha1.NginxIngressController) *corev1.Service {
extraLabels := map[string]string{}
if instance.Spec.Service != nil {
extraLabels = instance.Spec.Service.ExtraLabels
}

return &corev1.Service{
ObjectMeta: v1.ObjectMeta{
Name: instance.Name,
Namespace: instance.Namespace,
Labels: instance.Spec.Service.ExtraLabels,
Labels: extraLabels,
},
Spec: corev1.ServiceSpec{
Ports: []corev1.ServicePort{
Expand Down

0 comments on commit cce9ff7

Please sign in to comment.