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:
|
||||
- library/common-test
|
||||
excluded-charts-lint: []
|
||||
|
||||
excluded-charts-install:
|
||||
- apps/k8s-ycl
|
||||
- library/common
|
||||
- other/app-template
|
||||
|
||||
excluded-charts-release:
|
||||
- library/common-test
|
||||
excluded-charts-release: []
|
||||
|
|
2
.github/actions/charts-package/action.yaml
vendored
2
.github/actions/charts-package/action.yaml
vendored
|
@ -29,7 +29,7 @@ runs:
|
|||
using: "composite"
|
||||
steps:
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
|
|
|
@ -29,7 +29,7 @@ runs:
|
|||
uses: sigstore/cosign-installer@v3.6.0
|
||||
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||
with:
|
||||
setup-tools: |
|
||||
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:
|
||||
workflow_call:
|
||||
inputs:
|
||||
checkoutCommit:
|
||||
required: true
|
||||
type: string
|
||||
isRenovatePR:
|
||||
required: true
|
||||
default: "false"
|
||||
type: string
|
||||
chartsToLint:
|
||||
charts:
|
||||
description: >
|
||||
A JSON encoded array of charts to lint
|
||||
required: true
|
||||
type: string
|
||||
overrideDeps:
|
||||
description: >
|
||||
A JSON encoded array of dependencies to override before linting
|
||||
type: string
|
||||
required: false
|
||||
Json encoded list of Helm charts to release.
|
||||
Defaults to releasing everything.
|
||||
default: "[]"
|
||||
|
||||
env:
|
||||
HELM_VERSION: 3.11.2
|
||||
required: true
|
||||
type: string
|
||||
helmVersion:
|
||||
description: >
|
||||
Helm version to use.
|
||||
default: "3.11.2"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
lint-chart:
|
||||
if: ${{ inputs.chartsToLint != '[]' }}
|
||||
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
|
||||
name: Lint chart
|
||||
strategy:
|
||||
matrix:
|
||||
chart: ${{ fromJSON(inputs.chartsToLint) }}
|
||||
chart: ${{ fromJSON(inputs.charts) }}
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
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
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
helm: "${{ inputs.helmVersion }}"
|
||||
|
||||
- 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
|
||||
uses: ./.github/actions/override-chart-deps
|
||||
if: ${{ inputs.overrideDeps != '[]' }}
|
||||
with:
|
||||
chart: ${{ matrix.chart }}
|
||||
overrides: ${{ inputs.overrideDeps }}
|
||||
|
||||
- name: Dereference JSON schema before packaging
|
||||
- name: Dereference JSON schema
|
||||
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
||||
with:
|
||||
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:
|
||||
branches:
|
||||
- main
|
||||
- rework-publishing-ci # TODO: Remove this
|
||||
paths:
|
||||
- "charts/**"
|
||||
|
||||
jobs:
|
||||
prepare-release:
|
||||
name: Prepare data required for release
|
||||
prepare:
|
||||
name: Prepare data required for workflow
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
repoConfiguration: ${{ steps.repo-config.outputs.config }}
|
||||
|
@ -56,8 +57,8 @@ jobs:
|
|||
release-library-charts:
|
||||
name: Release library charts
|
||||
needs:
|
||||
- prepare-release
|
||||
if: ${{ needs.prepare-release.outputs.libraryChartsToRelease != '[]' }}
|
||||
- prepare
|
||||
if: ${{ needs.prepare.outputs.libraryChartsToRelease != '[]' }}
|
||||
uses: ./.github/workflows/charts-release-steps.yaml
|
||||
permissions:
|
||||
pages: write
|
||||
|
@ -65,17 +66,17 @@ jobs:
|
|||
contents: write
|
||||
packages: write
|
||||
with:
|
||||
charts: ${{ needs.prepare-release.outputs.libraryChartsToRelease }}
|
||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare-release.outputs.repoConfiguration).excluded-charts-release) }}
|
||||
charts: ${{ needs.prepare.outputs.libraryChartsToRelease }}
|
||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare.outputs.repoConfiguration).excluded-charts-release) }}
|
||||
ghPagesBranch: gh-pages
|
||||
publishToOciRegistry: false
|
||||
|
||||
release-other-charts:
|
||||
name: Release other charts
|
||||
needs:
|
||||
- prepare-release
|
||||
- prepare
|
||||
- release-library-charts
|
||||
if: ${{ needs.prepare-release.outputs.applicationChartsToRelease != '[]' }}
|
||||
if: ${{ needs.prepare.outputs.applicationChartsToRelease != '[]' }}
|
||||
uses: ./.github/workflows/charts-release-steps.yaml
|
||||
permissions:
|
||||
pages: write
|
||||
|
@ -83,6 +84,6 @@ jobs:
|
|||
contents: write
|
||||
packages: write
|
||||
with:
|
||||
charts: ${{ needs.prepare-release.outputs.applicationChartsToRelease }}
|
||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare-release.outputs.repoConfiguration).excluded-charts-release) }}
|
||||
charts: ${{ needs.prepare.outputs.applicationChartsToRelease }}
|
||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare.outputs.repoConfiguration).excluded-charts-release) }}
|
||||
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:
|
||||
workflow_call:
|
||||
inputs:
|
||||
checkoutCommit:
|
||||
required: true
|
||||
type: string
|
||||
chartsToTest:
|
||||
charts:
|
||||
description: >
|
||||
A JSON encoded array of charts to lint
|
||||
type: string
|
||||
required: true
|
||||
overrideDeps:
|
||||
description: >
|
||||
A JSON encoded array of dependencies to override before testing
|
||||
type: string
|
||||
required: false
|
||||
Json encoded list of Helm charts to release.
|
||||
Defaults to releasing everything.
|
||||
default: "[]"
|
||||
|
||||
env:
|
||||
HELM_VERSION: 3.11.2
|
||||
required: true
|
||||
type: string
|
||||
helmVersion:
|
||||
description: >
|
||||
Helm version to use.
|
||||
default: "3.11.2"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
install-chart:
|
||||
name: Install chart
|
||||
runs-on: ubuntu-22.04
|
||||
if: ${{ inputs.chartsToTest != '[]' && inputs.chartsToTest != '' }}
|
||||
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
|
||||
strategy:
|
||||
matrix:
|
||||
chart: ${{ fromJSON(inputs.chartsToTest) }}
|
||||
chart: ${{ fromJSON(inputs.charts) }}
|
||||
k8s_version:
|
||||
[
|
||||
"v1.26.15",
|
||||
"v1.27.13",
|
||||
"v1.28.9",
|
||||
"v1.29.4",
|
||||
"v1.30.0",
|
||||
"v1.29.13",
|
||||
"v1.30.9",
|
||||
"v1.31.5",
|
||||
"v1.32.1",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Validate prerequisite folders
|
||||
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
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
kubectl
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
helm: "${{ inputs.helmVersion }}"
|
||||
kubectl: "${{ matrix.k8s_version }}"
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
|
@ -70,17 +71,20 @@ jobs:
|
|||
run: |
|
||||
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
||||
|
||||
- name: Override chart dependencies
|
||||
uses: ./.github/actions/override-chart-deps
|
||||
if: ${{ inputs.overrideDeps != '[]' }}
|
||||
- name: Dereference JSON schema
|
||||
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
||||
with:
|
||||
chart: ${{ matrix.chart }}
|
||||
overrides: ${{ inputs.overrideDeps }}
|
||||
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||
outputFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||
allowFileNotFound: true
|
||||
|
||||
- name: Run chart-testing (install)
|
||||
working-directory: "charts/${{ matrix.chart }}"
|
||||
# TODO: Awaiting https://github.com/actions/checkout/issues/1607
|
||||
run: |
|
||||
if [ -d "test-chart" ]; then
|
||||
cd "test-chart"
|
||||
fi
|
||||
|
||||
ct install --config "$GITHUB_WORKSPACE/.ci/ct/ct.yaml" --charts .
|
||||
|
||||
install_success:
|
||||
|
@ -106,38 +110,53 @@ jobs:
|
|||
unittest-chart:
|
||||
name: Unit-test chart
|
||||
runs-on: ubuntu-22.04
|
||||
if: ${{ inputs.chartsToTest != '[]' && inputs.chartsToTest != '' }}
|
||||
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
|
||||
strategy:
|
||||
matrix:
|
||||
chart: ${{ fromJSON(inputs.chartsToTest) }}
|
||||
chart: ${{ fromJSON(inputs.charts) }}
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Validate prerequisite folders
|
||||
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
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.1
|
||||
uses: yokawasa/action-setup-kube-tools@v0.11.2
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
helm: "${{ inputs.helmVersion }}"
|
||||
|
||||
- name: Override chart dependencies
|
||||
uses: ./.github/actions/override-chart-deps
|
||||
if: ${{ inputs.overrideDeps != '[]' }}
|
||||
- name: Dereference JSON schema
|
||||
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
|
||||
with:
|
||||
chart: ${{ matrix.chart }}
|
||||
overrides: ${{ inputs.overrideDeps }}
|
||||
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||
outputFile: "charts/${{ matrix.chart }}/values.schema.json"
|
||||
allowFileNotFound: true
|
||||
|
||||
- name: Run tests
|
||||
working-directory: "charts/${{ matrix.chart }}"
|
||||
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 dep update
|
||||
helm unittest -f "tests/**/*_test.yaml" .
|
||||
helm unittest -f "unittests/**/*_test.yaml" .
|
||||
|
||||
unittest_success:
|
||||
needs:
|
||||
|
|
86
.github/workflows/pr-validate.yaml
vendored
86
.github/workflows/pr-validate.yaml
vendored
|
@ -13,35 +13,85 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pr-metadata:
|
||||
uses: ./.github/workflows/pr-metadata.yaml
|
||||
prepare:
|
||||
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:
|
||||
uses: ./.github/workflows/pre-commit-check.yaml
|
||||
name: Perform Pre-Commit check
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- pr-metadata
|
||||
- prepare
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run against changes
|
||||
uses: pre-commit/action@v3.0.1
|
||||
with:
|
||||
modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
|
||||
extra_args: --files ${{ needs.prepare.outputs.addedOrModifiedFiles }} --config .ci/pre-commit/config.yaml
|
||||
|
||||
charts-lint:
|
||||
name: Lint charts
|
||||
uses: ./.github/workflows/charts-lint.yaml
|
||||
needs:
|
||||
- pr-metadata
|
||||
- prepare
|
||||
with:
|
||||
checkoutCommit: ${{ github.sha }}
|
||||
chartsToLint: ${{ needs.pr-metadata.outputs.chartsToLint }}
|
||||
isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }}
|
||||
charts: ${{ needs.prepare.outputs.chartsToLint }}
|
||||
|
||||
charts-test:
|
||||
name: Test charts
|
||||
uses: ./.github/workflows/charts-test.yaml
|
||||
needs:
|
||||
- pr-metadata
|
||||
- prepare
|
||||
with:
|
||||
checkoutCommit: ${{ github.sha }}
|
||||
chartsToTest: |-
|
||||
${{
|
||||
(
|
||||
(needs.pr-metadata.outputs.commonLibraryUpdated=='true') &&
|
||||
'["library/common-test"]'
|
||||
) || needs.pr-metadata.outputs.chartsToInstall
|
||||
}}
|
||||
charts: ${{ needs.prepare.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}}"
|
||||
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:
|
||||
desc: clean up chart dependencies
|
||||
dir: "{{.PROJECT_DIR}}/charts"
|
||||
cmds:
|
||||
- find {{.PROJECT_DIR}}/charts/ -type f -name 'Chart.lock' -mindepth 1 -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 f -name 'Chart.lock' -print0 | xargs -r -0 rm
|
||||
- find {{.PROJECT_DIR}}/charts/ -mindepth 1 -type d -name 'charts' -print0 | xargs -r -0 rm -rf
|
||||
silent: true
|
||||
|
|
|
@ -7,7 +7,6 @@ vars:
|
|||
|
||||
includes:
|
||||
charts: .taskfiles/charts.yaml
|
||||
docs: .taskfiles/docs.yaml
|
||||
precommit: .taskfiles/precommit.yaml
|
||||
|
||||
tasks:
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"$ref": "file://../common/values.schema.json"
|
||||
}
|
|
@ -24,5 +24,10 @@
|
|||
OWNERS
|
||||
# helm-docs templates
|
||||
*.gotmpl
|
||||
|
||||
# Schema files
|
||||
schemas/
|
||||
|
||||
# Test files
|
||||
tests/
|
||||
test/
|
||||
unittests/
|
||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: v2
|
|||
name: common
|
||||
description: Function library for Helm charts
|
||||
type: library
|
||||
version: 3.7.0
|
||||
version: 3.7.1
|
||||
kubeVersion: ">=1.22.0-0"
|
||||
keywords:
|
||||
- common
|
||||
|
@ -16,22 +16,8 @@ annotations:
|
|||
artifacthub.io/changes: |-
|
||||
- kind: fixed
|
||||
description: |-
|
||||
Raw resources with `forceRename` fields are no longer flagged as invalid
|
||||
- kind: added
|
||||
Values schema is now dereferenced before packaging so it no longer relies on
|
||||
internet connectivity to validate the schema.
|
||||
- kind: fixed
|
||||
description: |-
|
||||
Allow setting pullPolicy to Never
|
||||
- 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
|
||||
Add explicit namespace declaration to templates using Release.Namespace
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# common
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
Function library for Helm charts
|
||||
|
||||
|
@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
|
|||
# Chart.yaml
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 3.7.0
|
||||
version: 3.7.1
|
||||
repository: https://bjw-s.github.io/helm-charts/
|
||||
```
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
{{- with $configMapObject.data }}
|
||||
data:
|
||||
{{- tpl (toYaml .) $rootContext | nindent 2 }}
|
||||
|
|
|
@ -39,6 +39,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
suspend: {{ default false $cronJobSettings.suspend }}
|
||||
concurrencyPolicy: {{ default "Forbid" $cronJobSettings.concurrencyPolicy }}
|
||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $daemonsetObject.revisionHistoryLimit "default" 3) }}
|
||||
selector:
|
||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $deploymentObject.revisionHistoryLimit "default" 3) }}
|
||||
{{- if hasKey $deploymentObject "replicas" }}
|
||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
{{- if $ingressObject.className }}
|
||||
ingressClassName: {{ $ingressObject.className }}
|
||||
|
|
|
@ -34,6 +34,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
suspend: {{ default false $jobSettings.suspend }}
|
||||
{{- with $jobSettings.activeDeadlineSeconds }}
|
||||
|
|
|
@ -41,6 +41,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
podSelector: {{- toYaml $podSelector | nindent 4 }}
|
||||
{{- with $networkPolicyObject.policyTypes }}
|
||||
|
|
|
@ -38,6 +38,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ 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 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
parentRefs:
|
||||
{{- range $routeObject.parentRefs }}
|
||||
|
|
|
@ -39,6 +39,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
{{- with $stringData }}
|
||||
stringData: {{- tpl $stringData $rootContext | nindent 2 }}
|
||||
{{- end }}
|
||||
|
|
|
@ -34,6 +34,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
{{- if (eq $svcType "ClusterIP") }}
|
||||
type: ClusterIP
|
||||
|
|
|
@ -31,6 +31,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
secrets:
|
||||
- name: {{ get (include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" (printf "%s-sa-token" $serviceAccountObject.identifier) ) | fromYaml) "name"}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -26,6 +26,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
jobLabel: "{{ $serviceMonitorObject.name }}"
|
||||
namespaceSelector:
|
||||
|
|
|
@ -32,6 +32,7 @@ metadata:
|
|||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $statefulsetObject.revisionHistoryLimit "default" 3) }}
|
||||
replicas: {{ $statefulsetObject.replicas }}
|
||||
|
|
|
@ -22,9 +22,12 @@
|
|||
.vscode/
|
||||
# OWNERS file for Kubernetes
|
||||
OWNERS
|
||||
|
||||
# helm-docs templates
|
||||
*.gotmpl
|
||||
|
||||
# helm unit tests
|
||||
tests/
|
||||
# Schema files
|
||||
schemas/
|
||||
|
||||
# Test files
|
||||
test-chart/
|
||||
unittests/
|
|
@ -9,5 +9,5 @@ maintainers:
|
|||
email: me@bjw-s.dev
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: file://../common
|
||||
repository: file://../
|
||||
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