Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang committed Mar 8, 2022
1 parent 0a298a3 commit 6212e9c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apis/apps/v1alpha1/nebulacluster_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,16 @@ func generateService(c NebulaClusterComponentter) *corev1.Service {
},
}

serviceSpec := c.GetServiceSpec()
if serviceSpec != nil && len(serviceSpec.Annotations) > 0 {
service.Annotations = serviceSpec.Annotations
}

if c.IsHeadlessService() {
service.Spec.ClusterIP = corev1.ClusterIPNone
service.Spec.PublishNotReadyAddresses = true
} else {
serviceSpec := c.GetServiceSpec()
if serviceSpec != nil && serviceSpec.ClusterIP != nil {
service.Spec.ClusterIP = *serviceSpec.ClusterIP
}
} else if serviceSpec != nil && serviceSpec.ClusterIP != nil {
service.Spec.ClusterIP = *serviceSpec.ClusterIP
}

return service
Expand Down

0 comments on commit 6212e9c

Please sign in to comment.