@@ -120,7 +120,7 @@ func CreateHeadlessService(svcs ServiceInterface, deployment metav1.Object, owne
120120 }
121121 publishNotReadyAddresses := true
122122 serviceType := v1 .ServiceTypeClusterIP
123- newlyCreated , err := createService (svcs , svcName , deploymentName , deployment .GetNamespace (), ClusterIPNone , "" , serviceType , ports , "" , publishNotReadyAddresses , owner )
123+ newlyCreated , err := createService (svcs , svcName , deploymentName , deployment .GetNamespace (), ClusterIPNone , "" , serviceType , ports , "" , nil , publishNotReadyAddresses , owner )
124124 if err != nil {
125125 return "" , false , maskAny (err )
126126 }
@@ -149,7 +149,7 @@ func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object
149149 }
150150 serviceType := v1 .ServiceTypeClusterIP
151151 publishNotReadyAddresses := false
152- newlyCreated , err := createService (svcs , svcName , deploymentName , deployment .GetNamespace (), "" , role , serviceType , ports , "" , publishNotReadyAddresses , owner )
152+ newlyCreated , err := createService (svcs , svcName , deploymentName , deployment .GetNamespace (), "" , role , serviceType , ports , "" , nil , publishNotReadyAddresses , owner )
153153 if err != nil {
154154 return "" , false , maskAny (err )
155155 }
@@ -160,7 +160,7 @@ func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object
160160// If the service already exists, nil is returned.
161161// If another error occurs, that error is returned.
162162// The returned bool is true if the service is created, or false when the service already existed.
163- func CreateExternalAccessService (svcs ServiceInterface , svcName , role string , deployment metav1.Object , serviceType v1.ServiceType , port , nodePort int , loadBalancerIP string , owner metav1.OwnerReference ) (string , bool , error ) {
163+ func CreateExternalAccessService (svcs ServiceInterface , svcName , role string , deployment metav1.Object , serviceType v1.ServiceType , port , nodePort int , loadBalancerIP string , loadBalancerSourceRanges [] string , owner metav1.OwnerReference ) (string , bool , error ) {
164164 deploymentName := deployment .GetName ()
165165 ports := []v1.ServicePort {
166166 v1.ServicePort {
@@ -171,7 +171,7 @@ func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, de
171171 },
172172 }
173173 publishNotReadyAddresses := false
174- newlyCreated , err := createService (svcs , svcName , deploymentName , deployment .GetNamespace (), "" , role , serviceType , ports , loadBalancerIP , publishNotReadyAddresses , owner )
174+ newlyCreated , err := createService (svcs , svcName , deploymentName , deployment .GetNamespace (), "" , role , serviceType , ports , loadBalancerIP , loadBalancerSourceRanges , publishNotReadyAddresses , owner )
175175 if err != nil {
176176 return "" , false , maskAny (err )
177177 }
@@ -183,7 +183,7 @@ func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, de
183183// If another error occurs, that error is returned.
184184// The returned bool is true if the service is created, or false when the service already existed.
185185func createService (svcs ServiceInterface , svcName , deploymentName , ns , clusterIP , role string , serviceType v1.ServiceType ,
186- ports []v1.ServicePort , loadBalancerIP string , publishNotReadyAddresses bool , owner metav1.OwnerReference ) (bool , error ) {
186+ ports []v1.ServicePort , loadBalancerIP string , loadBalancerSourceRanges [] string , publishNotReadyAddresses bool , owner metav1.OwnerReference ) (bool , error ) {
187187 labels := LabelsForDeployment (deploymentName , role )
188188 svc := & v1.Service {
189189 ObjectMeta : metav1.ObjectMeta {
@@ -203,6 +203,7 @@ func createService(svcs ServiceInterface, svcName, deploymentName, ns, clusterIP
203203 ClusterIP : clusterIP ,
204204 PublishNotReadyAddresses : publishNotReadyAddresses ,
205205 LoadBalancerIP : loadBalancerIP ,
206+ LoadBalancerSourceRanges : loadBalancerSourceRanges ,
206207 },
207208 }
208209 addOwnerRefToObject (svc .GetObjectMeta (), & owner )
0 commit comments