mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 08:37:03 +02:00
feat(common): Release common library 3.7.1 (#383)
Co-authored-by: Aisling McGinn <me@aisling.dev>
This commit is contained in:
parent
c94a28baa3
commit
433f6d132b
146 changed files with 232 additions and 222 deletions
|
@ -1,11 +1,7 @@
|
||||||
---
|
---
|
||||||
excluded-charts-lint:
|
excluded-charts-lint: []
|
||||||
- library/common-test
|
|
||||||
|
|
||||||
excluded-charts-install:
|
excluded-charts-install:
|
||||||
- apps/k8s-ycl
|
|
||||||
- library/common
|
|
||||||
- other/app-template
|
- other/app-template
|
||||||
|
|
||||||
excluded-charts-release:
|
excluded-charts-release: []
|
||||||
- library/common-test
|
|
||||||
|
|
2
.github/actions/charts-package/action.yaml
vendored
2
.github/actions/charts-package/action.yaml
vendored
|
@ -29,7 +29,7 @@ runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||||
with:
|
with:
|
||||||
setup-tools: |
|
setup-tools: |
|
||||||
helmv3
|
helmv3
|
||||||
|
|
|
@ -29,7 +29,7 @@ runs:
|
||||||
uses: sigstore/cosign-installer@v3.6.0
|
uses: sigstore/cosign-installer@v3.6.0
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||||
with:
|
with:
|
||||||
setup-tools: |
|
setup-tools: |
|
||||||
helmv3
|
helmv3
|
||||||
|
|
35
.github/actions/override-chart-deps/action.yaml
vendored
35
.github/actions/override-chart-deps/action.yaml
vendored
|
@ -1,35 +0,0 @@
|
||||||
name: "Override chart dependencies"
|
|
||||||
description: "Overrides the dependencies for a Helm chart"
|
|
||||||
inputs:
|
|
||||||
chart:
|
|
||||||
required: true
|
|
||||||
description: "Which chart to override the dependencies for"
|
|
||||||
overrides:
|
|
||||||
required: true
|
|
||||||
description: "A JSON encoded list of dependency overrides"
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Override dependencies
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
overrides=( $(yq --null-input e -o=j -I=0 '${{ inputs.overrides }}[]' ) )
|
|
||||||
chartFile="charts/${{ matrix.chart }}/Chart.yaml"
|
|
||||||
|
|
||||||
if [[ ! -f ${chartFile} ]]; then
|
|
||||||
echo "Could not find ${chartFile}"!
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for override in "${overrides[@]}"; do
|
|
||||||
name=$(echo "$override" | yq e '.name' -)
|
|
||||||
repository=$(echo "$override" | yq e '.repository' -)
|
|
||||||
version=$(echo "$override" | yq e '.version' -)
|
|
||||||
|
|
||||||
yq -i "(.dependencies[] | select(.name == \"$name\").repository) |= \"$repository\"" "${chartFile}"
|
|
||||||
yq -i "(.dependencies[] | select(.name == \"$name\").version) |= \"$version\"" "${chartFile}"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Resulting chart:"
|
|
||||||
cat ${chartFile}
|
|
65
.github/workflows/charts-lint.yaml
vendored
65
.github/workflows/charts-lint.yaml
vendored
|
@ -3,75 +3,44 @@ name: "Charts: Lint"
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkoutCommit:
|
charts:
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
isRenovatePR:
|
|
||||||
required: true
|
|
||||||
default: "false"
|
|
||||||
type: string
|
|
||||||
chartsToLint:
|
|
||||||
description: >
|
description: >
|
||||||
A JSON encoded array of charts to lint
|
Json encoded list of Helm charts to release.
|
||||||
required: true
|
Defaults to releasing everything.
|
||||||
type: string
|
|
||||||
overrideDeps:
|
|
||||||
description: >
|
|
||||||
A JSON encoded array of dependencies to override before linting
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
default: "[]"
|
default: "[]"
|
||||||
|
required: true
|
||||||
env:
|
type: string
|
||||||
HELM_VERSION: 3.11.2
|
helmVersion:
|
||||||
|
description: >
|
||||||
|
Helm version to use.
|
||||||
|
default: "3.11.2"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-chart:
|
lint-chart:
|
||||||
if: ${{ inputs.chartsToLint != '[]' }}
|
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
|
||||||
name: Lint chart
|
name: Lint chart
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
chart: ${{ fromJSON(inputs.chartsToLint) }}
|
chart: ${{ fromJSON(inputs.charts) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ inputs.checkoutCommit }}
|
|
||||||
|
|
||||||
- name: Verify chart version
|
|
||||||
uses: bjw-s/helm-charts-actions/verify-chart-version@main
|
|
||||||
id: verify-chart-version
|
|
||||||
with:
|
|
||||||
chart: "charts/${{ matrix.chart }}"
|
|
||||||
|
|
||||||
- name: Verify chart changelog
|
|
||||||
uses: bjw-s/helm-charts-actions/verify-chart-changelog@main
|
|
||||||
if: inputs.isRenovatePR != 'true'
|
|
||||||
id: verify-chart-changelog
|
|
||||||
with:
|
|
||||||
chart: "charts/${{ matrix.chart }}"
|
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||||
with:
|
with:
|
||||||
setup-tools: |
|
setup-tools: |
|
||||||
helmv3
|
helmv3
|
||||||
helm: "${{ env.HELM_VERSION }}"
|
helm: "${{ inputs.helmVersion }}"
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@v2.6.1
|
uses: helm/chart-testing-action@v2.7.0
|
||||||
|
|
||||||
- name: Override chart dependencies
|
- name: Dereference JSON schema
|
||||||
uses: ./.github/actions/override-chart-deps
|
|
||||||
if: ${{ inputs.overrideDeps != '[]' }}
|
|
||||||
with:
|
|
||||||
chart: ${{ matrix.chart }}
|
|
||||||
overrides: ${{ inputs.overrideDeps }}
|
|
||||||
|
|
||||||
- name: Dereference JSON schema before packaging
|
|
||||||
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
||||||
with:
|
with:
|
||||||
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
|
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||||
|
|
21
.github/workflows/charts-release.yaml
vendored
21
.github/workflows/charts-release.yaml
vendored
|
@ -8,12 +8,13 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- rework-publishing-ci # TODO: Remove this
|
||||||
paths:
|
paths:
|
||||||
- "charts/**"
|
- "charts/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare-release:
|
prepare:
|
||||||
name: Prepare data required for release
|
name: Prepare data required for workflow
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
outputs:
|
outputs:
|
||||||
repoConfiguration: ${{ steps.repo-config.outputs.config }}
|
repoConfiguration: ${{ steps.repo-config.outputs.config }}
|
||||||
|
@ -56,8 +57,8 @@ jobs:
|
||||||
release-library-charts:
|
release-library-charts:
|
||||||
name: Release library charts
|
name: Release library charts
|
||||||
needs:
|
needs:
|
||||||
- prepare-release
|
- prepare
|
||||||
if: ${{ needs.prepare-release.outputs.libraryChartsToRelease != '[]' }}
|
if: ${{ needs.prepare.outputs.libraryChartsToRelease != '[]' }}
|
||||||
uses: ./.github/workflows/charts-release-steps.yaml
|
uses: ./.github/workflows/charts-release-steps.yaml
|
||||||
permissions:
|
permissions:
|
||||||
pages: write
|
pages: write
|
||||||
|
@ -65,17 +66,17 @@ jobs:
|
||||||
contents: write
|
contents: write
|
||||||
packages: write
|
packages: write
|
||||||
with:
|
with:
|
||||||
charts: ${{ needs.prepare-release.outputs.libraryChartsToRelease }}
|
charts: ${{ needs.prepare.outputs.libraryChartsToRelease }}
|
||||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare-release.outputs.repoConfiguration).excluded-charts-release) }}
|
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare.outputs.repoConfiguration).excluded-charts-release) }}
|
||||||
ghPagesBranch: gh-pages
|
ghPagesBranch: gh-pages
|
||||||
publishToOciRegistry: false
|
publishToOciRegistry: false
|
||||||
|
|
||||||
release-other-charts:
|
release-other-charts:
|
||||||
name: Release other charts
|
name: Release other charts
|
||||||
needs:
|
needs:
|
||||||
- prepare-release
|
- prepare
|
||||||
- release-library-charts
|
- release-library-charts
|
||||||
if: ${{ needs.prepare-release.outputs.applicationChartsToRelease != '[]' }}
|
if: ${{ needs.prepare.outputs.applicationChartsToRelease != '[]' }}
|
||||||
uses: ./.github/workflows/charts-release-steps.yaml
|
uses: ./.github/workflows/charts-release-steps.yaml
|
||||||
permissions:
|
permissions:
|
||||||
pages: write
|
pages: write
|
||||||
|
@ -83,6 +84,6 @@ jobs:
|
||||||
contents: write
|
contents: write
|
||||||
packages: write
|
packages: write
|
||||||
with:
|
with:
|
||||||
charts: ${{ needs.prepare-release.outputs.applicationChartsToRelease }}
|
charts: ${{ needs.prepare.outputs.applicationChartsToRelease }}
|
||||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare-release.outputs.repoConfiguration).excluded-charts-release) }}
|
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare.outputs.repoConfiguration).excluded-charts-release) }}
|
||||||
ghPagesBranch: gh-pages
|
ghPagesBranch: gh-pages
|
||||||
|
|
111
.github/workflows/charts-test.yaml
vendored
111
.github/workflows/charts-test.yaml
vendored
|
@ -3,55 +3,56 @@ name: "Charts: Test"
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkoutCommit:
|
charts:
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
chartsToTest:
|
|
||||||
description: >
|
description: >
|
||||||
A JSON encoded array of charts to lint
|
Json encoded list of Helm charts to release.
|
||||||
type: string
|
Defaults to releasing everything.
|
||||||
required: true
|
|
||||||
overrideDeps:
|
|
||||||
description: >
|
|
||||||
A JSON encoded array of dependencies to override before testing
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
default: "[]"
|
default: "[]"
|
||||||
|
required: true
|
||||||
env:
|
type: string
|
||||||
HELM_VERSION: 3.11.2
|
helmVersion:
|
||||||
|
description: >
|
||||||
|
Helm version to use.
|
||||||
|
default: "3.11.2"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
install-chart:
|
install-chart:
|
||||||
name: Install chart
|
name: Install chart
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
if: ${{ inputs.chartsToTest != '[]' && inputs.chartsToTest != '' }}
|
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
chart: ${{ fromJSON(inputs.chartsToTest) }}
|
chart: ${{ fromJSON(inputs.charts) }}
|
||||||
k8s_version:
|
k8s_version:
|
||||||
[
|
[
|
||||||
"v1.26.15",
|
"v1.29.13",
|
||||||
"v1.27.13",
|
"v1.30.9",
|
||||||
"v1.28.9",
|
"v1.31.5",
|
||||||
"v1.29.4",
|
"v1.32.1",
|
||||||
"v1.30.0",
|
|
||||||
]
|
]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
- name: Validate prerequisite folders
|
||||||
ref: ${{ inputs.checkoutCommit }}
|
working-directory: "charts/${{ matrix.chart }}"
|
||||||
|
run: |
|
||||||
|
CHART_TYPE=$(yq '.type // "application"' Chart.yaml)
|
||||||
|
if [[ ("${CHART_TYPE}" == "library") && (! -d "test-chart") ]]; then
|
||||||
|
echo "Library charts require a \"test-chart\" directory to run tests"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||||
with:
|
with:
|
||||||
setup-tools: |
|
setup-tools: |
|
||||||
helmv3
|
helmv3
|
||||||
kubectl
|
kubectl
|
||||||
helm: "${{ env.HELM_VERSION }}"
|
helm: "${{ inputs.helmVersion }}"
|
||||||
kubectl: "${{ matrix.k8s_version }}"
|
kubectl: "${{ matrix.k8s_version }}"
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
|
@ -70,17 +71,20 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
||||||
|
|
||||||
- name: Override chart dependencies
|
- name: Dereference JSON schema
|
||||||
uses: ./.github/actions/override-chart-deps
|
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
||||||
if: ${{ inputs.overrideDeps != '[]' }}
|
|
||||||
with:
|
with:
|
||||||
chart: ${{ matrix.chart }}
|
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||||
overrides: ${{ inputs.overrideDeps }}
|
outputFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||||
|
allowFileNotFound: true
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
working-directory: "charts/${{ matrix.chart }}"
|
working-directory: "charts/${{ matrix.chart }}"
|
||||||
# TODO: Awaiting https://github.com/actions/checkout/issues/1607
|
|
||||||
run: |
|
run: |
|
||||||
|
if [ -d "test-chart" ]; then
|
||||||
|
cd "test-chart"
|
||||||
|
fi
|
||||||
|
|
||||||
ct install --config "$GITHUB_WORKSPACE/.ci/ct/ct.yaml" --charts .
|
ct install --config "$GITHUB_WORKSPACE/.ci/ct/ct.yaml" --charts .
|
||||||
|
|
||||||
install_success:
|
install_success:
|
||||||
|
@ -106,38 +110,53 @@ jobs:
|
||||||
unittest-chart:
|
unittest-chart:
|
||||||
name: Unit-test chart
|
name: Unit-test chart
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
if: ${{ inputs.chartsToTest != '[]' && inputs.chartsToTest != '' }}
|
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
chart: ${{ fromJSON(inputs.chartsToTest) }}
|
chart: ${{ fromJSON(inputs.charts) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
- name: Validate prerequisite folders
|
||||||
ref: ${{ inputs.checkoutCommit }}
|
working-directory: "charts/${{ matrix.chart }}"
|
||||||
|
run: |
|
||||||
|
CHART_TYPE=$(yq '.type // "application"' Chart.yaml)
|
||||||
|
if [[ ("${CHART_TYPE}" == "library") && (! -d "test-chart") ]]; then
|
||||||
|
echo "Library charts require a \"test-chart\" directory to run tests"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||||
with:
|
with:
|
||||||
setup-tools: |
|
setup-tools: |
|
||||||
helmv3
|
helmv3
|
||||||
helm: "${{ env.HELM_VERSION }}"
|
helm: "${{ inputs.helmVersion }}"
|
||||||
|
|
||||||
- name: Override chart dependencies
|
- name: Dereference JSON schema
|
||||||
uses: ./.github/actions/override-chart-deps
|
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
||||||
if: ${{ inputs.overrideDeps != '[]' }}
|
|
||||||
with:
|
with:
|
||||||
chart: ${{ matrix.chart }}
|
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||||
overrides: ${{ inputs.overrideDeps }}
|
outputFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||||
|
allowFileNotFound: true
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
working-directory: "charts/${{ matrix.chart }}"
|
working-directory: "charts/${{ matrix.chart }}"
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -d "test-chart" ]]; then
|
||||||
|
cd "test-chart"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "unittests" ]]; then
|
||||||
|
echo "No unit tests found for chart ${{ matrix.chart }}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
helm plugin install https://github.com/helm-unittest/helm-unittest.git
|
helm plugin install https://github.com/helm-unittest/helm-unittest.git
|
||||||
helm dep update
|
helm dep update
|
||||||
helm unittest -f "tests/**/*_test.yaml" .
|
helm unittest -f "unittests/**/*_test.yaml" .
|
||||||
|
|
||||||
unittest_success:
|
unittest_success:
|
||||||
needs:
|
needs:
|
||||||
|
|
88
.github/workflows/pr-validate.yaml
vendored
88
.github/workflows/pr-validate.yaml
vendored
|
@ -13,35 +13,85 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr-metadata:
|
prepare:
|
||||||
uses: ./.github/workflows/pr-metadata.yaml
|
name: Prepare data required for workflow
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
outputs:
|
||||||
|
repoConfiguration: ${{ steps.repo-config.outputs.config }}
|
||||||
|
addedOrModifiedFiles: ${{ steps.added-modified-files.outputs.all_changed_files }}
|
||||||
|
chartsToLint: ${{ steps.charts-to-lint.outputs.filteredCharts }}
|
||||||
|
chartsToInstall: ${{ steps.charts-to-install.outputs.filteredCharts }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Grab repository configuration
|
||||||
|
id: repo-config
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "config=$(yq '.' '.ci/repo-config.yaml' -o json -I=0)" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Get all added or modified files
|
||||||
|
id: added-modified-files
|
||||||
|
uses: tj-actions/changed-files@v45
|
||||||
|
|
||||||
|
- name: Get changed charts
|
||||||
|
id: changed-charts
|
||||||
|
uses: tj-actions/changed-files@v45
|
||||||
|
with:
|
||||||
|
matrix: true
|
||||||
|
path: charts
|
||||||
|
dir_names: true
|
||||||
|
dir_names_max_depth: 2
|
||||||
|
|
||||||
|
- name: Determine charts to lint
|
||||||
|
id: charts-to-lint
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
var changedCharts = ${{ steps.changed-charts.outputs.all_changed_files }};
|
||||||
|
var chartsToFilter = ${{ toJSON(fromJSON(steps.repo-config.outputs.config).excluded-charts-lint) }};
|
||||||
|
let filteredCharts = changedCharts.filter(item => chartsToFilter.indexOf(item) < 0);
|
||||||
|
core.setOutput("filteredCharts", filteredCharts);
|
||||||
|
|
||||||
|
- name: Determine charts to install
|
||||||
|
id: charts-to-install
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
var changedCharts = ${{ steps.changed-charts.outputs.all_changed_files }};
|
||||||
|
var chartsToFilter = ${{ toJSON(fromJSON(steps.repo-config.outputs.config).excluded-charts-install) }};
|
||||||
|
let filteredCharts = changedCharts.filter(item => chartsToFilter.indexOf(item) < 0);
|
||||||
|
core.setOutput("filteredCharts", filteredCharts);
|
||||||
|
|
||||||
pre-commit-check:
|
pre-commit-check:
|
||||||
uses: ./.github/workflows/pre-commit-check.yaml
|
name: Perform Pre-Commit check
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
needs:
|
needs:
|
||||||
- pr-metadata
|
- prepare
|
||||||
with:
|
steps:
|
||||||
modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run against changes
|
||||||
|
uses: pre-commit/action@v3.0.1
|
||||||
|
with:
|
||||||
|
extra_args: --files ${{ needs.prepare.outputs.addedOrModifiedFiles }} --config .ci/pre-commit/config.yaml
|
||||||
|
|
||||||
charts-lint:
|
charts-lint:
|
||||||
|
name: Lint charts
|
||||||
uses: ./.github/workflows/charts-lint.yaml
|
uses: ./.github/workflows/charts-lint.yaml
|
||||||
needs:
|
needs:
|
||||||
- pr-metadata
|
- prepare
|
||||||
with:
|
with:
|
||||||
checkoutCommit: ${{ github.sha }}
|
charts: ${{ needs.prepare.outputs.chartsToLint }}
|
||||||
chartsToLint: ${{ needs.pr-metadata.outputs.chartsToLint }}
|
|
||||||
isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }}
|
|
||||||
|
|
||||||
charts-test:
|
charts-test:
|
||||||
|
name: Test charts
|
||||||
uses: ./.github/workflows/charts-test.yaml
|
uses: ./.github/workflows/charts-test.yaml
|
||||||
needs:
|
needs:
|
||||||
- pr-metadata
|
- prepare
|
||||||
with:
|
with:
|
||||||
checkoutCommit: ${{ github.sha }}
|
charts: ${{ needs.prepare.outputs.chartsToInstall }}
|
||||||
chartsToTest: |-
|
|
||||||
${{
|
|
||||||
(
|
|
||||||
(needs.pr-metadata.outputs.commonLibraryUpdated=='true') &&
|
|
||||||
'["library/common-test"]'
|
|
||||||
) || needs.pr-metadata.outputs.chartsToInstall
|
|
||||||
}}
|
|
||||||
|
|
23
.github/workflows/pre-commit-check.yaml
vendored
23
.github/workflows/pre-commit-check.yaml
vendored
|
@ -1,23 +0,0 @@
|
||||||
name: "Pre-commit consistency check"
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
modifiedFiles:
|
|
||||||
description: >
|
|
||||||
A JSON encoded array of files to check
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pre-commit-check:
|
|
||||||
name: Run pre-commit checks
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run against changes
|
|
||||||
uses: pre-commit/action@v3.0.1
|
|
||||||
with:
|
|
||||||
extra_args: --files ${{ join(fromJson(inputs.modifiedFiles), ' ') }} --config .ci/pre-commit/config.yaml
|
|
|
@ -23,10 +23,36 @@ tasks:
|
||||||
- docker run --rm -it --workdir=/data --volume $(pwd):/data {{.CT_IMAGE}} ct lint --config {{.CT_CONFIG_FILE}} --all --excluded-charts "{{.CHARTS_EXCLUDED_FROM_LINT}}"
|
- docker run --rm -it --workdir=/data --volume $(pwd):/data {{.CT_IMAGE}} ct lint --config {{.CT_CONFIG_FILE}} --all --excluded-charts "{{.CHARTS_EXCLUDED_FROM_LINT}}"
|
||||||
silent: true
|
silent: true
|
||||||
|
|
||||||
|
test:
|
||||||
|
desc: Test chart [CHART=required]
|
||||||
|
preconditions:
|
||||||
|
# Requires https://github.com/kstasik/schema-tools
|
||||||
|
- which helm schematools yq
|
||||||
|
- test -d "{{.CHART_DIR}}"
|
||||||
|
- test -d "{{.CHART_TEST_DIR}}"
|
||||||
|
requires:
|
||||||
|
vars:
|
||||||
|
- CHART
|
||||||
|
vars:
|
||||||
|
GLOB: "{{.GLOB | default \"**/*_test.yaml\"}}"
|
||||||
|
CHART_DIR: "{{.PROJECT_DIR}}/charts/{{.CHART}}"
|
||||||
|
CHART_TYPE:
|
||||||
|
sh: yq eval '.type // "application"' {{.PROJECT_DIR}}/charts/{{.CHART}}/Chart.yaml
|
||||||
|
CHART_TEST_DIR: |-
|
||||||
|
{{.CHART_DIR}}{{- if eq .CHART_TYPE "library" -}}/test-chart{{- end -}}
|
||||||
|
dir: "{{.CHART_TEST_DIR}}"
|
||||||
|
cmds:
|
||||||
|
- cp "{{.CHART_DIR}}/values.schema.json" "{{.CHART_DIR}}/values.schema.bak"
|
||||||
|
- schematools process dereference "{{.CHART_DIR}}/values.schema.json" --to-file "{{.CHART_DIR}}/values.schema.json"
|
||||||
|
- defer: mv "{{.CHART_DIR}}/values.schema.bak" "{{.CHART_DIR}}/values.schema.json"
|
||||||
|
- helm dep update
|
||||||
|
- helm unittest --color -f "unittests/{{.GLOB}}" .
|
||||||
|
silent: true
|
||||||
|
|
||||||
dependency-cleanup:
|
dependency-cleanup:
|
||||||
desc: clean up chart dependencies
|
desc: clean up chart dependencies
|
||||||
dir: "{{.PROJECT_DIR}}/charts"
|
dir: "{{.PROJECT_DIR}}/charts"
|
||||||
cmds:
|
cmds:
|
||||||
- find {{.PROJECT_DIR}}/charts/ -type f -name 'Chart.lock' -mindepth 1 -print0 | xargs -r -0 rm
|
- find {{.PROJECT_DIR}}/charts/ -mindepth 1 -type f -name 'Chart.lock' -print0 | xargs -r -0 rm
|
||||||
- find {{.PROJECT_DIR}}/charts/ -type d -name 'charts' -mindepth 1 -print0 | xargs -r -0 rm -rf
|
- find {{.PROJECT_DIR}}/charts/ -mindepth 1 -type d -name 'charts' -print0 | xargs -r -0 rm -rf
|
||||||
silent: true
|
silent: true
|
||||||
|
|
|
@ -7,7 +7,6 @@ vars:
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
charts: .taskfiles/charts.yaml
|
charts: .taskfiles/charts.yaml
|
||||||
docs: .taskfiles/docs.yaml
|
|
||||||
precommit: .taskfiles/precommit.yaml
|
precommit: .taskfiles/precommit.yaml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"$ref": "file://../common/values.schema.json"
|
|
||||||
}
|
|
|
@ -24,5 +24,10 @@
|
||||||
OWNERS
|
OWNERS
|
||||||
# helm-docs templates
|
# helm-docs templates
|
||||||
*.gotmpl
|
*.gotmpl
|
||||||
|
|
||||||
|
# Schema files
|
||||||
|
schemas/
|
||||||
|
|
||||||
# Test files
|
# Test files
|
||||||
tests/
|
test/
|
||||||
|
unittests/
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: v2
|
||||||
name: common
|
name: common
|
||||||
description: Function library for Helm charts
|
description: Function library for Helm charts
|
||||||
type: library
|
type: library
|
||||||
version: 3.7.0
|
version: 3.7.1
|
||||||
kubeVersion: ">=1.22.0-0"
|
kubeVersion: ">=1.22.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- common
|
- common
|
||||||
|
@ -16,22 +16,8 @@ annotations:
|
||||||
artifacthub.io/changes: |-
|
artifacthub.io/changes: |-
|
||||||
- kind: fixed
|
- kind: fixed
|
||||||
description: |-
|
description: |-
|
||||||
Raw resources with `forceRename` fields are no longer flagged as invalid
|
Values schema is now dereferenced before packaging so it no longer relies on
|
||||||
- kind: added
|
internet connectivity to validate the schema.
|
||||||
|
- kind: fixed
|
||||||
description: |-
|
description: |-
|
||||||
Allow setting pullPolicy to Never
|
Add explicit namespace declaration to templates using Release.Namespace
|
||||||
- kind: added
|
|
||||||
description: |-
|
|
||||||
Revamped configMap.fromFiles into configMap.fromFolder
|
|
||||||
- kind: added
|
|
||||||
description: |-
|
|
||||||
Add support for setting shareProcessNamespace on Pods
|
|
||||||
- kind: added
|
|
||||||
description: |-
|
|
||||||
Add support for templating ServiceMonitor endpoints
|
|
||||||
- kind: added
|
|
||||||
description: |-
|
|
||||||
Add support for templating Pod affinity
|
|
||||||
- kind: added
|
|
||||||
description: |-
|
|
||||||
Add support for configuring gRPC probes
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# common
|
# common
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
Function library for Helm charts
|
Function library for Helm charts
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
|
||||||
# Chart.yaml
|
# Chart.yaml
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
version: 3.7.0
|
version: 3.7.1
|
||||||
repository: https://bjw-s.github.io/helm-charts/
|
repository: https://bjw-s.github.io/helm-charts/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
{{- with $configMapObject.data }}
|
{{- with $configMapObject.data }}
|
||||||
data:
|
data:
|
||||||
{{- tpl (toYaml .) $rootContext | nindent 2 }}
|
{{- tpl (toYaml .) $rootContext | nindent 2 }}
|
||||||
|
|
|
@ -39,6 +39,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
suspend: {{ default false $cronJobSettings.suspend }}
|
suspend: {{ default false $cronJobSettings.suspend }}
|
||||||
concurrencyPolicy: {{ default "Forbid" $cronJobSettings.concurrencyPolicy }}
|
concurrencyPolicy: {{ default "Forbid" $cronJobSettings.concurrencyPolicy }}
|
||||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $daemonsetObject.revisionHistoryLimit "default" 3) }}
|
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $daemonsetObject.revisionHistoryLimit "default" 3) }}
|
||||||
selector:
|
selector:
|
||||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $deploymentObject.revisionHistoryLimit "default" 3) }}
|
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $deploymentObject.revisionHistoryLimit "default" 3) }}
|
||||||
{{- if hasKey $deploymentObject "replicas" }}
|
{{- if hasKey $deploymentObject "replicas" }}
|
||||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
{{- if $ingressObject.className }}
|
{{- if $ingressObject.className }}
|
||||||
ingressClassName: {{ $ingressObject.className }}
|
ingressClassName: {{ $ingressObject.className }}
|
||||||
|
|
|
@ -34,6 +34,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
suspend: {{ default false $jobSettings.suspend }}
|
suspend: {{ default false $jobSettings.suspend }}
|
||||||
{{- with $jobSettings.activeDeadlineSeconds }}
|
{{- with $jobSettings.activeDeadlineSeconds }}
|
||||||
|
|
|
@ -41,6 +41,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
podSelector: {{- toYaml $podSelector | nindent 4 }}
|
podSelector: {{- toYaml $podSelector | nindent 4 }}
|
||||||
{{- with $networkPolicyObject.policyTypes }}
|
{{- with $networkPolicyObject.policyTypes }}
|
||||||
|
|
|
@ -38,6 +38,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- {{ required (printf "accessMode is required for PVC %v" $pvcObject.name) $pvcObject.accessMode | quote }}
|
- {{ required (printf "accessMode is required for PVC %v" $pvcObject.name) $pvcObject.accessMode | quote }}
|
||||||
|
|
|
@ -39,6 +39,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
parentRefs:
|
parentRefs:
|
||||||
{{- range $routeObject.parentRefs }}
|
{{- range $routeObject.parentRefs }}
|
||||||
|
|
|
@ -39,6 +39,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
{{- with $stringData }}
|
{{- with $stringData }}
|
||||||
stringData: {{- tpl $stringData $rootContext | nindent 2 }}
|
stringData: {{- tpl $stringData $rootContext | nindent 2 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -34,6 +34,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
{{- if (eq $svcType "ClusterIP") }}
|
{{- if (eq $svcType "ClusterIP") }}
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
|
|
@ -31,6 +31,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
secrets:
|
secrets:
|
||||||
- name: {{ get (include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" (printf "%s-sa-token" $serviceAccountObject.identifier) ) | fromYaml) "name"}}
|
- name: {{ get (include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" (printf "%s-sa-token" $serviceAccountObject.identifier) ) | fromYaml) "name"}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -26,6 +26,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
jobLabel: "{{ $serviceMonitorObject.name }}"
|
jobLabel: "{{ $serviceMonitorObject.name }}"
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
||||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
namespace: {{ $rootContext.Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $statefulsetObject.revisionHistoryLimit "default" 3) }}
|
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $statefulsetObject.revisionHistoryLimit "default" 3) }}
|
||||||
replicas: {{ $statefulsetObject.replicas }}
|
replicas: {{ $statefulsetObject.replicas }}
|
||||||
|
|
|
@ -22,9 +22,12 @@
|
||||||
.vscode/
|
.vscode/
|
||||||
# OWNERS file for Kubernetes
|
# OWNERS file for Kubernetes
|
||||||
OWNERS
|
OWNERS
|
||||||
|
|
||||||
# helm-docs templates
|
# helm-docs templates
|
||||||
*.gotmpl
|
*.gotmpl
|
||||||
|
|
||||||
# helm unit tests
|
# Schema files
|
||||||
tests/
|
schemas/
|
||||||
|
|
||||||
|
# Test files
|
||||||
|
test-chart/
|
||||||
|
unittests/
|
|
@ -9,5 +9,5 @@ maintainers:
|
||||||
email: me@bjw-s.dev
|
email: me@bjw-s.dev
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: file://../common
|
repository: file://../
|
||||||
version: ">0.0.0-0"
|
version: ">0.0.0-0"
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue