Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
Signed-off-by: anisha.kj <[email protected]>
  • Loading branch information
anishakj committed Nov 7, 2023
1 parent f8809f6 commit f51da35
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions controllers/pravega_segmentstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,8 @@ func MakeSegmentStoreExternalServices(p *api.PravegaCluster) []*corev1.Service {
serviceport, _ := strconv.Atoi(p.Spec.Pravega.Options["pravegaservice.service.listener.port"])
adminPort, _ := strconv.Atoi(p.Spec.Pravega.Options["pravegaservice.admin.listener.port"])

servicePortIncrement := int32(0)
adminPortIncrement := int32(0)
currentServicePort := int32(serviceport)
currentAdminPort := int32(adminPort)

for i := int32(0); i < p.Spec.Pravega.SegmentStoreReplicas; i++ {
ssPodName := p.ServiceNameForSegmentStore(i)
Expand Down Expand Up @@ -644,20 +644,20 @@ func MakeSegmentStoreExternalServices(p *api.PravegaCluster) []*corev1.Service {
service.Spec.ExternalTrafficPolicy = corev1.ServiceExternalTrafficPolicyTypeLocal
}
if p.Spec.Pravega.SegmentStoreLoadBalancerIP != "" {
for util.ContainsElement(p.Spec.ReservedPortList, int32(serviceport)+i+servicePortIncrement) {
servicePortIncrement++
for util.ContainsElement(p.Spec.ReservedPortList, currentServicePort) {
currentServicePort++
}

service.Spec.Ports[0].Port = int32(serviceport) + i + servicePortIncrement

for util.ContainsElement(p.Spec.ReservedPortList, int32(adminPort)+i+adminPortIncrement) {
adminPortIncrement++
service.Spec.Ports[0].Port = currentServicePort
for util.ContainsElement(p.Spec.ReservedPortList, currentAdminPort) {
currentAdminPort++
}
service.Spec.Ports[1].Port = int32(adminPort) + i + adminPortIncrement

service.Spec.Ports[1].Port = currentAdminPort
service.Spec.LoadBalancerIP = p.Spec.Pravega.SegmentStoreLoadBalancerIP
currentServicePort++
currentAdminPort++
}
services[i] = service

}
return services
}
Expand Down

0 comments on commit f51da35

Please sign in to comment.