From 9ac03305c10029f35077cf9df19755bfbfdaeec6 Mon Sep 17 00:00:00 2001 From: Jim Date: Thu, 17 Jan 2019 15:29:59 -0600 Subject: [PATCH] Mexregsecret aks fix (#27) * fix mexregsecret for aks/gcp. Also add Fairview to vault and change hawkins key * add fairview openrc * fix return for error if secret create fails --- mexos/azure.go | 2 +- mexos/gcloud.go | 5 ++--- mexos/kubectl.go | 5 +++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mexos/azure.go b/mexos/azure.go index c1981a38d..68c49920d 100644 --- a/mexos/azure.go +++ b/mexos/azure.go @@ -32,5 +32,5 @@ func azureCreateAKS(mf *Manifest) error { return fmt.Errorf("can't copy %s, %v", defaultKubeconfig(), err) } log.DebugLog(log.DebugLevelMexos, "created aks", "name", mf.Spec.Key) - return nil + return CreateDockerRegistrySecret(mf) } diff --git a/mexos/gcloud.go b/mexos/gcloud.go index b8a6e07af..7cf93dce8 100644 --- a/mexos/gcloud.go +++ b/mexos/gcloud.go @@ -38,7 +38,6 @@ func gcloudCreateGKE(mf *Manifest) error { if err = copyFile(defaultKubeconfig(), kconf); err != nil { return fmt.Errorf("can't copy %s, %v", defaultKubeconfig(), err) } - log.DebugLog(log. - DebugLevelMexos, "created gke", "name", mf.Spec.Key) - return nil + log.DebugLog(log.DebugLevelMexos, "created gke", "name", mf.Spec.Key) + return CreateDockerRegistrySecret(mf) } diff --git a/mexos/kubectl.go b/mexos/kubectl.go index 3978f5abc..c0a5338f3 100644 --- a/mexos/kubectl.go +++ b/mexos/kubectl.go @@ -26,8 +26,9 @@ func CreateDockerRegistrySecret(mf *Manifest) error { var out string log.DebugLog(log.DebugLevelMexos, "CreateDockerRegistrySecret", "mf", mf) - if IsLocalDIND(mf) { - log.DebugLog(log.DebugLevelMexos, "CreateDockerRegistrySecret locally for DIND") + + if IsLocalDIND(mf) || mf.Metadata.Operator == "gcp" || mf.Metadata.Operator == "azure" { + log.DebugLog(log.DebugLevelMexos, "CreateDockerRegistrySecret locally non OpenStack case") var o []byte o, err = sh.Command("kubectl", "create", "secret", "docker-registry", "mexregistrysecret", "--docker-server="+mf.Values.Registry.Docker, "--docker-username=mobiledgex", "--docker-password="+mexEnv(mf, "MEX_DOCKER_REG_PASS"), "--docker-email=mobiledgex@mobiledgex.com").CombinedOutput() out = string(o)