Skip to content

Commit

Permalink
Merge pull request #26 from consideRatio/pr/fix-helm-warning
Browse files Browse the repository at this point in the history
fix: restrict kubeconfig permissions to current user to avoid helm's warnings
  • Loading branch information
consideRatio authored Jan 15, 2021
2 parents 688fd03 + a8cc397 commit abf1ec6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test_k3s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ jobs:
helm version
helm list
if helm version 2>&1 | grep WARNING > /dev/null; then
echo "helm is expected to run without a WARNING!"
exit 1
fi
- name: Install network policies test
run: helm install test-calico ./test-calico --wait

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ runs:
${{ inputs.extra-setup-args }}
shell: bash

# By providing a kubeconfig owned by the current user with 600 permissions,
# kubectl becomes usable without sudo, and helm won't emit warnings about
# bloated access to group/world.
- name: Prepare a kubeconfig in ~/.kube/config
run: |
mkdir -p ~/.kube
sudo cat /etc/rancher/k3s/k3s.yaml > "$HOME/.kube/config"
chmod 600 "$HOME/.kube/config"
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
shell: bash

Expand Down

0 comments on commit abf1ec6

Please sign in to comment.