Updating the code to fix the context name before using it as secret and cluster names

This commit is contained in:
nikhiljindal
2016-06-15 15:19:49 -07:00
parent 657a7ef6a4
commit 9026195614
4 changed files with 64 additions and 2 deletions

View File

@@ -585,6 +585,9 @@ func (kc *KubeConfig) findCluster(name string) *KubeCluster {
}
type E2EContext struct {
// Raw context name,
RawName string `yaml:"rawName"`
// A valid dns subdomain which can be used as the name of kubernetes resources.
Name string `yaml:"name"`
Cluster *KubeCluster `yaml:"cluster"`
User *KubeUser `yaml:"user"`
@@ -615,8 +618,13 @@ func (f *Framework) GetUnderlyingFederatedContexts() []E2EContext {
Failf("Could not find cluster for context %+v", context)
}
dnsSubdomainName, err := GetValidDNSSubdomainName(context.Name)
if err != nil {
Failf("Could not convert context name %s to a valid dns subdomain name, error: %s", context.Name, err)
}
e2eContexts = append(e2eContexts, E2EContext{
Name: context.Name,
RawName: context.Name,
Name: dnsSubdomainName,
Cluster: cluster,
User: user,
})