mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Merge pull request #103536 from mengjiao-liu/clean-master-term-test
Clean up the remaining master names in test/integration
This commit is contained in:
commit
1edf50192e
@ -551,7 +551,7 @@ func TestMultiAPIServerNodePortAllocation(t *testing.T) {
|
|||||||
|
|
||||||
// create 2 api servers and 2 clients
|
// create 2 api servers and 2 clients
|
||||||
for i := 0; i < 2; i++ {
|
for i := 0; i < 2; i++ {
|
||||||
// start master count api server
|
// start count api server
|
||||||
t.Logf("starting api server: %d", i)
|
t.Logf("starting api server: %d", i)
|
||||||
server := kubeapiservertesting.StartTestServerOrDie(t, instanceOptions, []string{
|
server := kubeapiservertesting.StartTestServerOrDie(t, instanceOptions, []string{
|
||||||
"--advertise-address", fmt.Sprintf("10.0.1.%v", i+1),
|
"--advertise-address", fmt.Sprintf("10.0.1.%v", i+1),
|
||||||
|
@ -62,7 +62,7 @@ AwEHoUQDQgAEH6cuzP8XuD5wal6wf9M6xDljTOPLX2i8uIp/C/ASqiIGUeeKQtX0
|
|||||||
-----END EC PRIVATE KEY-----`
|
-----END EC PRIVATE KEY-----`
|
||||||
|
|
||||||
// StartRealAPIServerOrDie starts an API server that is appropriate for use in tests that require one of every resource
|
// StartRealAPIServerOrDie starts an API server that is appropriate for use in tests that require one of every resource
|
||||||
func StartRealAPIServerOrDie(t *testing.T, configFuncs ...func(*options.ServerRunOptions)) *Master {
|
func StartRealAPIServerOrDie(t *testing.T, configFuncs ...func(*options.ServerRunOptions)) *APIServer {
|
||||||
certDir, err := ioutil.TempDir("", t.Name())
|
certDir, err := ioutil.TempDir("", t.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -125,7 +125,7 @@ func StartRealAPIServerOrDie(t *testing.T, configFuncs ...func(*options.ServerRu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// then build and use an etcd lock
|
// then build and use an etcd lock
|
||||||
// this prevents more than one of these masters from running at the same time
|
// this prevents more than one of these api servers from running at the same time
|
||||||
lock := concurrency.NewLocker(session, "kube_integration_etcd_raw")
|
lock := concurrency.NewLocker(session, "kube_integration_etcd_raw")
|
||||||
lock.Lock()
|
lock.Lock()
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ func StartRealAPIServerOrDie(t *testing.T, configFuncs ...func(*options.ServerRu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &Master{
|
return &APIServer{
|
||||||
Client: kubeClient,
|
Client: kubeClient,
|
||||||
Dynamic: dynamic.NewForConfigOrDie(kubeClientConfig),
|
Dynamic: dynamic.NewForConfigOrDie(kubeClientConfig),
|
||||||
Config: kubeClientConfig,
|
Config: kubeClientConfig,
|
||||||
@ -228,9 +228,9 @@ func StartRealAPIServerOrDie(t *testing.T, configFuncs ...func(*options.ServerRu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Master represents a running API server that is ready for use
|
// APIServer represents a running API server that is ready for use
|
||||||
// The Cleanup func must be deferred to prevent resource leaks
|
// The Cleanup func must be deferred to prevent resource leaks
|
||||||
type Master struct {
|
type APIServer struct {
|
||||||
Client clientset.Interface
|
Client clientset.Interface
|
||||||
Dynamic dynamic.Interface
|
Dynamic dynamic.Interface
|
||||||
Config *restclient.Config
|
Config *restclient.Config
|
||||||
|
Loading…
Reference in New Issue
Block a user