Skip to content

Commit b211b6c

Browse files
committed
APIServer defaults deduplication
1 parent 8c39906 commit b211b6c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/envtest/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,11 @@ func (te *Environment) Stop() error {
156156
}
157157

158158
// getAPIServerFlags returns flags to be used with the Kubernetes API server.
159+
// it returns empty slice for api server defined defaults to be applied if no args specified
159160
func (te Environment) getAPIServerFlags() []string {
160161
// Set default API server flags if not set.
161162
if len(te.KubeAPIServerFlags) == 0 {
162-
return DefaultKubeAPIServerFlags
163+
return []string{}
163164
}
164165
// Check KubeAPIServerFlags contains service-cluster-ip-range, if not, set default value to service-cluster-ip-range
165166
containServiceClusterIPRange := false

pkg/internal/testing/integration/internal/apiserver.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package internal
22

33
var APIServerDefaultArgs = []string{
4+
// Allow tests to run offline, by preventing API server from attempting to
5+
// use default route to determine its --advertise-address
6+
"--advertise-address=127.0.0.1",
47
"--etcd-servers={{ if .EtcdURL }}{{ .EtcdURL.String }}{{ end }}",
58
"--cert-dir={{ .CertDir }}",
69
"--insecure-port={{ if .URL }}{{ .URL.Port }}{{ end }}",
710
"--insecure-bind-address={{ if .URL }}{{ .URL.Hostname }}{{ end }}",
811
"--secure-port={{ if .SecurePort }}{{ .SecurePort }}{{ end }}",
12+
"--admission-control=AlwaysAdmit",
13+
"--service-cluster-ip-range=10.0.0.0/24",
14+
"--allow-privileged=true",
915
}
1016

1117
func DoAPIServerArgDefaulting(args []string) []string {

0 commit comments

Comments
 (0)