Skip to content

Commit

Permalink
feat: lint/test charts (#64)
Browse files Browse the repository at this point in the history
* feat: lint/test charts

* use grpc_health_probe instead of wget

* bump chart version
  • Loading branch information
jpadilla authored Oct 9, 2023
1 parent cc00a6a commit f49e95a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Lint and Test Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1

- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Add Helm Repositories
if: steps.list-changed.outputs.changed == 'true'
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add openfga https://openfga.github.io/helm-charts
helm repo update
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: |
ct lint --target-branch ${{ github.event.repository.default_branch }} \
--validate-maintainers=false \
--check-version-increment=false
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
2 changes: 1 addition & 1 deletion charts/openfga/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: openfga
description: A Kubernetes Helm chart for the OpenFGA project.

type: application
version: 0.1.28
version: 0.1.29
appVersion: "v1.3.3"

home: "https://openfga.github.io/helm-charts/charts/openfga"
Expand Down
12 changes: 8 additions & 4 deletions charts/openfga/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ metadata:
annotations:
"helm.sh/hook": test
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "openfga.fullname" . }}:{{ .Values.service.port }}']
- name: grpc-health-probe
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["grpc_health_probe", '-addr={{ include "openfga.fullname" . }}:{{ (split ":" .Values.grpc.addr)._1 }}']
restartPolicy: Never

0 comments on commit f49e95a

Please sign in to comment.