Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(charttest): enable charts explicitly for PR charttests #389

Merged
merged 21 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ct.yaml → .github/configs/helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ chart-dirs:
- kube-monitoring
- kubeconfig-generator
- service-proxy/charts/1.0.0
- logshipper
chart-repos:
- cert-manager=https://charts.jetstack.io
- alerts=https://prometheus-community.github.io/helm-charts
- kube-monitoring=https://prometheus-community.github.io/helm-charts
- logshipper=https://fluent.github.io/helm-charts
18 changes: 18 additions & 0 deletions .github/configs/helm-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: main
validate-maintainers: false
check-version-increment: false
chart-dirs:
- alerts
- kube-monitoring
- plutono
- thanos
- opentelemetry
chart-repos:
- cert-manager=https://charts.jetstack.io
- alerts=https://prometheus-community.github.io/helm-charts
- kube-monitoring=https://prometheus-community.github.io/helm-charts
26 changes: 17 additions & 9 deletions .github/workflows/helm-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,43 @@ jobs:
check-latest: true
token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Run chart-testing (list-changed)
- name: Run chart-linting (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml --target-branch ${{ github.event.repository.default_branch }})
changed=$(ct list-changed --config .github/configs/helm-lint.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Run chart-testing (lint)
- name: Run chart-linting
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
run: ct lint --config .github/configs/helm-lint.yaml --target-branch ${{ github.event.repository.default_branch }}

- name: Run chart-testing (list-changed)
id: chart-test-list-changed
run: |
changed=$(ct list-changed --config .github/configs/helm-test.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
if: steps.chart-test-list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart integration tests
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml
if: steps.chart-test-list-changed.outputs.changed == 'true'
run: ct install --config .github/configs/helm-test.yaml

- name: Check version bump
id: check-bump
if: steps.list-changed.outputs.changed == 'true'
continue-on-error: true
run: |
for chart in $(ct list-changed --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}); do
for chart in $(ct list-changed --config .github/configs/helm-lint.yaml --target-branch ${{ github.event.repository.default_branch }}); do
chart_version=$(yq .version "$chart/Chart.yaml")
if helm pull "oci://${{ env.REGISTRY }}/${{ github.repository }}/charts/$(dirname $chart)" --version $chart_version; then
echo "chart=$(dirname $chart)" >> "$GITHUB_OUTPUT"
Expand Down
2 changes: 1 addition & 1 deletion logshipper/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: logshipper
description: A Helm chart for deploying fluent-bit with custom config

type: application
version: 0.2.2
version: 0.2.3
appVersion: 3.0.4

dependencies:
Expand Down
2 changes: 1 addition & 1 deletion logshipper/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fluent-bit:
podAnnotations:
kubectl.kubernetes.io/default-container: "fluent-bit"
hotReload:
hotReload:
enabled: true
existingConfigMap: "fluent-bit-config"
updateStrategy:
Expand Down
4 changes: 2 additions & 2 deletions logshipper/plugindefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ kind: PluginDefinition
metadata:
name: logshipper
spec:
version: 0.2.2
version: 0.2.3
displayName: Fluent-bit Logshipper
description: Logshipping of container logs and systemd with fluent-bit
icon: https://raw.githubusercontent.com/fluent/fluent-bit/master/fluentbit_logo.png
helmChart:
name: logshipper
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
version: 0.2.2
version: 0.2.3
options:
- name: fluent-bit.parser
description: Parser used for container logs. [docker|cri]
Expand Down
Loading