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{
83
83
"--insecure-bind-address={{ if .URL }}{{ .URL.Hostname }}{{ end }}" ,
84
84
"--secure-port={{ if .SecurePort }}{{ .SecurePort }}{{ end }}" ,
85
85
"--admission-control=AlwaysAdmit" ,
86
+ "--service-cluster-ip-range=10.0.0.0/24" ,
86
87
}
87
88
88
89
// Environment creates a Kubernetes test environment that will start / stop the Kubernetes control plane and
@@ -148,6 +149,17 @@ func (te Environment) getAPIServerFlags() []string {
148
149
if len (te .KubeAPIServerFlags ) == 0 {
149
150
return DefaultKubeAPIServerFlags
150
151
}
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
+ }
151
163
return te .KubeAPIServerFlags
152
164
}
153
165
You can’t perform that action at this time.
0 commit comments