File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ var DefaultKubeAPIServerFlags = []string{
8383 "--insecure-bind-address={{ if .URL }}{{ .URL.Hostname }}{{ end }}" ,
8484 "--secure-port={{ if .SecurePort }}{{ .SecurePort }}{{ end }}" ,
8585 "--admission-control=AlwaysAdmit" ,
86+ "--service-cluster-ip-range=10.0.0.0/24" ,
8687}
8788
8889// Environment creates a Kubernetes test environment that will start / stop the Kubernetes control plane and
@@ -148,6 +149,17 @@ func (te Environment) getAPIServerFlags() []string {
148149 if len (te .KubeAPIServerFlags ) == 0 {
149150 return DefaultKubeAPIServerFlags
150151 }
152+ // Check KubeAPIServerFlags contains service-cluster-ip-range, if not, set default value to service-cluster-ip-range
153+ containServiceClusterIPRange := false
154+ for _ , flag := range te .KubeAPIServerFlags {
155+ if strings .Contains (flag , "service-cluster-ip-range" ) {
156+ containServiceClusterIPRange = true
157+ break
158+ }
159+ }
160+ if ! containServiceClusterIPRange {
161+ te .KubeAPIServerFlags = append (te .KubeAPIServerFlags , "--service-cluster-ip-range=10.0.0.0/24" )
162+ }
151163 return te .KubeAPIServerFlags
152164}
153165
You can’t perform that action at this time.
0 commit comments