Add a check in ConfirmUsable() to validate the contextName
This commit is contained in:
@@ -49,12 +49,13 @@ func TestKubectlValidation(t *testing.T) {
|
||||
// Enable swagger api on master.
|
||||
components.KubeMaster.InstallSwaggerAPI()
|
||||
cluster := clientcmdapi.NewCluster()
|
||||
|
||||
cluster.Server = components.ApiServer.URL
|
||||
cluster.InsecureSkipTLSVerify = true
|
||||
cfg.Contexts = map[string]*clientcmdapi.Context{"test": ctx}
|
||||
cfg.CurrentContext = "test"
|
||||
overrides := clientcmd.ConfigOverrides{
|
||||
ClusterInfo: *cluster,
|
||||
Context: *ctx,
|
||||
CurrentContext: "test",
|
||||
ClusterInfo: *cluster,
|
||||
}
|
||||
cmdConfig := clientcmd.NewNonInteractiveClientConfig(*cfg, "test", &overrides, nil)
|
||||
factory := util.NewFactory(cmdConfig)
|
||||
|
Reference in New Issue
Block a user