From 35fd5ff1171479388b3971990c0f8630d36bb996 Mon Sep 17 00:00:00 2001 From: KUOKA Yusuke Date: Thu, 14 Feb 2019 18:13:32 +0900 Subject: [PATCH] fix: remote file provided to `set.file` should not break helmfile (#474) Fixes #473 --- Makefile | 4 ++++ state/state.go | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a4a53fd1..7517e3f9 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,10 @@ static-linux: env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "dist/helmfile_linux_amd64" -ldflags '-X main.Version=${TAG}' ${TARGETS} .PHONY: linux +install: + env CGO_ENABLED=0 go install -ldflags '-X main.Version=${TAG}' ${TARGETS} +.PHONY: install + clean: rm dist/helmfile_* .PHONY: clean diff --git a/state/state.go b/state/state.go index 1fbd30d3..8a2fddf5 100644 --- a/state/state.go +++ b/state/state.go @@ -23,6 +23,7 @@ import ( "github.com/roboll/helmfile/tmpl" "go.uber.org/zap" "gopkg.in/yaml.v2" + "net/url" ) // HelmState structure for the helmfile @@ -857,7 +858,8 @@ func (st *HelmState) JoinBase(relPath string) string { // normalizes relative path to absolute one func (st *HelmState) normalizePath(path string) string { - if filepath.IsAbs(path) { + u, _ := url.Parse(path) + if u.Scheme != "" || filepath.IsAbs(path) { return path } else { return st.JoinBase(path)