mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
add testmain setup func to the integration framework
This commit is contained in:
@@ -70,7 +70,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubectl"
|
||||
kubeletclient "k8s.io/kubernetes/pkg/kubelet/client"
|
||||
"k8s.io/kubernetes/pkg/master"
|
||||
"k8s.io/kubernetes/pkg/util/env"
|
||||
"k8s.io/kubernetes/pkg/version"
|
||||
"k8s.io/kubernetes/plugin/pkg/admission/admit"
|
||||
)
|
||||
@@ -298,20 +297,13 @@ func parseCIDROrDie(cidr string) *net.IPNet {
|
||||
return parsed
|
||||
}
|
||||
|
||||
// return the EtcdURL
|
||||
func GetEtcdURLFromEnv() string {
|
||||
url := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
|
||||
glog.V(4).Infof("Using KUBE_INTEGRATION_ETCD_URL=%q", url)
|
||||
return url
|
||||
}
|
||||
|
||||
// Returns a basic master config.
|
||||
func NewMasterConfig() *master.Config {
|
||||
// This causes the integration tests to exercise the etcd
|
||||
// prefix code, so please don't change without ensuring
|
||||
// sufficient coverage in other ways.
|
||||
etcdOptions := options.NewEtcdOptions(storagebackend.NewDefaultConfig(uuid.New(), api.Scheme, nil))
|
||||
etcdOptions.StorageConfig.ServerList = []string{GetEtcdURLFromEnv()}
|
||||
etcdOptions.StorageConfig.ServerList = []string{GetEtcdURL()}
|
||||
|
||||
info, _ := runtime.SerializerInfoForMediaType(api.Codecs.SupportedMediaTypes(), runtime.ContentTypeJSON)
|
||||
ns := NewSingleContentTypeSerializer(api.Scheme, info)
|
||||
|
||||
Reference in New Issue
Block a user