Skip to content

Commit fdd25ec

Browse files
darshanimeliggitt
authored andcommitted
Fix bug in apiserver service cluster cidr split
Signed-off-by: darshanime <[email protected]>
1 parent 864596f commit fdd25ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/kube-apiserver/app/server.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,10 @@ func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error) {
572572

573573
// process s.ServiceClusterIPRange from list to Primary and Secondary
574574
// we process secondary only if provided by user
575-
576-
serviceClusterIPRangeList := strings.Split(s.ServiceClusterIPRanges, ",")
575+
serviceClusterIPRangeList := []string{}
576+
if s.ServiceClusterIPRanges != "" {
577+
serviceClusterIPRangeList = strings.Split(s.ServiceClusterIPRanges, ",")
578+
}
577579

578580
var apiServerServiceIP net.IP
579581
var serviceIPRange net.IPNet

0 commit comments

Comments
 (0)