From 0f9923cd0b20c6d52f9876a30e101461dea4262e Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Mon, 9 Nov 2020 23:21:31 +0700 Subject: [PATCH 1/3] [7.0.x] Backport 'Add Helm 3 binary' (#2303) * Create symlink on host for Helm 3 * Fix variable * Set helm 3 binary path on host * Bump planet tag --- lib/defaults/defaults.go | 11 +++++++++++ lib/update/system/system.go | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/lib/defaults/defaults.go b/lib/defaults/defaults.go index ae031a8938..20d1aa004c 100644 --- a/lib/defaults/defaults.go +++ b/lib/defaults/defaults.go @@ -350,6 +350,17 @@ const ( // systems where /usr/bin is not writable HelmBinAlternate = "/writable/bin/helm" + // Helm3Bin is the location of helm 3 binary inside planet + Helm3Bin = "/usr/bin/helm3" + + // Helm3Script is the location of the helm 3 script, which the host's helm + // is symlinked to, inside the planet + Helm3Script = "/usr/local/bin/helm3" + + // Helm3BinAlternate is the alternative location of helm 3 symlink on + // systems where /usr/bin is not writable + Helm3BinAlternate = "/writable/bin/helm3" + // PlanetBin is the default location of planet binary PlanetBin = "/usr/bin/planet" diff --git a/lib/update/system/system.go b/lib/update/system/system.go index 02c01c104c..cf2b61c654 100644 --- a/lib/update/system/system.go +++ b/lib/update/system/system.go @@ -713,6 +713,18 @@ func updateSymlinks(planetPath string, logger log.Logger) (err error) { "Failed to update helm symlink.") } + // update helm3 symlink + helmPath = filepath.Join(planetPath, constants.PlanetRootfs, defaults.Helm3Script) + for _, path := range []string{defaults.Helm3Bin, defaults.Helm3BinAlternate} { + out, err = exec.Command("ln", "-sfT", helmPath, path).CombinedOutput() + if err == nil { + logger.Infof("Updated helm 3 symlink: %v -> %v.", path, helmPath) + break + } + logger.WithError(err).WithField("output", string(out)).Warn( + "Failed to update helm 3 symlink.") + } + // update kube config environment variable kubeConfigPath := filepath.Join(planetPath, constants.PlanetRootfs, defaults.PlanetKubeConfigPath) environment, err := utils.ReadEnv(defaults.EnvironmentPath) From 4438bc7a036dccd513d7312290e89f5f2a79fe04 Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Sat, 21 Nov 2020 11:24:37 +0700 Subject: [PATCH 2/3] Change planet tag and branch for testing --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 78b33f3271..3f8cd13b96 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ RELEASE_OUT ?= TELEPORT_TAG = 3.2.16 # TELEPORT_REPOTAG adapts TELEPORT_TAG to the teleport tagging scheme TELEPORT_REPOTAG := v$(TELEPORT_TAG) -PLANET_TAG := 7.0.53-$(K8S_VER_SUFFIX) -PLANET_BRANCH := $(PLANET_TAG) +PLANET_TAG := 7.0.54-$(K8S_VER_SUFFIX) +PLANET_BRANCH := sergei/70x/helm3 K8S_APP_TAG := $(GRAVITY_TAG) TELEKUBE_APP_TAG := $(GRAVITY_TAG) WORMHOLE_APP_TAG := $(GRAVITY_TAG) From 7a29fe8213f1d8b1ac90e194bd20cdc393e07eca Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Thu, 26 Nov 2020 20:01:08 +0700 Subject: [PATCH 3/3] Change planet branch to default --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3f8cd13b96..710f176cf4 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ TELEPORT_TAG = 3.2.16 # TELEPORT_REPOTAG adapts TELEPORT_TAG to the teleport tagging scheme TELEPORT_REPOTAG := v$(TELEPORT_TAG) PLANET_TAG := 7.0.54-$(K8S_VER_SUFFIX) -PLANET_BRANCH := sergei/70x/helm3 +PLANET_BRANCH := $(PLANET_TAG) K8S_APP_TAG := $(GRAVITY_TAG) TELEKUBE_APP_TAG := $(GRAVITY_TAG) WORMHOLE_APP_TAG := $(GRAVITY_TAG)