1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-25 20:59:28 +01:00

WIP: improving helm setup

This commit is contained in:
Lucas Severo Alves
2022-06-14 15:59:10 +02:00
parent 84c8d1ca03
commit 45e1cdbd01
5 changed files with 77 additions and 6 deletions

5
.github/ci/ct.yaml vendored Normal file
View File

@@ -0,0 +1,5 @@
chart-dirs:
- ./charts
helm-extra-args: "--timeout=5m"
check-version-increment: false
target-branch: master

44
.github/workflows/helm.yaml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Helm
on:
push:
branches:
- master
- release-*
paths:
- 'charts/**'
pull_request:
paths:
- 'charts/**'
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v2.1
with:
version: v3.4.2
- uses: actions/setup-python@v3.1.2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config=.github/ci/ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config=.github/ci/ct.yaml

3
.gitignore vendored
View File

@@ -4,4 +4,5 @@ vendordiff.patch
.idea/
*.code-workspace
.vscode/
kind
kind
bin/

View File

@@ -135,13 +135,18 @@ ifndef HAS_GOLANGCI
endif
./_output/bin/golangci-lint run
lint-chart: ensure-helm-install
helm lint ./charts/descheduler
test-helm: ensure-helm-install
./test/run-helm-tests.sh
# helm
ensure-helm-install:
ifndef HAS_HELM
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && chmod 700 ./get_helm.sh && ./get_helm.sh
endif
lint-chart: ensure-helm-install
helm lint ./charts/descheduler
build-helm:
helm package ./charts/descheduler --dependency-update --destination ./bin/chart
test-helm: ensure-helm-install
./test/run-helm-tests.sh

View File

@@ -52,5 +52,21 @@ The helm tests runs as part of descheduler CI. But, to run it manually from the
make test-helm
```
## Build Helm Package locally
If you made some changes in the chart, and just want to check if templating is ok, or if the chart is buildable, you can run this command to have a package built from the `./charts` directory.
```
make build-helm
```
## Lint Helm Chart locally
To check linting of your changes in the helm chart locally you can run:
```
make lint-helm
```
### Miscellaneous
See the [hack directory](https://github.com/kubernetes-sigs/descheduler/tree/master/hack) for additional tools and scripts used for developing the descheduler.