From a9f6c9e944a5827f505583add82aa451e942be29 Mon Sep 17 00:00:00 2001 From: Cesar Wong Date: Wed, 5 Apr 2017 15:25:45 -0400 Subject: [PATCH] cluster up: use routing suffix for router certificate hostnames --- pkg/bootstrap/docker/openshift/admin.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/bootstrap/docker/openshift/admin.go b/pkg/bootstrap/docker/openshift/admin.go index 8a1ea8ca635f..38dfe17976ab 100644 --- a/pkg/bootstrap/docker/openshift/admin.go +++ b/pkg/bootstrap/docker/openshift/admin.go @@ -110,6 +110,11 @@ func (h *Helper) InstallRouter(kubeClient kclientset.Interface, f *clientcmd.Fac return errors.NewError("cannot update privileged SCC").WithCause(err).WithDetails(h.OriginLog()) } + routingSuffix := h.routingSuffix + if len(routingSuffix) == 0 { + routingSuffix = fmt.Sprintf("%s.nip.io", hostIP) + } + // Create router cert cmdOutput := &bytes.Buffer{} createCertOptions := &admin.CreateServerCertOptions{ @@ -120,10 +125,10 @@ func (h *Helper) InstallRouter(kubeClient kclientset.Interface, f *clientcmd.Fac }, Overwrite: true, Hostnames: []string{ - fmt.Sprintf("%s.nip.io", hostIP), + routingSuffix, // This will ensure that routes using edge termination and the default // certs will use certs valid for their arbitrary subdomain names. - fmt.Sprintf("*.%s.nip.io", hostIP), + fmt.Sprintf("*.%s", routingSuffix), }, CertFile: filepath.Join(masterDir, "router.crt"), KeyFile: filepath.Join(masterDir, "router.key"),