Skip to content

Commit

Permalink
Helm 3 support (#13)
Browse files Browse the repository at this point in the history
* change to helm3
    add few options (edit values from revision, write user cofigured values only if different from default)
    fall back to previous version by default if helm2 is used

* fix circleci
remove rbac (no more tiller)

* bad sum

* fix install.sh
  • Loading branch information
nirroz93 authored May 21, 2020
1 parent 45bf676 commit 598de74
Show file tree
Hide file tree
Showing 11 changed files with 728 additions and 464 deletions.
46 changes: 21 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@
defaults: &defaults
working_directory: /go/src/github.com/mstrzele/helm-edit
docker:
- image: circleci/golang:1.12
- image: circleci/golang:1.14

version: 2
jobs:
lint:
<<: *defaults
steps:
- checkout
- run: dep ensure
- run: go mod download
- persist_to_workspace:
root: vendor
root: /go/pkg
paths:
- "*"

- run: go install
- run:
name: Installing gometalinter
command: |
go get -u github.com/alecthomas/gometalinter
gometalinter --install
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.26.0
- run:
name: Running gometalinter
command: gometalinter --deadline=5m --errors
command: ./bin/golangci-lint run

build:
<<: *defaults
Expand All @@ -34,10 +33,9 @@ jobs:
command: go get github.com/mitchellh/gox
- checkout
- attach_workspace:
at: vendor
at: /go/pkg
- run: >
gox -osarch "darwin/amd64 linux/amd64"
-output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
gox -osarch "darwin/amd64 linux/amd64" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
- persist_to_workspace:
root: dist
paths:
Expand All @@ -55,35 +53,33 @@ jobs:
- run: docker info

- run: |
wget -O kind https://github.com/kubernetes-sigs/kind/releases/download/v0.3.0/kind-linux-amd64
wget -O kind https://github.com/kubernetes-sigs/kind/releases/download/v0.8.1/kind-linux-amd64
chmod +x kind
- run: kind create cluster --image kindest/node:v1.14.2
- run: kind create cluster --image kindest/node:v1.18.2
- run: |
echo 'export KUBECONFIG="$(kind get kubeconfig-path)"' >> $BASH_ENV
- run: |
wget -O kubectl https://storage.googleapis.com/kubernetes-release/release/v1.14.2/bin/linux/amd64/kubectl
wget -O kubectl https://storage.googleapis.com/kubernetes-release/release/v1.18.2/bin/linux/amd64/kubectl
chmod +x kubectl
- run: kubectl version

- run: |
wget https://get.helm.sh/helm-v2.14.1-linux-amd64.tar.gz
tar -xzf helm-v2.14.1-linux-amd64.tar.gz --strip-components 1 linux-amd64/helm
- run: |
kubectl apply -f test/rbac-config.yaml
helm init --service-account tiller --wait
wget https://get.helm.sh/helm-v3.2.1-linux-amd64.tar.gz
tar -xzf helm-v3.2.1-linux-amd64.tar.gz --strip-components 1 linux-amd64/helm
- run: helm version

- attach_workspace:
at: dist
- run: |
mkdir $HOME/.helm/plugins/helm-edit
cp plugin.yaml $HOME/.helm/plugins/helm-edit/
cp dist/helm-edit_linux_amd64 $HOME/.helm/plugins/helm-edit/helm-edit
mkdir -p $HOME/.local/share/helm/plugins/helm-edit
cp plugin.yaml $HOME/.local/share/helm/plugins/helm-edit/
cp dist/helm-edit_linux_amd64 $HOME/.local/share/helm/plugins/helm-edit/helm-edit
- run:
command: |
helm upgrade foo ./foo -i
diff -B <(helm get values -a foo) <(helm edit -a -e /bin/cat foo)
diff -B <(helm get values -a foo | grep -v COMPUTED) <(helm edit -a -e /bin/cat foo |grep -v "Edit cancelled")
helm edit -e "/bin/sed -e s/null/cc:/ -i" foo
diff -B <(helm get values foo | grep -v USER) <(echo "cc: null")
working_directory: test

deploy:
Expand All @@ -97,8 +93,8 @@ jobs:
at: dist
- deploy:
command: >
ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME
-r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/
ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags`
dist/
workflows:
version: 2
Expand Down
Loading

0 comments on commit 598de74

Please sign in to comment.