mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
WIP: improving helm setup
This commit is contained in:
5
.github/ci/ct.yaml
vendored
Normal file
5
.github/ci/ct.yaml
vendored
Normal 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
44
.github/workflows/helm.yaml
vendored
Normal 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
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ vendordiff.patch
|
|||||||
*.code-workspace
|
*.code-workspace
|
||||||
.vscode/
|
.vscode/
|
||||||
kind
|
kind
|
||||||
|
bin/
|
||||||
15
Makefile
15
Makefile
@@ -135,13 +135,18 @@ ifndef HAS_GOLANGCI
|
|||||||
endif
|
endif
|
||||||
./_output/bin/golangci-lint run
|
./_output/bin/golangci-lint run
|
||||||
|
|
||||||
lint-chart: ensure-helm-install
|
# helm
|
||||||
helm lint ./charts/descheduler
|
|
||||||
|
|
||||||
test-helm: ensure-helm-install
|
|
||||||
./test/run-helm-tests.sh
|
|
||||||
|
|
||||||
ensure-helm-install:
|
ensure-helm-install:
|
||||||
ifndef HAS_HELM
|
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
|
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
|
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
|
||||||
|
|||||||
@@ -52,5 +52,21 @@ The helm tests runs as part of descheduler CI. But, to run it manually from the
|
|||||||
make test-helm
|
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
|
### Miscellaneous
|
||||||
See the [hack directory](https://github.com/kubernetes-sigs/descheduler/tree/master/hack) for additional tools and scripts used for developing the descheduler.
|
See the [hack directory](https://github.com/kubernetes-sigs/descheduler/tree/master/hack) for additional tools and scripts used for developing the descheduler.
|
||||||
|
|||||||
Reference in New Issue
Block a user