normalize server url before writing to config
@@ -15,6 +15,7 @@ import (
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/cert"
+ "github.com/openshift/origin/pkg/cmd/cli/config"
cliconfig "github.com/openshift/origin/pkg/cmd/cli/config"
"github.com/openshift/origin/pkg/cmd/server/crypto"
"github.com/openshift/origin/pkg/cmd/templates"
@@ -176,6 +177,12 @@ func (o CreateKubeConfigOptions) CreateKubeConfig() (*clientcmdapi.Config, error
ClientKeyData: keyData,
}
+ // normalize the provided server to a format expected by config
+ o.APIServerURL, err = config.NormalizeServerURL(o.APIServerURL)
+ if err != nil {
+ return nil, err
+ }
+
clusters := make(map[string]*clientcmdapi.Cluster)
clusters[clusterNick] = &clientcmdapi.Cluster{
Server: o.APIServerURL,
