Skip to content

Commit b4980ff

Browse files
author
jmccormick2001
committed
fix bug where replica service was not getting the same service type as the primary service type
1 parent 567cca8 commit b4980ff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

operator/cluster/cluster.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,19 @@ func ScaleBase(clientset *kubernetes.Clientset, client *rest.RESTClient, replica
403403
}
404404

405405
//create the replica service if it doesnt exist
406+
407+
st := operator.Pgo.Cluster.ServiceType
408+
409+
if cluster.Spec.UserLabels[util.LABEL_SERVICE_TYPE] != "" {
410+
st = cluster.Spec.UserLabels[util.LABEL_SERVICE_TYPE]
411+
}
412+
406413
serviceName := replica.Spec.ClusterName + "-replica"
407414
serviceFields := ServiceTemplateFields{
408415
Name: serviceName,
409416
ClusterName: replica.Spec.ClusterName,
410417
Port: cluster.Spec.Port,
411-
ServiceType: operator.Pgo.Cluster.ServiceType,
418+
ServiceType: st,
412419
}
413420

414421
err = CreateService(clientset, &serviceFields, namespace)

0 commit comments

Comments
 (0)