diff --git a/cmd/upgrade.go b/cmd/upgrade.go index 7f90ff3a..93399364 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -43,6 +43,7 @@ type diffCmd struct { enableDNS bool SkipSchemaValidation bool namespace string // namespace to assume the release to be installed into. Defaults to the current kube config namespace. + storageNamespace string // namespace where helm release metadata is stored, when different from the deployment namespace. valueFiles valueFiles values []string stringValues []string @@ -115,7 +116,11 @@ perform. func newChartCommand() *cobra.Command { diff := diffCmd{ - namespace: os.Getenv("HELM_NAMESPACE"), + namespace: os.Getenv("HELM_NAMESPACE"), + storageNamespace: os.Getenv("HELM_STORAGE_NAMESPACE"), + } + if len(diff.storageNamespace) == 0 { + diff.storageNamespace = diff.namespace } unknownFlags := os.Getenv("HELM_DIFF_IGNORE_UNKNOWN_FLAGS") == envTrue @@ -271,7 +276,7 @@ func (d *diffCmd) runHelm3() error { } if d.clusterAccessAllowed() { - releaseManifest, err = getRelease(d.release, d.namespace, d.kubeContext) + releaseManifest, err = getRelease(d.release, d.storageNamespace, d.kubeContext) } var newInstall bool @@ -297,7 +302,7 @@ func (d *diffCmd) runHelm3() error { if d.threeWayMerge || d.takeOwnership { actionConfig = new(action.Configuration) localEnv := prepareEnvSettings(d.kubeContext) - if err := actionConfig.Init(localEnv.RESTClientGetter(), localEnv.Namespace(), os.Getenv("HELM_DRIVER")); err != nil { + if err := actionConfig.Init(localEnv.RESTClientGetter(), d.storageNamespace, os.Getenv("HELM_DRIVER")); err != nil { log.Fatalf("%+v", err) } if err := actionConfig.KubeClient.IsReachable(); err != nil { @@ -315,7 +320,7 @@ func (d *diffCmd) runHelm3() error { currentSpecs := make(map[string]*manifest.MappingResult) if !newInstall && d.clusterAccessAllowed() { if !d.noHooks && !d.threeWayMerge { - hooks, err := getHooks(d.release, d.namespace, d.kubeContext) + hooks, err := getHooks(d.release, d.storageNamespace, d.kubeContext) if err != nil { return err } diff --git a/install-binary.ps1 b/install-binary.ps1 index 90e92261..c7901937 100644 --- a/install-binary.ps1 +++ b/install-binary.ps1 @@ -33,9 +33,9 @@ function New-TemporaryDirectory { function Get-Url { param ([Parameter(Mandatory=$true)][string] $Version, [Parameter(Mandatory=$true)][string] $Architecture) if ($Version -eq "latest") { - return "https://github.com/databus23/helm-diff/releases/latest/download/helm-diff-windows-${Architecture}.tgz" + return "https://github.com/topfreegames/helm-diff/releases/latest/download/helm-diff-windows-${Architecture}.tgz" } - return "https://github.com/databus23/helm-diff/releases/download/${Version}/helm-diff-windows-${Architecture}.tgz" + return "https://github.com/topfreegames/helm-diff/releases/download/${Version}/helm-diff-windows-${Architecture}.tgz" } function Download-Plugin { diff --git a/install-binary.sh b/install-binary.sh index 3cbbc6e4..6e2a5b35 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -3,7 +3,7 @@ # Shamelessly copied from https://github.com/technosophos/helm-template PROJECT_NAME="helm-diff" -PROJECT_GH="databus23/$PROJECT_NAME" +PROJECT_GH="topfreegames/$PROJECT_NAME" export GREP_COLOR="never" # Convert HELM_BIN and HELM_PLUGIN_DIR to unix if cygpath is diff --git a/plugin.yaml b/plugin.yaml index dd413ce1..c9c0176d 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,7 +1,7 @@ name: diff # Version is the version of Helm plus the number of official builds for this # plugin -version: "3.15.6" +version: "3.15.6-1" usage: "Preview helm upgrade changes as a diff" description: "Preview helm upgrade changes as a diff" useTunnel: true