Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

[7.0.x] Add Helm 3 binary #2345

Merged
merged 4 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions lib/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
12 changes: 12 additions & 0 deletions lib/update/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down