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 @@ -68,6 +68,7 @@ var DefaultKubeAPIServerFlags = []string{
68
68
"--insecure-bind-address={{ if .URL }}{{ .URL.Hostname }}{{ end }}" ,
69
69
"--secure-port={{ if .SecurePort }}{{ .SecurePort }}{{ end }}" ,
70
70
"--admission-control=AlwaysAdmit" ,
71
+ "--service-cluster-ip-range=10.0.0.0/24" ,
71
72
}
72
73
73
74
// Environment creates a Kubernetes test environment that will start / stop the Kubernetes control plane and
@@ -132,6 +133,17 @@ func (te Environment) getAPIServerFlags() []string {
132
133
if len (te .KubeAPIServerFlags ) == 0 {
133
134
return DefaultKubeAPIServerFlags
134
135
}
136
+ // Check KubeAPIServerFlags contains service-cluster-ip-range, if not, set default value to service-cluster-ip-range
137
+ containServiceClusterIPRange := false
138
+ for _ , flag := range te .KubeAPIServerFlags {
139
+ if strings .Contains (flag , "service-cluster-ip-range" ) {
140
+ containServiceClusterIPRange = true
141
+ break
142
+ }
143
+ }
144
+ if ! containServiceClusterIPRange {
145
+ te .KubeAPIServerFlags = append (te .KubeAPIServerFlags , "--service-cluster-ip-range=10.0.0.0/24" )
146
+ }
135
147
return te .KubeAPIServerFlags
136
148
}
137
149
You can’t perform that action at this time.
0 commit comments