Compare commits
No commits in common. "main" and "api/v0.34.0" have entirely different histories.
main
...
api/v0.34.
|
@ -1,39 +0,0 @@
|
|||
version: 2
|
||||
|
||||
updates:
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
labels: ["dependencies"]
|
||||
schedule:
|
||||
interval: "daily"
|
||||
groups:
|
||||
go-deps:
|
||||
patterns:
|
||||
- "*"
|
||||
allow:
|
||||
- dependency-type: "direct"
|
||||
ignore:
|
||||
# Kubernetes deps are updated by fluxcd/pkg/runtime
|
||||
- dependency-name: "k8s.io/*"
|
||||
- dependency-name: "sigs.k8s.io/*"
|
||||
- dependency-name: "github.com/go-logr/*"
|
||||
# jsondiff is updated by fluxcd/pkg/ssa
|
||||
- dependency-name: "github.com/wI2L/jsondiff"
|
||||
# OCI deps are updated by fluxcd/pkg/oci
|
||||
- dependency-name: "github.com/google/go-containerregistry*"
|
||||
- dependency-name: "github.com/opencontainers/*"
|
||||
# Helm deps are updated by fluxcd/pkg/helmtestserver
|
||||
- dependency-name: "helm.sh/helm/*"
|
||||
- dependency-name: "github.com/Masterminds/semver/*"
|
||||
# Flux APIs are updated at release time
|
||||
- dependency-name: "github.com/fluxcd/helm-controller/api"
|
||||
- dependency-name: "github.com/fluxcd/source-controller/api"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
labels: ["area/ci", "dependencies"]
|
||||
groups:
|
||||
ci:
|
||||
patterns:
|
||||
- "*"
|
||||
schedule:
|
||||
interval: "monthly"
|
|
@ -1,27 +0,0 @@
|
|||
# Configuration file to declaratively configure labels
|
||||
# Ref: https://github.com/EndBug/label-sync#Config-files
|
||||
|
||||
- name: area/drift
|
||||
description: Drift detection/correction related issues and pull requests
|
||||
color: '#ff5c00'
|
||||
- name: area/helm
|
||||
description: Helm related issues and pull requests
|
||||
color: '#1673b6'
|
||||
- name: area/kustomize
|
||||
description: Kustomize (post-rendering) related issues and pull requests
|
||||
color: '#00e54d'
|
||||
- name: area/oci
|
||||
description: OCI related issues and pull requests
|
||||
color: '#c739ff'
|
||||
- name: backport:release/v1.0.x
|
||||
description: To be backported to release/v1.0.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v1.1.x
|
||||
description: To be backported to release/v1.1.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v1.2.x
|
||||
description: To be backported to release/v1.2.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v1.3.x
|
||||
description: To be backported to release/v1.3.x
|
||||
color: '#ffd700'
|
|
@ -1,34 +0,0 @@
|
|||
name: backport
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed, labeled]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Create backport PRs
|
||||
uses: korthout/backport-action@0193454f0c5947491d348f33a275c119f30eb736 # v3.2.1
|
||||
# xref: https://github.com/korthout/backport-action#inputs
|
||||
with:
|
||||
# Use token to allow workflows to be triggered for the created PR
|
||||
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
# Match labels with a pattern `backport:<target-branch>`
|
||||
label_pattern: '^backport:([^ ]+)$'
|
||||
# A bit shorter pull-request title than the default
|
||||
pull_title: '[${target_branch}] ${pull_title}'
|
||||
# Simpler PR description than default
|
||||
pull_description: |-
|
||||
Automated backport to `${target_branch}`, triggered by a label in #${pull_number}.
|
|
@ -2,8 +2,7 @@ name: fuzz
|
|||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
- "release/**"
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
|
@ -13,11 +12,11 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
with:
|
||||
go-version: 1.24.x
|
||||
go-version: 1.20.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
|
|
|
@ -4,8 +4,8 @@ on:
|
|||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "release/**"
|
||||
- main
|
||||
- "feature/**"
|
||||
|
||||
permissions:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
|
@ -15,16 +15,16 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- name: Setup Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
|
||||
with:
|
||||
buildkitd-flags: "--debug"
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
||||
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
|
||||
id: cache
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
|
@ -32,18 +32,17 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-buildx-ghcache-
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
with:
|
||||
go-version: 1.24.x
|
||||
go-version: 1.20.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Setup Kubernetes
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 # v1.5.0
|
||||
with:
|
||||
version: v0.20.0
|
||||
version: v0.17.0
|
||||
cluster_name: kind
|
||||
node_image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
|
||||
- name: Setup Helm
|
||||
uses: fluxcd/pkg/actions/helm@main
|
||||
- name: Setup Kustomize
|
||||
|
@ -91,14 +90,6 @@ jobs:
|
|||
kubectl -n helm-system rollout status deploy/helm-controller --timeout=1m
|
||||
env:
|
||||
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
|
||||
- name: Test samples
|
||||
run: |
|
||||
kubectl create ns samples
|
||||
kubectl -n samples apply -f config/samples
|
||||
kubectl -n samples wait hr/podinfo-ocirepository --for=condition=ready --timeout=4m
|
||||
kubectl -n samples wait hr/podinfo-gitrepository --for=condition=ready --timeout=4m
|
||||
kubectl -n samples wait hr/podinfo-helmrepository --for=condition=ready --timeout=4m
|
||||
kubectl delete ns samples
|
||||
- name: Install sources
|
||||
run: |
|
||||
kubectl -n helm-system apply -f config/testdata/sources
|
||||
|
@ -146,16 +137,6 @@ jobs:
|
|||
kubectl -n install-create-target-ns get deployment install-create-target-ns-install-create-target-ns-podinfo
|
||||
|
||||
kubectl -n helm-system delete -f config/testdata/install-create-target-ns
|
||||
- name: Run install from helmChart test
|
||||
run: |
|
||||
kubectl -n helm-system apply -f config/testdata/install-from-hc-source
|
||||
kubectl -n helm-system wait helmreleases/podinfo-from-hc --for=condition=ready --timeout=4m
|
||||
kubectl -n helm-system delete -f config/testdata/install-from-hc-source
|
||||
- name: Run install from ocirepo test
|
||||
run: |
|
||||
kubectl -n helm-system apply -f config/testdata/install-from-ocirepo-source
|
||||
kubectl -n helm-system wait helmreleases/podinfo-from-ocirepo --for=condition=ready --timeout=4m
|
||||
kubectl -n helm-system delete -f config/testdata/install-from-ocirepo-source
|
||||
- name: Run install fail test
|
||||
run: |
|
||||
test_name=install-fail
|
||||
|
@ -187,7 +168,7 @@ jobs:
|
|||
kubectl -n helm-system apply -f config/testdata/$test_name
|
||||
echo -n ">>> Waiting for expected conditions"
|
||||
count=0
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
|
||||
echo -n '.'
|
||||
sleep 5
|
||||
count=$((count + 1))
|
||||
|
@ -231,7 +212,7 @@ jobs:
|
|||
fi
|
||||
|
||||
kubectl -n helm-system delete -f config/testdata/$test_name
|
||||
- name: Run install fail with remediation test
|
||||
- name: Run install fail with remedition test
|
||||
run: |
|
||||
test_name=install-fail-remediate
|
||||
kubectl -n helm-system apply -f config/testdata/$test_name
|
||||
|
@ -248,22 +229,21 @@ jobs:
|
|||
done
|
||||
echo ' done'
|
||||
|
||||
# Ensure release was uninstalled.
|
||||
RELEASE_STATUS=$(helm -n helm-system history $test_name -o json | jq -r 'if length == 1 then .[0].status else empty end')
|
||||
if [ "$RELEASE_STATUS" != "uninstalled" ]; then
|
||||
echo -e "Unexpected release status: $RELEASE_STATUS"
|
||||
# Ensure release does not exist (was uninstalled).
|
||||
HISTORY=$(helm -n helm-system history $test_name 2>&1; exit 0)
|
||||
if [ "$HISTORY" != 'Error: release: not found' ]; then
|
||||
echo -e "Unexpected release history: $HISTORY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kubectl -n helm-system delete -f config/testdata/$test_name
|
||||
helm -n helm-system delete $test_name
|
||||
- name: Run install fail with retry test
|
||||
run: |
|
||||
test_name=install-fail-retry
|
||||
kubectl -n helm-system apply -f config/testdata/$test_name
|
||||
echo -n ">>> Waiting for expected conditions"
|
||||
count=0
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.installFailures == 2 and ( .status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False" and .Stalled=="True" )' )" ]; do
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.installFailures == 2 and ( .status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False" )' )" ]; do
|
||||
echo -n '.'
|
||||
sleep 5
|
||||
count=$((count + 1))
|
||||
|
@ -309,7 +289,7 @@ jobs:
|
|||
kubectl -n helm-system apply -f config/testdata/$test_name/upgrade.yaml
|
||||
echo -n ">>> Waiting for expected conditions"
|
||||
count=0
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False" and .Stalled=="True"' )" ]; do
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False"' )" ]; do
|
||||
echo -n '.'
|
||||
sleep 5
|
||||
count=$((count + 1))
|
||||
|
@ -355,7 +335,7 @@ jobs:
|
|||
kubectl -n helm-system apply -f config/testdata/$test_name/upgrade.yaml
|
||||
echo -n ">>> Waiting for expected conditions"
|
||||
count=0
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .TestSuccess=="False" and .Ready=="False" and .Stalled=="True"' )" ]; do
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
|
||||
echo -n '.'
|
||||
sleep 5
|
||||
count=$((count + 1))
|
||||
|
@ -476,45 +456,6 @@ jobs:
|
|||
fi
|
||||
|
||||
kubectl delete -n helm-system -f config/testdata/$test_name/install.yaml
|
||||
- name: Run upgrade from ocirepo source
|
||||
run: |
|
||||
test_name=upgrade-from-ocirepo-source
|
||||
kubectl -n helm-system apply -f config/testdata/$test_name/install.yaml
|
||||
echo -n ">>> Waiting for expected conditions"
|
||||
count=0
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .Ready=="True"' )" ]; do
|
||||
echo -n '.'
|
||||
sleep 5
|
||||
count=$((count + 1))
|
||||
if [[ ${count} -eq 24 ]]; then
|
||||
echo ' No more retries left!'
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo ' done'
|
||||
|
||||
# Validate release was installed.
|
||||
REVISION_COUNT=$(helm -n helm-system history -o json $test_name | jq 'length')
|
||||
if [ "$REVISION_COUNT" != 1 ]; then
|
||||
echo -e "Unexpected revision count: $REVISION_COUNT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kubectl -n helm-system apply -f config/testdata/$test_name/upgrade.yaml
|
||||
echo -n ">>> Waiting for expected conditions"
|
||||
count=0
|
||||
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .Ready=="True"' )" ]; do
|
||||
echo -n '.'
|
||||
sleep 5
|
||||
count=$((count + 1))
|
||||
if [[ ${count} -eq 24 ]]; then
|
||||
echo ' No more retries left!'
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo ' done'
|
||||
|
||||
kubectl delete -n helm-system -f config/testdata/$test_name/install.yaml
|
||||
- name: Run upgrade fail with uninstall remediation strategy test
|
||||
run: |
|
||||
test_name=upgrade-fail-remediate-uninstall
|
||||
|
@ -595,11 +536,10 @@ jobs:
|
|||
kubectl -n delete-ns wait helmreleases/podinfo --for=condition=ready --timeout=2m
|
||||
kubectl delete ns delete-ns 1>/dev/null 2>&1 &
|
||||
echo -n ">>> Waiting for namespace to be deleted"
|
||||
if kubectl wait --for=delete namespace delete-ns --timeout=5m; then
|
||||
if kubectl wait --for=delete namespace delete-ns --timeout=3m; then
|
||||
echo ' Namespace deleted successfully'
|
||||
else
|
||||
echo ' Timed out waiting for namespace to be deleted'
|
||||
kubectl get all -n delete-ns
|
||||
exit 1
|
||||
fi
|
||||
- name: Run post-renderer-kustomize test
|
||||
|
@ -617,7 +557,7 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
kubectl -n helm-system delete -f config/testdata/post-renderer-kustomize
|
||||
- name: Bootstrap CRDs Upgrade Tests
|
||||
- name: Boostrap CRDs Upgrade Tests
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/') }}
|
||||
run: |
|
||||
REF=${{ github.ref }}
|
||||
|
|
|
@ -15,16 +15,16 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- name: Setup Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
|
||||
with:
|
||||
buildkitd-flags: "--debug"
|
||||
- name: Build multi-arch container image
|
||||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
||||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
|
||||
with:
|
||||
push: false
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
|
|
|
@ -7,29 +7,23 @@ on:
|
|||
inputs:
|
||||
tag:
|
||||
description: 'image tag prefix'
|
||||
default: 'preview'
|
||||
default: 'rc'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write # needed to write releases
|
||||
id-token: write # needed for keyless signing
|
||||
packages: write # needed for ghcr access
|
||||
|
||||
env:
|
||||
CONTROLLER: ${{ github.event.repository.name }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
outputs:
|
||||
hashes: ${{ steps.slsa.outputs.hashes }}
|
||||
image_url: ${{ steps.slsa.outputs.image_url }}
|
||||
image_digest: ${{ steps.slsa.outputs.image_digest }}
|
||||
build-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # for creating the GitHub release.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
packages: write # for pushing and signing container images.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@main
|
||||
- name: Prepare
|
||||
|
@ -42,24 +36,24 @@ jobs:
|
|||
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- name: Setup Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: fluxcdbot
|
||||
password: ${{ secrets.GHCR_TOKEN }}
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
username: fluxcdbot
|
||||
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
|
||||
- name: Generate images meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
||||
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
|
||||
with:
|
||||
images: |
|
||||
fluxcd/${{ env.CONTROLLER }}
|
||||
|
@ -67,8 +61,7 @@ jobs:
|
|||
tags: |
|
||||
type=raw,value=${{ steps.prep.outputs.VERSION }}
|
||||
- name: Publish images
|
||||
id: build-push
|
||||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
||||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
|
||||
with:
|
||||
sbom: true
|
||||
provenance: true
|
||||
|
@ -79,82 +72,32 @@ jobs:
|
|||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
|
||||
- name: Check images
|
||||
run: |
|
||||
docker buildx imagetools inspect docker.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
|
||||
docker buildx imagetools inspect ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
|
||||
docker pull docker.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
|
||||
docker pull ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
|
||||
- uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v3.0.1
|
||||
- name: Sign images
|
||||
env:
|
||||
COSIGN_EXPERIMENTAL: 1
|
||||
run: |
|
||||
cosign sign --yes fluxcd/${{ env.CONTROLLER }}@${{ steps.build-push.outputs.digest }}
|
||||
cosign sign --yes ghcr.io/fluxcd/${{ env.CONTROLLER }}@${{ steps.build-push.outputs.digest }}
|
||||
cosign sign --yes fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
|
||||
cosign sign --yes ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
|
||||
- name: Generate release artifacts
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
mkdir -p config/release
|
||||
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml
|
||||
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml
|
||||
- uses: anchore/sbom-action/download-syft@cee1b8e05ae5b2593a75e197229729eabaa9f8ec # v0.20.2
|
||||
echo '[CHANGELOG](https://github.com/fluxcd/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md
|
||||
- uses: anchore/sbom-action/download-syft@07978da4bdb4faa726e52dfc6b1bed63d4b56479 # v0.13.3
|
||||
- name: Create release and SBOM
|
||||
id: run-goreleaser
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
|
||||
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
|
||||
with:
|
||||
version: latest
|
||||
args: release --clean --skip=validate
|
||||
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Generate SLSA metadata
|
||||
id: slsa
|
||||
env:
|
||||
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
|
||||
run: |
|
||||
hashes=$(echo -E $ARTIFACTS | jq --raw-output '.[] | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {digest} + {name} | join(" ") | sub("^sha256:";"")' | base64 -w0)
|
||||
echo "hashes=$hashes" >> $GITHUB_OUTPUT
|
||||
|
||||
image_url=fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.version }}
|
||||
echo "image_url=$image_url" >> $GITHUB_OUTPUT
|
||||
|
||||
image_digest=${{ steps.build-push.outputs.digest }}
|
||||
echo "image_digest=$image_digest" >> $GITHUB_OUTPUT
|
||||
|
||||
release-provenance:
|
||||
needs: [release]
|
||||
permissions:
|
||||
actions: read # for detecting the Github Actions environment.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
contents: write # for uploading attestations to GitHub releases.
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
|
||||
with:
|
||||
provenance-name: "provenance.intoto.jsonl"
|
||||
base64-subjects: "${{ needs.release.outputs.hashes }}"
|
||||
upload-assets: true
|
||||
|
||||
dockerhub-provenance:
|
||||
needs: [release]
|
||||
permissions:
|
||||
actions: read # for detecting the Github Actions environment.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
packages: write # for uploading attestations.
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
|
||||
with:
|
||||
image: ${{ needs.release.outputs.image_url }}
|
||||
digest: ${{ needs.release.outputs.image_digest }}
|
||||
registry-username: fluxcdbot
|
||||
secrets:
|
||||
registry-password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
|
||||
|
||||
ghcr-provenance:
|
||||
needs: [release]
|
||||
permissions:
|
||||
actions: read # for detecting the Github Actions environment.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
packages: write # for uploading attestations.
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
|
||||
with:
|
||||
image: ghcr.io/${{ needs.release.outputs.image_url }}
|
||||
digest: ${{ needs.release.outputs.image_digest }}
|
||||
registry-username: fluxcdbot
|
||||
secrets:
|
||||
registry-password: ${{ secrets.GHCR_TOKEN }}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
name: scan
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "release/**" ]
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ "main", "release/**" ]
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: '18 10 * * 3'
|
||||
|
||||
|
@ -17,35 +17,61 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Run FOSSA scan and upload build data
|
||||
uses: fossa-contrib/fossa-action@3d2ef181b1820d6dcd1972f86a767d18167fa19b # v3.0.1
|
||||
uses: fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 # v2.0.0
|
||||
with:
|
||||
# FOSSA Push-Only API Token
|
||||
fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de
|
||||
github-token: ${{ github.token }}
|
||||
|
||||
snyk:
|
||||
name: Snyk
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Download modules
|
||||
run: |
|
||||
make tidy
|
||||
- uses: snyk/actions/setup@master
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
continue-on-error: true
|
||||
run: |
|
||||
snyk test --all-projects --sarif-file-output=snyk.sarif
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
- name: Upload result to GitHub Code Scanning
|
||||
uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
|
||||
with:
|
||||
sarif_file: snyk.sarif
|
||||
|
||||
codeql:
|
||||
name: CodeQL
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
with:
|
||||
go-version: 1.24.x
|
||||
go-version: 1.20.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
uses: github/codeql-action/init@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
|
||||
with:
|
||||
languages: go
|
||||
# xref: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# xref: https://codeql.github.com/codeql-query-help/go/
|
||||
queries: security-and-quality
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
uses: github/codeql-action/autobuild@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
uses: github/codeql-action/analyze@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
name: sync-labels
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/labels.yaml
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
labels:
|
||||
name: Run sync
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3
|
||||
with:
|
||||
# Configuration file
|
||||
config-file: |
|
||||
https://raw.githubusercontent.com/fluxcd/community/main/.github/standard-labels.yaml
|
||||
.github/labels.yaml
|
||||
# Strictly declarative
|
||||
delete-other-labels: true
|
|
@ -4,26 +4,9 @@ builds:
|
|||
- skip: true
|
||||
|
||||
release:
|
||||
prerelease: "true"
|
||||
extra_files:
|
||||
- glob: config/release/*.yaml
|
||||
prerelease: "auto"
|
||||
header: |
|
||||
## Changelog
|
||||
|
||||
[{{.Tag}} changelog](https://github.com/fluxcd/{{.ProjectName}}/blob/{{.Tag}}/CHANGELOG.md)
|
||||
footer: |
|
||||
## Container images
|
||||
|
||||
- `docker.io/fluxcd/{{.ProjectName}}:{{.Tag}}`
|
||||
- `ghcr.io/fluxcd/{{.ProjectName}}:{{.Tag}}`
|
||||
|
||||
Supported architectures: `linux/amd64`, `linux/arm64` and `linux/arm/v7`.
|
||||
|
||||
The container images are built on GitHub hosted runners and are signed with cosign and GitHub OIDC.
|
||||
To verify the images and their provenance (SLSA level 3), please see the [security documentation](https://fluxcd.io/flux/security/).
|
||||
|
||||
changelog:
|
||||
disable: true
|
||||
|
||||
checksum:
|
||||
extra_files:
|
||||
|
|
677
CHANGELOG.md
677
CHANGELOG.md
|
@ -1,682 +1,5 @@
|
|||
# Changelog
|
||||
|
||||
## 1.3.0
|
||||
|
||||
**Release date:** 2025-05-28
|
||||
|
||||
This minor release comes with various bug fixes and improvements.
|
||||
|
||||
The controller now supports the `DisableChartDigestTracking` feature gate,
|
||||
which allows disabling appending the digest of OCI Helm charts to the
|
||||
chart version. This is useful for charts that do not follow Helm's
|
||||
recommendation of using the app version instead of the chart version
|
||||
as a label in the manifests.
|
||||
|
||||
In addition, the Kubernetes dependencies have been updated to v1.33, Helm has
|
||||
been updated to v3.17.3 and various other controller dependencies have been
|
||||
updated to their latest version. The controller is now built with Go 1.24.
|
||||
|
||||
Fixes:
|
||||
- Fix returning wrong error value in Kubernetes HTTP client
|
||||
[#1188](https://github.com/fluxcd/helm-controller/pull/1188)
|
||||
|
||||
Improvements:
|
||||
- Add `DisableChartDigestTracking` feature gate
|
||||
[#1212](https://github.com/fluxcd/helm-controller/pull/1212)
|
||||
- Various dependency updates
|
||||
[#1227](https://github.com/fluxcd/helm-controller/pull/1227)
|
||||
[#1221](https://github.com/fluxcd/helm-controller/pull/1221)
|
||||
[#1220](https://github.com/fluxcd/helm-controller/pull/1220)
|
||||
[#1218](https://github.com/fluxcd/helm-controller/pull/1218)
|
||||
[#1206](https://github.com/fluxcd/helm-controller/pull/1206)
|
||||
[#1209](https://github.com/fluxcd/helm-controller/pull/1209)
|
||||
[#1204](https://github.com/fluxcd/helm-controller/pull/1204)
|
||||
|
||||
## 1.2.0
|
||||
|
||||
**Release date:** 2025-02-19
|
||||
|
||||
This minor release comes with various bug fixes and improvements.
|
||||
|
||||
In addition, the Kubernetes dependencies have been updated to v1.32.1, Helm has
|
||||
been updated to v3.17.1 and various other controller dependencies have been
|
||||
updated to their latest version.
|
||||
|
||||
Fixes:
|
||||
- Replace _ with + when verifying the chart version matches the OCI artifact tag
|
||||
[#1102](https://github.com/fluxcd/helm-controller/pull/1102)
|
||||
- fix: handle "leader changed" errors
|
||||
[#1084](https://github.com/fluxcd/helm-controller/pull/1084)
|
||||
- Make `ValuesReference` an alias for backwards compat
|
||||
[#1126](https://github.com/fluxcd/helm-controller/pull/1126)
|
||||
- Fix install and upgrade applying subchart CRDs when condition is false
|
||||
[#1123](https://github.com/fluxcd/helm-controller/pull/1123)
|
||||
- fix: use HelmRelease max history for rollback remediation
|
||||
[#1169](https://github.com/fluxcd/helm-controller/pull/1169)
|
||||
|
||||
Improvements:
|
||||
- Refactor values composition to use pkg/chartutil
|
||||
[#1122](https://github.com/fluxcd/helm-controller/pull/1122)
|
||||
- docs: Rendering the final Values locally
|
||||
[#1127](https://github.com/fluxcd/helm-controller/pull/1127)
|
||||
- Add disableTakeOwnership to Helm install/upgrade actions
|
||||
[#1140](https://github.com/fluxcd/helm-controller/pull/1140)
|
||||
- Various dependency updates
|
||||
[#1103](https://github.com/fluxcd/helm-controller/pull/1103)
|
||||
[#1121](https://github.com/fluxcd/helm-controller/pull/1121)
|
||||
[#1129](https://github.com/fluxcd/helm-controller/pull/1129)
|
||||
[#1142](https://github.com/fluxcd/helm-controller/pull/1142)
|
||||
[#1160](https://github.com/fluxcd/helm-controller/pull/1160)
|
||||
[#1158](https://github.com/fluxcd/helm-controller/pull/1158)
|
||||
[#1165](https://github.com/fluxcd/helm-controller/pull/1165)
|
||||
[#1168](https://github.com/fluxcd/helm-controller/pull/1168)
|
||||
[#1171](https://github.com/fluxcd/helm-controller/pull/1171)
|
||||
[#1167](https://github.com/fluxcd/helm-controller/pull/1167)
|
||||
[#1173](https://github.com/fluxcd/helm-controller/pull/1173)
|
||||
[#1170](https://github.com/fluxcd/helm-controller/pull/1170)
|
||||
|
||||
## 1.1.0
|
||||
|
||||
**Release date:** 2024-09-26
|
||||
|
||||
This minor release comes with various bug fixes and improvements.
|
||||
|
||||
The chart [values schema](https://helm.sh/docs/topics/charts/#schema-files)
|
||||
validation can now be disabled for install and upgrade actions by setting
|
||||
`disableSchemaValidation` under `.spec.install` and `.spec.upgrade` of a
|
||||
`HelmRelease` object.
|
||||
|
||||
HelmReleases that result in failure during uninstall will now be retried until
|
||||
the uninstall succeeds without any error. See [handling failed
|
||||
uninstall](https://fluxcd.io/flux/components/helm/helmreleases/#handling-failed-uninstall)
|
||||
docs for various remediations based on the cause of the failure.
|
||||
|
||||
helm-controller in [sharded
|
||||
deployment](https://fluxcd.io/flux/installation/configuration/sharding/)
|
||||
configuration now supports cross-shard dependency check. This allows a
|
||||
HelmRelease to depend on other HelmReleases managed by different controller
|
||||
shards.
|
||||
|
||||
In addition, the Kubernetes dependencies have been updated to v1.31.1, Helm has
|
||||
been updated to v3.16.1 and various other controller dependencies have been
|
||||
updated to their latest version. The controller is now built with Go 1.23.
|
||||
|
||||
Fixes:
|
||||
- fix: remove digest check to never ignore helm uninstall errors
|
||||
[#1024](https://github.com/fluxcd/helm-controller/pull/1024)
|
||||
- Allow overwriting inline values with targetPath
|
||||
[#1060](https://github.com/fluxcd/helm-controller/pull/1060)
|
||||
- Fix incorrect use of format strings with the conditions package
|
||||
[#1025](https://github.com/fluxcd/helm-controller/pull/1025)
|
||||
- Re-enable logging json patch on StatusDrifted
|
||||
[#1010](https://github.com/fluxcd/helm-controller/pull/1010)
|
||||
- Ignore 'v' version prefix in OCI artifact and Helm chart
|
||||
[#990](https://github.com/fluxcd/helm-controller/pull/990)
|
||||
- doc: fix HelmRelease default value for .spec.upgrade.crds
|
||||
[#986](https://github.com/fluxcd/helm-controller/pull/986)
|
||||
|
||||
Improvements:
|
||||
- Allow cross-shard dependency check
|
||||
[#1070](https://github.com/fluxcd/helm-controller/pull/1070)
|
||||
- Add disableSchemaValidation to Helm install/upgrade actions
|
||||
[#1068](https://github.com/fluxcd/helm-controller/pull/1068)
|
||||
- Update Helm to v3.16.1 and enable the adoption of existing resources
|
||||
[#1062](https://github.com/fluxcd/helm-controller/pull/1062)
|
||||
- Build with Go 1.23
|
||||
[#1049](https://github.com/fluxcd/helm-controller/pull/1049)
|
||||
- Various dependency updates
|
||||
[#987](https://github.com/fluxcd/helm-controller/pull/987)
|
||||
[#991](https://github.com/fluxcd/helm-controller/pull/991)
|
||||
[#994](https://github.com/fluxcd/helm-controller/pull/994)
|
||||
[#1004](https://github.com/fluxcd/helm-controller/pull/1004)
|
||||
[#1046](https://github.com/fluxcd/helm-controller/pull/1046)
|
||||
[#1048](https://github.com/fluxcd/helm-controller/pull/1048)
|
||||
[#1052](https://github.com/fluxcd/helm-controller/pull/1052)
|
||||
[#1064](https://github.com/fluxcd/helm-controller/pull/1064)
|
||||
[#1072](https://github.com/fluxcd/helm-controller/pull/1072)
|
||||
[#1073](https://github.com/fluxcd/helm-controller/pull/1073)
|
||||
|
||||
## 1.0.1
|
||||
|
||||
**Release date:** 2024-05-10
|
||||
|
||||
This patch release fixes a backwards compatibility issue that could occur when trying
|
||||
to move from the `v2beta1` to `v2` API while specifing `.spec.chartRef`.
|
||||
|
||||
Fixes:
|
||||
- Fix: Allow upgrading from v2beta1 to v2 (GA)
|
||||
[#982](https://github.com/fluxcd/helm-controller/pull/982)
|
||||
- Fix: Make HelmChartTemplate a pointer in .spec.chart
|
||||
[#980](https://github.com/fluxcd/helm-controller/pull/980)
|
||||
|
||||
## 1.0.0
|
||||
|
||||
**Release date:** 2024-05-08
|
||||
|
||||
This is the general availability release of helm-controller. From now on, this controller
|
||||
follows the [Flux release cadence and support pledge](https://fluxcd.io/flux/releases/).
|
||||
|
||||
This release promotes the `HelmRelease` API from `v2beta2` to `v2` (GA), and
|
||||
comes with new features, improvements and bug fixes.
|
||||
|
||||
In addition, the controller has been updated to Kubernetes v1.30.0,
|
||||
Helm v3.14.4, and various other dependencies to their latest version
|
||||
to patch upstream CVEs.
|
||||
|
||||
### Highlights
|
||||
|
||||
The `helm.toolkit.fluxcd.io/v2` API comes with a new field
|
||||
[`.spec.chartRef`](https://github.com/fluxcd/helm-controller/blob/release-v1.0.0-rc.1/docs/spec/v2/helmreleases.md#chart-reference)
|
||||
that adds support for referencing `OCIRepository` and `HelmChart` objects in a `HelmRelease`.
|
||||
When using `.spec.chartRef` instead of `.spec.chart`, the controller allows the reuse
|
||||
of a Helm chart version across multiple `HelmRelease` resources.
|
||||
|
||||
The notification mechanism has been improved to provide more detailed metadata
|
||||
in the notification payload. The controller now annotates the Kubernetes events with
|
||||
the `appVersion` and `version` of the Helm chart, and the `oci digest` of the
|
||||
chart artifact when available.
|
||||
|
||||
### Helm OCI support
|
||||
|
||||
Starting with this version, the recommended way of referencing Helm charts stored
|
||||
in container registries is through [OCIRepository](https://fluxcd.io/flux/components/source/ocirepositories/).
|
||||
|
||||
The `OCIRepository` provides more flexibility in managing Helm charts,
|
||||
as it allows targeting a Helm chart version by `tag`, `semver` or OCI `digest`.
|
||||
It also provides a way to
|
||||
[filter semver tags](https://github.com/fluxcd/source-controller/blob/release/v1.3.x/docs/spec/v1beta2/ocirepositories.md#semverfilter-example),
|
||||
allowing targeting a specific version range e.g. pre-releases only, patch versions, etc.
|
||||
|
||||
Using `OCIRepository` objects instead of `HelmRepository` and `HelmChart` objects
|
||||
improves the controller's performance and simplifies the debugging process.
|
||||
If a chart version gets overwritten in the container registry, the controller
|
||||
will detect the change in the upstream OCI digest and reconcile the `HelmRelease`
|
||||
resources accordingly.
|
||||
[Promoting](https://fluxcd.io/flux/use-cases/gh-actions-helm-promotion/)
|
||||
a Helm chart version to production can be done by pinning the `OCIRepository`
|
||||
to an immutable digest, ensuring that the chart version is not changed unintentionally.
|
||||
|
||||
Helm OCI example:
|
||||
|
||||
```yaml
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: default
|
||||
spec:
|
||||
interval: 10m
|
||||
layerSelector:
|
||||
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
|
||||
operation: copy
|
||||
url: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
ref:
|
||||
semver: "*"
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: default
|
||||
spec:
|
||||
interval: 10m
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: podinfo
|
||||
```
|
||||
|
||||
#### API changes
|
||||
|
||||
The `helm.toolkit.fluxcd.io` CRD contains the following versions:
|
||||
- v2 (storage version)
|
||||
- v2beta2 (deprecated)
|
||||
- v2beta1 (deprecated)
|
||||
|
||||
New optional fields have been added to the `HelmRelease` API:
|
||||
|
||||
- `.spec.chartRef` allows referencing chart artifacts from `OCIRepository` and `HelmChart` objects.
|
||||
- `.spec.chart.spec.ignoreMissingValuesFiles` allows ignoring missing values files instead of failing to reconcile.
|
||||
|
||||
Deprecated fields have been removed from the `HelmRelease` API:
|
||||
|
||||
- `.spec.chart.spec.valuesFile` replaced by `.spec.chart.spec.valuesFiles`
|
||||
- `.spec.postRenderers.kustomize.patchesJson6902` replaced by `.spec.postRenderers.kustomize.patches`
|
||||
- `.spec.postRenderers.kustomize.patchesStrategicMerge` replaced by `.spec.postRenderers.kustomize.patches`
|
||||
- `.status.lastAppliedRevision` replaced by `.status.history.chartVersion`
|
||||
|
||||
#### Upgrade procedure
|
||||
|
||||
1. Before upgrading the controller, ensure that the `HelmRelease` v2beta2 manifests stored in Git
|
||||
are not using the deprecated fields. Search for `valuesFile` and replace it with `valuesFiles`,
|
||||
replace `patchesJson6902` and `patchesStrategicMerge` with `patches`.
|
||||
Commit and push the changes to the Git repository, then wait for Flux to reconcile the changes.
|
||||
2. Upgrade the controller and CRDs to v1.0.0 on the cluster using Flux v2.3 release.
|
||||
Note that helm-controller v1.0.0 requires source-controller v1.3.0.
|
||||
3. Update the `apiVersion` field of the `HelmRelease` resources to `helm.toolkit.fluxcd.io/v2`,
|
||||
commit and push the changes to the Git repository.
|
||||
|
||||
Bumping the API version in manifests can be done gradually.
|
||||
It is advised to not delay this procedure as the beta versions will be removed after 6 months.
|
||||
|
||||
### Full changelog
|
||||
|
||||
Improvements:
|
||||
- Add the chart app version to status and events metadata
|
||||
[#968](https://github.com/fluxcd/helm-controller/pull/968)
|
||||
- Promote HelmRelease API to v2 (GA)
|
||||
[#963](https://github.com/fluxcd/helm-controller/pull/963)
|
||||
- Add `.spec.ignoreMissingValuesFiles` to HelmChartTemplate API
|
||||
[#942](https://github.com/fluxcd/helm-controller/pull/942)
|
||||
- Update HelmChart API to v1 (GA)
|
||||
[#962](https://github.com/fluxcd/helm-controller/pull/962)
|
||||
- Update dependencies to Kubernetes 1.30.0
|
||||
[#944](https://github.com/fluxcd/helm-controller/pull/944)
|
||||
- Add support for HelmChart to `.spec.chartRef`
|
||||
[#945](https://github.com/fluxcd/helm-controller/pull/945)
|
||||
- Add support for OCIRepository to `.spec.chartRef`
|
||||
[#905](https://github.com/fluxcd/helm-controller/pull/905)
|
||||
- Update dependencies to Kustomize v5.4.0
|
||||
[#932](https://github.com/fluxcd/helm-controller/pull/932)
|
||||
- Add notation verification provider to API
|
||||
[#930](https://github.com/fluxcd/helm-controller/pull/930)
|
||||
- Update controller to Helm v3.14.3 and Kubernetes v1.29.0
|
||||
[#879](https://github.com/fluxcd/helm-controller/pull/879)
|
||||
- Update controller-gen to v0.14.0
|
||||
[#910](https://github.com/fluxcd/helm-controller/pull/910)
|
||||
|
||||
Fixes:
|
||||
- Track changes in `.spec.postRenderers`
|
||||
[#965](https://github.com/fluxcd/helm-controller/pull/965)
|
||||
- Update Ready condition during drift correction
|
||||
[#885](https://github.com/fluxcd/helm-controller/pull/885)
|
||||
- Fix patching on drift detection
|
||||
[#935](https://github.com/fluxcd/helm-controller/pull/935)
|
||||
- Use corev1 event type for sending events
|
||||
[#908](https://github.com/fluxcd/helm-controller/pull/908)
|
||||
- Reintroduce missing events for helmChart reconciliation failures
|
||||
[#907](https://github.com/fluxcd/helm-controller/pull/907)
|
||||
- Remove `genclient:Namespaced` tag
|
||||
[#901](https://github.com/fluxcd/helm-controller/pull/901)
|
||||
|
||||
## 0.37.4
|
||||
|
||||
**Release date:** 2024-02-05
|
||||
|
||||
This prerelease comes with improvements in the HelmRelease status reporting.
|
||||
After recovering from a reconciliation failure, sometimes the status may show
|
||||
stale conditions which could be misleading. This has been fixed by ensuring that
|
||||
the stale failure conditions get updated after failure recovery.
|
||||
|
||||
Improvements:
|
||||
- Remove stale Ready=False conditions value to show more accurate status
|
||||
[#884](https://github.com/fluxcd/helm-controller/pull/884)
|
||||
- Dependency update
|
||||
[#886](https://github.com/fluxcd/helm-controller/pull/886)
|
||||
|
||||
## 0.37.3
|
||||
|
||||
**Release date:** 2024-02-01
|
||||
|
||||
This prerelease comes with an update to the Kubernetes dependencies to
|
||||
v1.28.6 and various other dependencies have been updated to their latest version
|
||||
to patch upstream CVEs.
|
||||
|
||||
In addition, the controller is now built with Go 1.21.
|
||||
|
||||
Improvements:
|
||||
- ci: Enable dependabot gomod updates
|
||||
[#874](https://github.com/fluxcd/helm-controller/pull/874)
|
||||
- Update Go to 1.21
|
||||
[#872](https://github.com/fluxcd/helm-controller/pull/872)
|
||||
- Various dependency updates
|
||||
[#882](https://github.com/fluxcd/helm-controller/pull/882)
|
||||
[#877](https://github.com/fluxcd/helm-controller/pull/877)
|
||||
[#876](https://github.com/fluxcd/helm-controller/pull/876)
|
||||
[#871](https://github.com/fluxcd/helm-controller/pull/871)
|
||||
[#867](https://github.com/fluxcd/helm-controller/pull/867)
|
||||
[#865](https://github.com/fluxcd/helm-controller/pull/865)
|
||||
[#862](https://github.com/fluxcd/helm-controller/pull/862)
|
||||
[#860](https://github.com/fluxcd/helm-controller/pull/860)
|
||||
|
||||
## 0.37.2
|
||||
|
||||
This prerelease fixes a bug that resulted in the controller not being able to
|
||||
properly watch HelmRelease resources with specific labels.
|
||||
|
||||
Fixes:
|
||||
- Properly configure namespace selector
|
||||
[#858](https://github.com/fluxcd/helm-controller/pull/858)
|
||||
|
||||
Improvements:
|
||||
- build(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
|
||||
[#856](https://github.com/fluxcd/helm-controller/pull/856)
|
||||
|
||||
## 0.37.1
|
||||
|
||||
This prerelease fixes a backwards compatibility issue that could occur when
|
||||
trying to move from the `v2beta1` to `v2beta2` API while enabling drift
|
||||
detection.
|
||||
|
||||
In addition, logging has been improved to provide faster feedback on any
|
||||
HTTP errors encountered while fetching HelmChart artifacts, and the controller
|
||||
will now set the `Stalled` condition as soon as it detects to be out of retries
|
||||
without having to wait for the next reconciliation.
|
||||
|
||||
Lastly, Helm has been updated to v3.13.3.
|
||||
|
||||
Fixes:
|
||||
- loader: allow overwrite of URL hostname again
|
||||
[#844](https://github.com/fluxcd/helm-controller/pull/844)
|
||||
- api: ensure backwards compatibility v2beta1
|
||||
[#851](https://github.com/fluxcd/helm-controller/pull/851)
|
||||
|
||||
Improvements:
|
||||
- loader: log HTTP errors to provide faster feedback
|
||||
[#845](https://github.com/fluxcd/helm-controller/pull/845)
|
||||
- Update runtime to v0.43.3
|
||||
[#846](https://github.com/fluxcd/helm-controller/pull/846)
|
||||
- Early stall condition detection after remediation
|
||||
[#848](https://github.com/fluxcd/helm-controller/pull/848)
|
||||
- Update Helm to v3.13.3
|
||||
[#849](https://github.com/fluxcd/helm-controller/pull/849)
|
||||
|
||||
## 0.37.0
|
||||
|
||||
**Release date:** 2023-12-12
|
||||
|
||||
This prerelease promotes the `HelmRelease` API from `v2beta1` to `v2beta2`.
|
||||
The promotion of the API is accompanied by a number of new features and bug
|
||||
fixes. Refer to the highlights section below for more information.
|
||||
|
||||
In addition to the API promotion, this prerelease updates the controller
|
||||
dependencies to their latest versions. Making the controller compatible with
|
||||
Kubernetes v1.28.x, while updating the Helm library to v3.13.2, and the builtin
|
||||
version of Kustomize used for post-rendering to v5.3.0.
|
||||
|
||||
Lastly, the base controller image has been updated to Alpine v3.19.
|
||||
|
||||
### Highlights
|
||||
|
||||
#### API changes
|
||||
|
||||
The upgrade is backwards compatible, and the controller will continue to
|
||||
reconcile `HelmRelease` resources of the `v2beta1` API without requiring any
|
||||
changes. However, making use of the new features requires upgrading the API
|
||||
version.
|
||||
|
||||
- Drift detection and correction is now enabled on a per-release basis using
|
||||
the `.spec.driftDetection.mode` field. Refer to the [drift detection section](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md#drift-detection)
|
||||
in the `v2beta2` specification for more information.
|
||||
- Ignoring specific fields during drift detection and correction is now
|
||||
supported using the `.spec.driftDetection.ignore` field. Refer to the
|
||||
[ignore rules section](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md#ignore-rules)
|
||||
in the `v2beta2` specification to learn more.
|
||||
- Helm tests can now be selectively run using the `.spec.test.filters` field.
|
||||
Refer to the [test filters section](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md#filtering-tests)
|
||||
in the `v2beta2` specification for more details.
|
||||
- The controller now offers proper integration with [`kstatus`](https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/kstatus/README.md)
|
||||
and sets `Reconciling` and `Stalled` conditions. See the [Conditions section](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md#conditions)
|
||||
in the `v2beta2` specification to read more about the conditions.
|
||||
- The `.spec.maxHistory` default value has been lowered from `10` to `5` to
|
||||
increase the controller's performance.
|
||||
- A history of metadata from Helm releases up to the previous successful release
|
||||
is now available in the `.status.history` field. This includes any Helm test
|
||||
results when enabled.
|
||||
- The `.patchesStrategicMerge` and `.patchesJson6902` Kustomize post-rendering
|
||||
fields have been deprecated in favor of `.patches`.
|
||||
- A `status.lastAttemptedConfigDigest` field has been introduced to track the
|
||||
last attempted configuration digest using a hash of the composed values.
|
||||
- A `.status.lastAttemptedReleaseAction` field has been introduced to accurately
|
||||
determine the active remediation strategy.
|
||||
- The `.status.lastHandledForceAt` and `.status.lastHandledResetAt` fields have
|
||||
been introduced to track the last time a force upgrade or reset was handled.
|
||||
This to accomadate newly introduced annotations to force upgrades and resets.
|
||||
- The `.status.lastAppliedRevision` and `.status.lastReleaseRevision` fields
|
||||
have been deprecated in favor of `.status.history`.
|
||||
- The `.status.lastAttemptedValuesChecksum` has been deprecated in favor of
|
||||
`.status.lastAttemptedConfigDigest`.
|
||||
|
||||
Although the `v2beta1` API is still supported, it is recommended to upgrade to
|
||||
the `v2beta2` API as soon as possible. The `v2beta1` API will be removed after
|
||||
6 months.
|
||||
|
||||
To upgrade to the `v2beta2` API, update the `apiVersion` field of your
|
||||
`HelmRelease` resources to `helm.toolkit.fluxcd.io/v2beta2` after updating the
|
||||
controller and Custom Resource Definitions.
|
||||
|
||||
#### Other notable improvements
|
||||
|
||||
- The reconciliation model of the controller has been improved to be able to
|
||||
better determine the state a Helm release is in. An example of this is that
|
||||
enabling Helm tests will not require a Helm upgrade to be run, but instead
|
||||
will run immediately if the release is in a `deployed` state already.
|
||||
- The controller will detect Helm releases in a `pending-install`, `pending-upgrade`
|
||||
or `pending-rollback` state, and wil forcefully unlock the release (to a
|
||||
`failed` state) to allow the controller to reattempt the release.
|
||||
- When drift correction is enabled, the controller will now attempt to correct
|
||||
drift it detects by creating and patching Kubernetes resources instead of
|
||||
running a Helm upgrade.
|
||||
- The controller emits more detailed Kubernetes Events after running a Helm
|
||||
action. In addition, the controller will now emit a Kubernetes Event when
|
||||
a Helm release is uninstalled.
|
||||
- The controller provides richer Condition messages before and after running a
|
||||
Helm action.
|
||||
- Changes to a HelmRelease `.spec` which require a Helm uninstall for the
|
||||
changes to be successfully applied are now detected. For example, a change in
|
||||
`.spec.targetNamespace` or `.spec.releaseName`.
|
||||
- When the release name exceeds the maximum length of 53 characters, the
|
||||
controller will now truncate the release name to 40 characters and append a
|
||||
short SHA256 hash of the release name prefixed with a `-` to ensure the
|
||||
release name is unique.
|
||||
- New annotations have been introduced to force a Helm upgrade or to reset the
|
||||
number of retries for a release. Refer to the [forcing a release](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md#forcing-a-release)
|
||||
and [resetting remediation retries](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md#resetting-remediation-retries)
|
||||
sections in the `v2beta2` specification for more information.
|
||||
- The digest algorithm used to calculate the digest of the composed values and
|
||||
hash of the release object can now be configured using the `--snapshot-digest-algo`
|
||||
controller flag. The default value is `sha256`.
|
||||
- When the `HelmChart` resource for a `HelmRelease` is not `Ready`, the
|
||||
Conditions of the `HelmRelease` will now contain more detailed information
|
||||
about the reason.
|
||||
|
||||
To get a full overview of all changes, and see examples of the new features.
|
||||
Please refer to the [v2beta2 specification](https://github.com/fluxcd/helm-controller/blob/v0.37.0/docs/spec/v2beta2/helmreleases.md).
|
||||
|
||||
### Full changelog
|
||||
|
||||
Improvements:
|
||||
- Update dependencies
|
||||
[#791](https://github.com/fluxcd/helm-controller/pull/791)
|
||||
[#792](https://github.com/fluxcd/helm-controller/pull/792)
|
||||
[#799](https://github.com/fluxcd/helm-controller/pull/799)
|
||||
[#812](https://github.com/fluxcd/helm-controller/pull/812)
|
||||
- Update source-controller dependency to v1.2.1
|
||||
[#793](https://github.com/fluxcd/helm-controller/pull/793)
|
||||
[#835](https://github.com/fluxcd/helm-controller/pull/835)
|
||||
- Rework `HelmRelease` reconciliation logic
|
||||
[#738](https://github.com/fluxcd/helm-controller/pull/738)
|
||||
[#816](https://github.com/fluxcd/helm-controller/pull/816)
|
||||
[#825](https://github.com/fluxcd/helm-controller/pull/825)
|
||||
[#829](https://github.com/fluxcd/helm-controller/pull/829)
|
||||
[#830](https://github.com/fluxcd/helm-controller/pull/830)
|
||||
[#833](https://github.com/fluxcd/helm-controller/pull/833)
|
||||
[#836](https://github.com/fluxcd/helm-controller/pull/836)
|
||||
- Update Kubernetes 1.28.x, Helm v3.13.2 and Kustomize v5.3.0
|
||||
[#817](https://github.com/fluxcd/helm-controller/pull/817)
|
||||
[#839](https://github.com/fluxcd/helm-controller/pull/839)
|
||||
- Allow configuration of drift detection on `HelmRelease`
|
||||
[#815](https://github.com/fluxcd/helm-controller/pull/815)
|
||||
- Allow configuration of snapshot digest algorithm
|
||||
[#818](https://github.com/fluxcd/helm-controller/pull/818)
|
||||
- Remove obsolete code and tidy things
|
||||
[#819](https://github.com/fluxcd/helm-controller/pull/819)
|
||||
- Add deprecation warning to v2beta1 API
|
||||
[#821](https://github.com/fluxcd/helm-controller/pull/821)
|
||||
- Correct cluster drift using patches
|
||||
[#822](https://github.com/fluxcd/helm-controller/pull/822)
|
||||
- Introduce `forceAt` and `resetAt` annotations
|
||||
[#823](https://github.com/fluxcd/helm-controller/pull/823)
|
||||
- doc/spec: document `v2beta2` API
|
||||
[#828](https://github.com/fluxcd/helm-controller/pull/828)
|
||||
- api: deprecate stategic merge and JSON 6902 patches
|
||||
[#832](https://github.com/fluxcd/helm-controller/pull/832)
|
||||
- controller: enrich "HelmChart not ready" messages
|
||||
[#834](https://github.com/fluxcd/helm-controller/pull/834)
|
||||
- build: update Alpine to 3.19
|
||||
[#838](https://github.com/fluxcd/helm-controller/pull/838)
|
||||
|
||||
## 0.36.2
|
||||
|
||||
**Release date:** 2023-10-11
|
||||
|
||||
This prerelease contains an improvement to retry the reconciliation of a
|
||||
`HelmRelease` as soon as the chart is available in storage, instead of waiting
|
||||
for the next reconciliation interval. Which is particularly useful when the
|
||||
source-controller has just been upgraded.
|
||||
|
||||
In addition, it fixes a bug in which the controller would not properly label
|
||||
Custom Resource Definitions.
|
||||
|
||||
Fixes:
|
||||
- runner: ensure CRDs are properly labeled
|
||||
[#781](https://github.com/fluxcd/helm-controller/pull/781)
|
||||
- fix: retry failed releases when charts are available in storage
|
||||
[#785](https://github.com/fluxcd/helm-controller/pull/785)
|
||||
|
||||
Improvements:
|
||||
- Address typo in documentation
|
||||
[#777](https://github.com/fluxcd/helm-controller/pull/777)
|
||||
- Update CI dependencies
|
||||
[#783](https://github.com/fluxcd/helm-controller/pull/783)
|
||||
[#786](https://github.com/fluxcd/helm-controller/pull/786)
|
||||
- Address miscellaneous issues throughout code base
|
||||
[#788](https://github.com/fluxcd/helm-controller/pull/788)
|
||||
|
||||
## 0.36.1
|
||||
|
||||
**Release date:** 2023-09-18
|
||||
|
||||
This prerelease addresses a regression in which the captured Helm logs used in
|
||||
a failure event would not include Helm's Kubernetes client logs, making it more
|
||||
difficult to reason about e.g. timeout errors.
|
||||
|
||||
In addition, it contains a fix for the default service account used for the
|
||||
(experimental) differ, and dependency updates of several dependencies.
|
||||
|
||||
Fixes:
|
||||
- runner: address regression in captured Helm logs
|
||||
[#767](https://github.com/fluxcd/helm-controller/pull/767)
|
||||
- Check source for nil artifact before loading chart
|
||||
[#768](https://github.com/fluxcd/helm-controller/pull/768)
|
||||
- controller: use `DefaultServiceAccount` in differ
|
||||
[#774](https://github.com/fluxcd/helm-controller/pull/774)
|
||||
|
||||
Improvements:
|
||||
- build(deps): bump the ci group dependencies
|
||||
[#761](https://github.com/fluxcd/helm-controller/pull/761)
|
||||
[#762](https://github.com/fluxcd/helm-controller/pull/762)
|
||||
[#766](https://github.com/fluxcd/helm-controller/pull/766)
|
||||
[#773](https://github.com/fluxcd/helm-controller/pull/773)
|
||||
- build(deps): bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4
|
||||
[#764](https://github.com/fluxcd/helm-controller/pull/764)
|
||||
- Update source-controller to v1.1.1
|
||||
[#775](https://github.com/fluxcd/helm-controller/pull/775)
|
||||
|
||||
## 0.36.0
|
||||
|
||||
**Release date:** 2023-08-23
|
||||
|
||||
This prerelease introduces a `--interval-jitter-percentage` flag to the
|
||||
controller to distribute the load more evenly when multiple objects are set up
|
||||
with the same interval. The default of this flag is set to `5`, which means
|
||||
that the interval will be jittered by a +/- 5% random value (e.g. if the
|
||||
interval is 10 minutes, the actual reconciliation interval will be between 9.5
|
||||
and 10.5 minutes).
|
||||
|
||||
In addition, the controller now stops exporting an object's metrics as soon as
|
||||
it has been deleted.
|
||||
|
||||
Lastly, dependencies have been updated, such as an update of Helm to `v3.12.3`
|
||||
and Kubernetes related dependencies to `v0.27.4`.
|
||||
|
||||
Improvements:
|
||||
- Update dependencies
|
||||
[#748](https://github.com/fluxcd/helm-controller/pull/748)
|
||||
- controller: jitter requeue interval
|
||||
[#751](https://github.com/fluxcd/helm-controller/pull/751)
|
||||
- Delete stale metrics on delete
|
||||
[#753](https://github.com/fluxcd/helm-controller/pull/753)
|
||||
- Update Helm to v3.12.3
|
||||
[#754](https://github.com/fluxcd/helm-controller/pull/754)
|
||||
- Update Source API to v1.1.0
|
||||
[#758](https://github.com/fluxcd/helm-controller/pull/758)
|
||||
|
||||
Fixes:
|
||||
- chore: fix typo reconciliation
|
||||
[#736](https://github.com/fluxcd/helm-controller/pull/736)
|
||||
|
||||
## 0.35.0
|
||||
|
||||
**Release date:** 2023-07-04
|
||||
|
||||
This prerelease adds support for configuring the deletion propagation policy to
|
||||
use when a Helm uninstall is performed using `.spec.uninstall.deletionPropagation`,
|
||||
which was [added as a feature to Helm in `v3.12.0`](https://github.com/helm/helm/releases/tag/v3.12.0).
|
||||
Supported values are `background`, `foreground` and `orphan` (defaults to
|
||||
`background`). See the [Helm documentation](https://helm.sh/docs/chart_best_practices/deleting/#deletion-propagation)
|
||||
|
||||
In addition, it offers support for Kubernetes `v1.27.3` and includes updates to
|
||||
the controller's dependencies, such as an upgrade of Helm to `v3.12.1`.
|
||||
|
||||
Starting with this version, the build, release and provenance portions of the
|
||||
Flux project supply chain [provisionally meet SLSA Build Level 3](https://fluxcd.io/flux/security/slsa-assessment/).
|
||||
|
||||
Improvements:
|
||||
- Set deletion propagation for helm uninstall
|
||||
[#698](https://github.com/fluxcd/helm-controller/pull/698)
|
||||
- Align `go.mod` version with Kubernetes (Go 1.20)
|
||||
[#715](https://github.com/fluxcd/helm-controller/pull/715)
|
||||
- Update Go dependencies
|
||||
[#726](https://github.com/fluxcd/helm-controller/pull/726)
|
||||
- Update source-controller to v1.0.0
|
||||
[#729](https://github.com/fluxcd/helm-controller/pull/729)
|
||||
|
||||
## 0.34.2
|
||||
|
||||
**Release date:** 2023-06-22
|
||||
|
||||
This prerelease fixes a regression bug for long-running reconciliations introduced
|
||||
in v0.34.0.
|
||||
|
||||
In addition, the controller release workflow was enhanced with SLSA level 3 generators.
|
||||
Starting with this version, provenance attestations are generated for
|
||||
the controller release assets and for the multi-arch container images.
|
||||
|
||||
Fixes:
|
||||
- Fix HelmRelease reconciliation loop
|
||||
[#703](https://github.com/fluxcd/helm-controller/pull/703)
|
||||
|
||||
Improvements:
|
||||
- Add SLSA3 generators to release workflow
|
||||
[#705](https://github.com/fluxcd/helm-controller/pull/705)
|
||||
|
||||
## 0.34.1
|
||||
|
||||
**Release date:** 2023-06-01
|
||||
|
||||
This prerelease comes with a bug fix for the event metadata revision, which
|
||||
was not included when a token was already present.
|
||||
|
||||
In addition, the source-controller dependency has been updated to v1.0.0-rc.5.
|
||||
|
||||
Fixes:
|
||||
- Include revision and token in event metadata
|
||||
[#695](https://github.com/fluxcd/helm-controller/pull/695)
|
||||
|
||||
Improvements:
|
||||
- Update source-controller to v1.0.0-rc.5
|
||||
[#696](https://github.com/fluxcd/helm-controller/pull/696)
|
||||
|
||||
## 0.34.0
|
||||
|
||||
**Release date:** 2023-05-29
|
||||
|
|
|
@ -24,7 +24,7 @@ If any of the above dependencies are not present on your system, the first invoc
|
|||
## How to run the test suite
|
||||
|
||||
Prerequisites:
|
||||
* Go >= 1.24
|
||||
* Go >= 1.18
|
||||
|
||||
You can run the test suite by simply doing
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
ARG GO_VERSION=1.24
|
||||
ARG XX_VERSION=1.6.1
|
||||
ARG GO_VERSION=1.20
|
||||
ARG XX_VERSION=1.2.1
|
||||
|
||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||
|
||||
# Docker buildkit multi-arch build requires golang alpine
|
||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder
|
||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine as builder
|
||||
|
||||
# Copy the build utilities.
|
||||
COPY --from=xx / /
|
||||
|
@ -31,7 +31,7 @@ COPY internal/ internal/
|
|||
ENV CGO_ENABLED=0
|
||||
RUN xx-go build -trimpath -a -o helm-controller main.go
|
||||
|
||||
FROM alpine:3.21
|
||||
FROM alpine:3.18
|
||||
|
||||
RUN apk add --no-cache ca-certificates \
|
||||
&& update-ca-certificates
|
||||
|
|
39
Makefile
39
Makefile
|
@ -27,26 +27,15 @@ BUILD_PLATFORMS ?= linux/amd64
|
|||
# Architecture to use envtest with
|
||||
ENVTEST_ARCH ?= amd64
|
||||
|
||||
# Paths to download the CRD dependency to.
|
||||
CRD_DEP_ROOT ?= $(BUILD_DIR)/config/crd/bases
|
||||
|
||||
# Keep a record of the version of the downloaded source CRDs. It is used to
|
||||
# detect and download new CRDs when the SOURCE_VER changes.
|
||||
SOURCE_VER ?= $(shell go list -m all | grep github.com/fluxcd/source-controller/api | awk '{print $$2}')
|
||||
SOURCE_CRD_VER = $(CRD_DEP_ROOT)/.src-crd-$(SOURCE_VER)
|
||||
|
||||
# HelmChart source CRD.
|
||||
HELMCHART_SOURCE_CRD ?= $(CRD_DEP_ROOT)/source.toolkit.fluxcd.io_helmcharts.yaml
|
||||
|
||||
# API (doc) generation utilities
|
||||
CONTROLLER_GEN_VERSION ?= v0.16.1
|
||||
CONTROLLER_GEN_VERSION ?= v0.12.0
|
||||
GEN_API_REF_DOCS_VERSION ?= e327d0730470cbd61b06300f81c5fcf91c23c113
|
||||
|
||||
all: manager
|
||||
|
||||
# Run tests
|
||||
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
|
||||
test: tidy generate fmt vet manifests api-docs install-envtest download-crd-deps
|
||||
test: tidy generate fmt vet manifests api-docs install-envtest
|
||||
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) go test ./... -coverprofile cover.out
|
||||
cd api; go test ./... -coverprofile cover.out
|
||||
|
||||
|
@ -92,12 +81,12 @@ manifests: controller-gen
|
|||
|
||||
# Generate API reference documentation
|
||||
api-docs: gen-crd-api-reference-docs
|
||||
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v2 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/v2/helm.md
|
||||
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v2beta1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/helmrelease.md
|
||||
|
||||
# Run go mod tidy
|
||||
tidy:
|
||||
cd api; rm -f go.sum; go mod tidy -compat=1.23
|
||||
rm -f go.sum; go mod tidy -compat=1.23
|
||||
cd api; rm -f go.sum; go mod tidy -compat=1.20
|
||||
rm -f go.sum; go mod tidy -compat=1.20
|
||||
|
||||
# Run go fmt against code
|
||||
fmt:
|
||||
|
@ -124,24 +113,6 @@ docker-build:
|
|||
docker-push:
|
||||
docker push ${IMG}
|
||||
|
||||
# Delete previously downloaded CRDs and record the new version of the source
|
||||
# CRDs.
|
||||
$(SOURCE_CRD_VER):
|
||||
rm -f $(CRD_DEP_ROOT)/.src-crd*
|
||||
mkdir -p $(CRD_DEP_ROOT)
|
||||
$(MAKE) cleanup-crd-deps
|
||||
touch $(SOURCE_CRD_VER)
|
||||
|
||||
$(HELMCHART_SOURCE_CRD):
|
||||
curl -s https://raw.githubusercontent.com/fluxcd/source-controller/${SOURCE_VER}/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml > $(HELMCHART_SOURCE_CRD)
|
||||
|
||||
# Download the CRDs the controller depends on
|
||||
download-crd-deps: $(SOURCE_CRD_VER) $(HELMCHART_SOURCE_CRD)
|
||||
|
||||
# Delete the downloaded CRD dependencies.
|
||||
cleanup-crd-deps:
|
||||
rm -f $(HELMCHART_SOURCE_CRD)
|
||||
|
||||
# Find or download controller-gen
|
||||
CONTROLLER_GEN = $(GOBIN)/controller-gen
|
||||
.PHONY: controller-gen
|
||||
|
|
7
PROJECT
7
PROJECT
|
@ -4,11 +4,4 @@ resources:
|
|||
- group: helm
|
||||
kind: HelmRelease
|
||||
version: v2beta1
|
||||
- group: helm
|
||||
kind: HelmRelease
|
||||
version: v2beta2
|
||||
- group: helm
|
||||
kind: HelmRelease
|
||||
version: v2
|
||||
storageVersion: v2
|
||||
version: "2"
|
||||
|
|
|
@ -24,7 +24,7 @@ operator.
|
|||
* Supports `HelmChart` artifacts produced from `HelmRepository`,
|
||||
`GitRepository` and `Bucket` sources
|
||||
* Fetches artifacts produced by [source-controller][] from `HelmChart`
|
||||
and `OCIRepository` objects
|
||||
objects
|
||||
* Watches `HelmChart` objects for revision changes (including semver
|
||||
ranges for charts from `HelmRepository` sources)
|
||||
* Performs automated Helm actions, including Helm tests, rollbacks and
|
||||
|
@ -38,18 +38,16 @@ operator.
|
|||
[notification-controller][])
|
||||
* Built-in Kustomize compatible Helm post renderer, providing support
|
||||
for strategic merge, JSON 6902 and images patches
|
||||
* Supports detecting and correcting in-cluster changes compared to the desired
|
||||
state of the Helm release
|
||||
|
||||
## Guides
|
||||
|
||||
* [Get started with Flux](https://fluxcd.io/flux/get-started/)
|
||||
* [Get started with GitOps Toolkit](https://fluxcd.io/flux/get-started/)
|
||||
* [Manage Helm Releases](https://fluxcd.io/flux/guides/helmreleases/)
|
||||
* [Setup Notifications](https://fluxcd.io/flux/guides/notifications/)
|
||||
|
||||
## Specifications
|
||||
|
||||
* [API](docs/spec/v2/README.md)
|
||||
* [API](docs/spec/v2beta1/README.md)
|
||||
* [Controller](docs/spec/README.md)
|
||||
|
||||
[source-controller]: https://github.com/fluxcd/source-controller
|
||||
|
|
36
api/go.mod
36
api/go.mod
|
@ -1,33 +1,31 @@
|
|||
module github.com/fluxcd/helm-controller/api
|
||||
|
||||
go 1.24.0
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.11.0
|
||||
github.com/fluxcd/pkg/apis/meta v1.18.0
|
||||
k8s.io/apiextensions-apiserver v0.33.2
|
||||
k8s.io/apimachinery v0.33.2
|
||||
sigs.k8s.io/controller-runtime v0.21.0
|
||||
sigs.k8s.io/yaml v1.5.0
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.1.0
|
||||
github.com/fluxcd/pkg/apis/meta v1.1.0
|
||||
k8s.io/apiextensions-apiserver v0.27.2
|
||||
k8s.io/apimachinery v0.27.2
|
||||
sigs.k8s.io/controller-runtime v0.15.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.2.4 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
golang.org/x/net v0.41.0 // indirect
|
||||
golang.org/x/text v0.27.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.10.0 // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
k8s.io/klog/v2 v2.90.1 // indirect
|
||||
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
)
|
||||
|
|
108
api/go.sum
108
api/go.sum
|
@ -2,30 +2,30 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.11.0 h1:0IzDgxZkc4v+5SDNCvgZhfwfkdkQLPXCner7TNaJFWE=
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.11.0/go.mod h1:j302mJGDww8cn9qvMsRQ0LJ1HPAPs/IlX7CSsoJV7BI=
|
||||
github.com/fluxcd/pkg/apis/meta v1.18.0 h1:ACHrMIjlcioE9GKS7NGk62KX4NshqNewr8sBwMcXABs=
|
||||
github.com/fluxcd/pkg/apis/meta v1.18.0/go.mod h1:97l3hTwBpJbXBY+wetNbqrUsvES8B1jGioKcBUxmqd8=
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU=
|
||||
github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.1.0 h1:Fbv4dCB57r2+fiusozN7at8r7upTz58Z4wWw1njHPyU=
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.1.0/go.mod h1:CAe9Mjf9KVoTm1V4wpvq/FGXFDSnpBwfww/IG7mw3gM=
|
||||
github.com/fluxcd/pkg/apis/meta v1.1.0 h1:vYU1mvUzztnQyTzZOLHQ3wm/tXd7E1QZ2V91zuVJPsQ=
|
||||
github.com/fluxcd/pkg/apis/meta v1.1.0/go.mod h1:/QwCotRKL/BT6RSa4O75FlYW14fU8eRfKnoagzbkmL4=
|
||||
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
|
||||
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
|
||||
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
|
@ -33,30 +33,20 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
|||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
|
||||
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
|
||||
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
|
||||
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
|
||||
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
|
||||
github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
|
||||
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
|
||||
go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE=
|
||||
go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
|
@ -66,26 +56,24 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
|
|||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
|
||||
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
|
||||
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
||||
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
|
||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
|
||||
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
|
||||
golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
@ -95,27 +83,23 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
|
|||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.33.2 h1:YgwIS5jKfA+BZg//OQhkJNIfie/kmRsO0BmNaVSimvY=
|
||||
k8s.io/api v0.33.2/go.mod h1:fhrbphQJSM2cXzCWgqU29xLDuks4mu7ti9vveEnpSXs=
|
||||
k8s.io/apiextensions-apiserver v0.33.2 h1:6gnkIbngnaUflR3XwE1mCefN3YS8yTD631JXQhsU6M8=
|
||||
k8s.io/apiextensions-apiserver v0.33.2/go.mod h1:IvVanieYsEHJImTKXGP6XCOjTwv2LUMos0YWc9O+QP8=
|
||||
k8s.io/apimachinery v0.33.2 h1:IHFVhqg59mb8PJWTLi8m1mAoepkUNYmptHsV+Z1m5jY=
|
||||
k8s.io/apimachinery v0.33.2/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
|
||||
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ=
|
||||
sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4=
|
||||
k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo=
|
||||
k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo=
|
||||
k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ=
|
||||
k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg=
|
||||
k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
|
||||
k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
|
||||
k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
||||
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
|
||||
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
|
||||
sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
|
||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
import "github.com/fluxcd/pkg/apis/meta"
|
||||
|
||||
const (
|
||||
// ForceRequestAnnotation is the annotation used for triggering a one-off forced
|
||||
// Helm release, even when there are no new changes in the HelmRelease.
|
||||
// The value is interpreted as a token, and must equal the value of
|
||||
// meta.ReconcileRequestAnnotation in order to trigger a release.
|
||||
ForceRequestAnnotation string = meta.ForceRequestAnnotation
|
||||
|
||||
// ResetRequestAnnotation is the annotation used for resetting the failure counts
|
||||
// of a HelmRelease, so that it can be retried again.
|
||||
// The value is interpreted as a token, and must equal the value of
|
||||
// meta.ReconcileRequestAnnotation in order to reset the failure counts.
|
||||
ResetRequestAnnotation string = "reconcile.fluxcd.io/resetAt"
|
||||
)
|
||||
|
||||
// ShouldHandleResetRequest returns true if the HelmRelease has a reset request
|
||||
// annotation, and the value of the annotation matches the value of the
|
||||
// meta.ReconcileRequestAnnotation annotation.
|
||||
//
|
||||
// To ensure that the reset request is handled only once, the value of
|
||||
// HelmReleaseStatus.LastHandledResetAt is updated to match the value of the
|
||||
// reset request annotation (even if the reset request is not handled because
|
||||
// the value of the meta.ReconcileRequestAnnotation annotation does not match).
|
||||
func ShouldHandleResetRequest(obj *HelmRelease) bool {
|
||||
return meta.HandleAnnotationRequest(obj, ResetRequestAnnotation, &obj.Status.LastHandledResetAt)
|
||||
}
|
||||
|
||||
// ShouldHandleForceRequest returns true if the HelmRelease has a force request
|
||||
// annotation, and the value of the annotation matches the value of the
|
||||
// meta.ReconcileRequestAnnotation annotation.
|
||||
//
|
||||
// To ensure that the force request is handled only once, the value of
|
||||
// HelmReleaseStatus.LastHandledForceAt is updated to match the value of the
|
||||
// force request annotation (even if the force request is not handled because
|
||||
// the value of the meta.ReconcileRequestAnnotation annotation does not match).
|
||||
func ShouldHandleForceRequest(obj *HelmRelease) bool {
|
||||
return meta.ShouldHandleForceRequest(obj)
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
)
|
||||
|
||||
func TestShouldHandleResetRequest(t *testing.T) {
|
||||
obj := &HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
ResetRequestAnnotation: "b",
|
||||
},
|
||||
},
|
||||
Status: HelmReleaseStatus{
|
||||
LastHandledResetAt: "a",
|
||||
ReconcileRequestStatus: meta.ReconcileRequestStatus{
|
||||
LastHandledReconcileAt: "a",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if !ShouldHandleResetRequest(obj) {
|
||||
t.Error("ShouldHandleResetRequest() = false")
|
||||
}
|
||||
|
||||
if obj.Status.LastHandledResetAt != "b" {
|
||||
t.Error("ShouldHandleResetRequest did not update LastHandledResetAt")
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
const (
|
||||
// ReleasedCondition represents the status of the last release attempt
|
||||
// (install/upgrade/test) against the latest desired state.
|
||||
ReleasedCondition string = "Released"
|
||||
|
||||
// TestSuccessCondition represents the status of the last test attempt against
|
||||
// the latest desired state.
|
||||
TestSuccessCondition string = "TestSuccess"
|
||||
|
||||
// RemediatedCondition represents the status of the last remediation attempt
|
||||
// (uninstall/rollback) due to a failure of the last release attempt against the
|
||||
// latest desired state.
|
||||
RemediatedCondition string = "Remediated"
|
||||
)
|
||||
|
||||
const (
|
||||
// InstallSucceededReason represents the fact that the Helm install for the
|
||||
// HelmRelease succeeded.
|
||||
InstallSucceededReason string = "InstallSucceeded"
|
||||
|
||||
// InstallFailedReason represents the fact that the Helm install for the
|
||||
// HelmRelease failed.
|
||||
InstallFailedReason string = "InstallFailed"
|
||||
|
||||
// UpgradeSucceededReason represents the fact that the Helm upgrade for the
|
||||
// HelmRelease succeeded.
|
||||
UpgradeSucceededReason string = "UpgradeSucceeded"
|
||||
|
||||
// UpgradeFailedReason represents the fact that the Helm upgrade for the
|
||||
// HelmRelease failed.
|
||||
UpgradeFailedReason string = "UpgradeFailed"
|
||||
|
||||
// TestSucceededReason represents the fact that the Helm tests for the
|
||||
// HelmRelease succeeded.
|
||||
TestSucceededReason string = "TestSucceeded"
|
||||
|
||||
// TestFailedReason represents the fact that the Helm tests for the HelmRelease
|
||||
// failed.
|
||||
TestFailedReason string = "TestFailed"
|
||||
|
||||
// RollbackSucceededReason represents the fact that the Helm rollback for the
|
||||
// HelmRelease succeeded.
|
||||
RollbackSucceededReason string = "RollbackSucceeded"
|
||||
|
||||
// RollbackFailedReason represents the fact that the Helm test for the
|
||||
// HelmRelease failed.
|
||||
RollbackFailedReason string = "RollbackFailed"
|
||||
|
||||
// UninstallSucceededReason represents the fact that the Helm uninstall for the
|
||||
// HelmRelease succeeded.
|
||||
UninstallSucceededReason string = "UninstallSucceeded"
|
||||
|
||||
// UninstallFailedReason represents the fact that the Helm uninstall for the
|
||||
// HelmRelease failed.
|
||||
UninstallFailedReason string = "UninstallFailed"
|
||||
|
||||
// ArtifactFailedReason represents the fact that the artifact download for the
|
||||
// HelmRelease failed.
|
||||
ArtifactFailedReason string = "ArtifactFailed"
|
||||
|
||||
// DependencyNotReadyReason represents the fact that
|
||||
// one of the dependencies is not ready.
|
||||
DependencyNotReadyReason string = "DependencyNotReady"
|
||||
)
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v2 contains API Schema definitions for the helm v2 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=helm.toolkit.fluxcd.io
|
||||
package v2
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
GroupVersion = schema.GroupVersion{Group: "helm.toolkit.fluxcd.io", Version: "v2"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
File diff suppressed because it is too large
Load Diff
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
// CrossNamespaceObjectReference contains enough information to let you locate
|
||||
// the typed referenced object at cluster level.
|
||||
type CrossNamespaceObjectReference struct {
|
||||
// APIVersion of the referent.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
|
||||
// Kind of the referent.
|
||||
// +kubebuilder:validation:Enum=HelmRepository;GitRepository;Bucket
|
||||
// +required
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// Name of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// CrossNamespaceSourceReference contains enough information to let you locate
|
||||
// the typed referenced object at cluster level.
|
||||
type CrossNamespaceSourceReference struct {
|
||||
// APIVersion of the referent.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
|
||||
// Kind of the referent.
|
||||
// +kubebuilder:validation:Enum=OCIRepository;HelmChart
|
||||
// +required
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Name of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the referent, defaults to the namespace of the Kubernetes
|
||||
// resource object that contains the reference.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// DependencyReference defines a HelmRelease dependency on another HelmRelease resource.
|
||||
type DependencyReference struct {
|
||||
// Name of the referent.
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the referent, defaults to the namespace of the HelmRelease
|
||||
// resource object that contains the reference.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// ReadyExpr is a CEL expression that can be used to assess the readiness
|
||||
// of a dependency. When specified, the built-in readiness check
|
||||
// is replaced by the logic defined in the CEL expression.
|
||||
// To make the CEL expression additive to the built-in readiness check,
|
||||
// the feature gate `AdditiveCELDependencyCheck` must be set to `true`.
|
||||
// +optional
|
||||
ReadyExpr string `json:"readyExpr,omitempty"`
|
||||
}
|
|
@ -1,239 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
// snapshotStatusDeployed indicates that the release the snapshot was taken
|
||||
// from is currently deployed.
|
||||
snapshotStatusDeployed = "deployed"
|
||||
// snapshotStatusSuperseded indicates that the release the snapshot was taken
|
||||
// from has been superseded by a newer release.
|
||||
snapshotStatusSuperseded = "superseded"
|
||||
|
||||
// snapshotTestPhaseFailed indicates that the test of the release the snapshot
|
||||
// was taken from has failed.
|
||||
snapshotTestPhaseFailed = "Failed"
|
||||
)
|
||||
|
||||
// Snapshots is a list of Snapshot objects.
|
||||
type Snapshots []*Snapshot
|
||||
|
||||
// Len returns the number of Snapshots.
|
||||
func (in Snapshots) Len() int {
|
||||
return len(in)
|
||||
}
|
||||
|
||||
// SortByVersion sorts the Snapshots by version, in descending order.
|
||||
func (in Snapshots) SortByVersion() {
|
||||
sort.Slice(in, func(i, j int) bool {
|
||||
return in[i].Version > in[j].Version
|
||||
})
|
||||
}
|
||||
|
||||
// Latest returns the most recent Snapshot.
|
||||
func (in Snapshots) Latest() *Snapshot {
|
||||
if len(in) == 0 {
|
||||
return nil
|
||||
}
|
||||
in.SortByVersion()
|
||||
return in[0]
|
||||
}
|
||||
|
||||
// Previous returns the most recent Snapshot before the Latest that has a
|
||||
// status of "deployed" or "superseded", or nil if there is no such Snapshot.
|
||||
// Unless ignoreTests is true, Snapshots with a test in the "Failed" phase are
|
||||
// ignored.
|
||||
func (in Snapshots) Previous(ignoreTests bool) *Snapshot {
|
||||
if len(in) < 2 {
|
||||
return nil
|
||||
}
|
||||
in.SortByVersion()
|
||||
for i := range in[1:] {
|
||||
s := in[i+1]
|
||||
if s.Status == snapshotStatusDeployed || s.Status == snapshotStatusSuperseded {
|
||||
if ignoreTests || !s.HasTestInPhase(snapshotTestPhaseFailed) {
|
||||
return s
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Truncate removes all Snapshots up to the Previous deployed Snapshot.
|
||||
// If there is no previous-deployed Snapshot, the most recent 5 Snapshots are
|
||||
// retained.
|
||||
func (in *Snapshots) Truncate(ignoreTests bool) {
|
||||
if in.Len() < 2 {
|
||||
return
|
||||
}
|
||||
|
||||
in.SortByVersion()
|
||||
for i := range (*in)[1:] {
|
||||
s := (*in)[i+1]
|
||||
if s.Status == snapshotStatusDeployed || s.Status == snapshotStatusSuperseded {
|
||||
if ignoreTests || !s.HasTestInPhase(snapshotTestPhaseFailed) {
|
||||
*in = (*in)[:i+2]
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if in.Len() > defaultMaxHistory {
|
||||
// If none of the Snapshots are deployed or superseded, and there
|
||||
// are more than the defaultMaxHistory, truncate to the most recent
|
||||
// Snapshots.
|
||||
*in = (*in)[:defaultMaxHistory]
|
||||
}
|
||||
}
|
||||
|
||||
// Snapshot captures a point-in-time copy of the status information for a Helm release,
|
||||
// as managed by the controller.
|
||||
type Snapshot struct {
|
||||
// APIVersion is the API version of the Snapshot.
|
||||
// Provisional: when the calculation method of the Digest field is changed,
|
||||
// this field will be used to distinguish between the old and new methods.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
// Digest is the checksum of the release object in storage.
|
||||
// It has the format of `<algo>:<checksum>`.
|
||||
// +required
|
||||
Digest string `json:"digest"`
|
||||
// Name is the name of the release.
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
// Namespace is the namespace the release is deployed to.
|
||||
// +required
|
||||
Namespace string `json:"namespace"`
|
||||
// Version is the version of the release object in storage.
|
||||
// +required
|
||||
Version int `json:"version"`
|
||||
// Status is the current state of the release.
|
||||
// +required
|
||||
Status string `json:"status"`
|
||||
// ChartName is the chart name of the release object in storage.
|
||||
// +required
|
||||
ChartName string `json:"chartName"`
|
||||
// ChartVersion is the chart version of the release object in
|
||||
// storage.
|
||||
// +required
|
||||
ChartVersion string `json:"chartVersion"`
|
||||
// AppVersion is the chart app version of the release object in storage.
|
||||
// +optional
|
||||
AppVersion string `json:"appVersion,omitempty"`
|
||||
// ConfigDigest is the checksum of the config (better known as
|
||||
// "values") of the release object in storage.
|
||||
// It has the format of `<algo>:<checksum>`.
|
||||
// +required
|
||||
ConfigDigest string `json:"configDigest"`
|
||||
// FirstDeployed is when the release was first deployed.
|
||||
// +required
|
||||
FirstDeployed metav1.Time `json:"firstDeployed"`
|
||||
// LastDeployed is when the release was last deployed.
|
||||
// +required
|
||||
LastDeployed metav1.Time `json:"lastDeployed"`
|
||||
// Deleted is when the release was deleted.
|
||||
// +optional
|
||||
Deleted metav1.Time `json:"deleted,omitempty"`
|
||||
// TestHooks is the list of test hooks for the release as observed to be
|
||||
// run by the controller.
|
||||
// +optional
|
||||
TestHooks *map[string]*TestHookStatus `json:"testHooks,omitempty"`
|
||||
// OCIDigest is the digest of the OCI artifact associated with the release.
|
||||
// +optional
|
||||
OCIDigest string `json:"ociDigest,omitempty"`
|
||||
}
|
||||
|
||||
// FullReleaseName returns the full name of the release in the format
|
||||
// of '<namespace>/<name>.<version>
|
||||
func (in *Snapshot) FullReleaseName() string {
|
||||
if in == nil {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%s/%s.v%d", in.Namespace, in.Name, in.Version)
|
||||
}
|
||||
|
||||
// VersionedChartName returns the full name of the chart in the format of
|
||||
// '<name>@<version>'.
|
||||
func (in *Snapshot) VersionedChartName() string {
|
||||
if in == nil {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%s@%s", in.ChartName, in.ChartVersion)
|
||||
}
|
||||
|
||||
// HasBeenTested returns true if TestHooks is not nil. This includes an empty
|
||||
// map, which indicates the chart has no tests.
|
||||
func (in *Snapshot) HasBeenTested() bool {
|
||||
return in != nil && in.TestHooks != nil
|
||||
}
|
||||
|
||||
// GetTestHooks returns the TestHooks for the release if not nil.
|
||||
func (in *Snapshot) GetTestHooks() map[string]*TestHookStatus {
|
||||
if in == nil || in.TestHooks == nil {
|
||||
return nil
|
||||
}
|
||||
return *in.TestHooks
|
||||
}
|
||||
|
||||
// HasTestInPhase returns true if any of the TestHooks is in the given phase.
|
||||
func (in *Snapshot) HasTestInPhase(phase string) bool {
|
||||
if in != nil {
|
||||
for _, h := range in.GetTestHooks() {
|
||||
if h.Phase == phase {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTestHooks sets the TestHooks for the release.
|
||||
func (in *Snapshot) SetTestHooks(hooks map[string]*TestHookStatus) {
|
||||
if in == nil || hooks == nil {
|
||||
return
|
||||
}
|
||||
in.TestHooks = &hooks
|
||||
}
|
||||
|
||||
// Targets returns true if the Snapshot targets the given release data.
|
||||
func (in *Snapshot) Targets(name, namespace string, version int) bool {
|
||||
if in != nil {
|
||||
return in.Name == name && in.Namespace == namespace && in.Version == version
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// TestHookStatus holds the status information for a test hook as observed
|
||||
// to be run by the controller.
|
||||
type TestHookStatus struct {
|
||||
// LastStarted is the time the test hook was last started.
|
||||
// +optional
|
||||
LastStarted metav1.Time `json:"lastStarted,omitempty"`
|
||||
// LastCompleted is the time the test hook last completed.
|
||||
// +optional
|
||||
LastCompleted metav1.Time `json:"lastCompleted,omitempty"`
|
||||
// Phase the test hook was observed to be in.
|
||||
// +optional
|
||||
Phase string `json:"phase,omitempty"`
|
||||
}
|
|
@ -1,298 +0,0 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSnapshots_Sort(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
want Snapshots
|
||||
}{
|
||||
{
|
||||
name: "sorts by descending version",
|
||||
in: Snapshots{
|
||||
{Version: 1},
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
{Version: 1},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "already sorted",
|
||||
in: Snapshots{
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
{Version: 1},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
{Version: 1},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tt.in.SortByVersion()
|
||||
|
||||
if !reflect.DeepEqual(tt.in, tt.want) {
|
||||
t.Errorf("SortByVersion() got %v, want %v", tt.in, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshots_Latest(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
want *Snapshot
|
||||
}{
|
||||
{
|
||||
name: "returns most recent snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1},
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
},
|
||||
want: &Snapshot{Version: 3},
|
||||
},
|
||||
{
|
||||
name: "returns nil if empty",
|
||||
in: Snapshots{},
|
||||
want: nil,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := tt.in.Latest(); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Latest() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshots_Previous(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
ignoreTests bool
|
||||
want *Snapshot
|
||||
}{
|
||||
{
|
||||
name: "returns previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 2, Status: "deployed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 1, Status: "superseded"},
|
||||
},
|
||||
want: &Snapshot{Version: 2, Status: "deployed"},
|
||||
},
|
||||
{
|
||||
name: "includes snapshots with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 1, Status: "superseded"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
ignoreTests: true,
|
||||
want: &Snapshot{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
{
|
||||
name: "ignores snapshots with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 1, Status: "superseded"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
ignoreTests: false,
|
||||
want: &Snapshot{Version: 2, Status: "superseded"},
|
||||
},
|
||||
{
|
||||
name: "returns nil without previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1, Status: "deployed"},
|
||||
},
|
||||
want: nil,
|
||||
},
|
||||
{
|
||||
name: "returns nil without snapshot matching criteria",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
ignoreTests: false,
|
||||
want: nil,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := tt.in.Previous(tt.ignoreTests); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Previous() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshots_Truncate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
ignoreTests bool
|
||||
want Snapshots
|
||||
}{
|
||||
{
|
||||
name: "keeps previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1, Status: "superseded"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
{Version: 4, Status: "deployed"},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ignores snapshots with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
{Version: 2, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-grpc-test-h0tc2": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-jwt-test-vzusa": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-service-test-b647e": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
}},
|
||||
},
|
||||
ignoreTests: false,
|
||||
want: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
{Version: 2, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-grpc-test-h0tc2": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-jwt-test-vzusa": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-service-test-b647e": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "keeps previous snapshot with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
{Version: 2, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-grpc-test-h0tc2": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-jwt-test-vzusa": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-service-test-b647e": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
}},
|
||||
{Version: 1, Status: "superseded"},
|
||||
},
|
||||
ignoreTests: true,
|
||||
want: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "retains most recent snapshots when all have failed",
|
||||
in: Snapshots{
|
||||
{Version: 6, Status: "deployed"},
|
||||
{Version: 5, Status: "failed"},
|
||||
{Version: 4, Status: "failed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "failed"},
|
||||
{Version: 1, Status: "failed"},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 6, Status: "deployed"},
|
||||
{Version: 5, Status: "failed"},
|
||||
{Version: 4, Status: "failed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "failed"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "without previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1, Status: "deployed"},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 1, Status: "deployed"},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tt.in.Truncate(tt.ignoreTests)
|
||||
|
||||
if !reflect.DeepEqual(tt.in, tt.want) {
|
||||
t.Errorf("Truncate() got %v, want %v", tt.in, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -1,774 +0,0 @@
|
|||
//go:build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
"github.com/fluxcd/pkg/apis/kustomize"
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CommonMetadata) DeepCopyInto(out *CommonMetadata) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonMetadata.
|
||||
func (in *CommonMetadata) DeepCopy() *CommonMetadata {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CommonMetadata)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CrossNamespaceObjectReference) DeepCopyInto(out *CrossNamespaceObjectReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceObjectReference.
|
||||
func (in *CrossNamespaceObjectReference) DeepCopy() *CrossNamespaceObjectReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CrossNamespaceObjectReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceSourceReference.
|
||||
func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CrossNamespaceSourceReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DependencyReference) DeepCopyInto(out *DependencyReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependencyReference.
|
||||
func (in *DependencyReference) DeepCopy() *DependencyReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DependencyReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DriftDetection) DeepCopyInto(out *DriftDetection) {
|
||||
*out = *in
|
||||
if in.Ignore != nil {
|
||||
in, out := &in.Ignore, &out.Ignore
|
||||
*out = make([]IgnoreRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriftDetection.
|
||||
func (in *DriftDetection) DeepCopy() *DriftDetection {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DriftDetection)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Filter) DeepCopyInto(out *Filter) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter.
|
||||
func (in *Filter) DeepCopy() *Filter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Filter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplate) DeepCopyInto(out *HelmChartTemplate) {
|
||||
*out = *in
|
||||
if in.ObjectMeta != nil {
|
||||
in, out := &in.ObjectMeta, &out.ObjectMeta
|
||||
*out = new(HelmChartTemplateObjectMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplate.
|
||||
func (in *HelmChartTemplate) DeepCopy() *HelmChartTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplateObjectMeta) DeepCopyInto(out *HelmChartTemplateObjectMeta) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplateObjectMeta.
|
||||
func (in *HelmChartTemplateObjectMeta) DeepCopy() *HelmChartTemplateObjectMeta {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplateObjectMeta)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplateSpec) DeepCopyInto(out *HelmChartTemplateSpec) {
|
||||
*out = *in
|
||||
out.SourceRef = in.SourceRef
|
||||
if in.Interval != nil {
|
||||
in, out := &in.Interval, &out.Interval
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.ValuesFiles != nil {
|
||||
in, out := &in.ValuesFiles, &out.ValuesFiles
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Verify != nil {
|
||||
in, out := &in.Verify, &out.Verify
|
||||
*out = new(HelmChartTemplateVerification)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplateSpec.
|
||||
func (in *HelmChartTemplateSpec) DeepCopy() *HelmChartTemplateSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplateSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplateVerification) DeepCopyInto(out *HelmChartTemplateVerification) {
|
||||
*out = *in
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(meta.LocalObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplateVerification.
|
||||
func (in *HelmChartTemplateVerification) DeepCopy() *HelmChartTemplateVerification {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplateVerification)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRelease) DeepCopyInto(out *HelmRelease) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRelease.
|
||||
func (in *HelmRelease) DeepCopy() *HelmRelease {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRelease)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmRelease) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseList) DeepCopyInto(out *HelmReleaseList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmRelease, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseList.
|
||||
func (in *HelmReleaseList) DeepCopy() *HelmReleaseList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmReleaseList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) {
|
||||
*out = *in
|
||||
if in.Chart != nil {
|
||||
in, out := &in.Chart, &out.Chart
|
||||
*out = new(HelmChartTemplate)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ChartRef != nil {
|
||||
in, out := &in.ChartRef, &out.ChartRef
|
||||
*out = new(CrossNamespaceSourceReference)
|
||||
**out = **in
|
||||
}
|
||||
out.Interval = in.Interval
|
||||
if in.KubeConfig != nil {
|
||||
in, out := &in.KubeConfig, &out.KubeConfig
|
||||
*out = new(meta.KubeConfigReference)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.DependsOn != nil {
|
||||
in, out := &in.DependsOn, &out.DependsOn
|
||||
*out = make([]DependencyReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.MaxHistory != nil {
|
||||
in, out := &in.MaxHistory, &out.MaxHistory
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.PersistentClient != nil {
|
||||
in, out := &in.PersistentClient, &out.PersistentClient
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.DriftDetection != nil {
|
||||
in, out := &in.DriftDetection, &out.DriftDetection
|
||||
*out = new(DriftDetection)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Install != nil {
|
||||
in, out := &in.Install, &out.Install
|
||||
*out = new(Install)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Upgrade != nil {
|
||||
in, out := &in.Upgrade, &out.Upgrade
|
||||
*out = new(Upgrade)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Test != nil {
|
||||
in, out := &in.Test, &out.Test
|
||||
*out = new(Test)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Rollback != nil {
|
||||
in, out := &in.Rollback, &out.Rollback
|
||||
*out = new(Rollback)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Uninstall != nil {
|
||||
in, out := &in.Uninstall, &out.Uninstall
|
||||
*out = new(Uninstall)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ValuesFrom != nil {
|
||||
in, out := &in.ValuesFrom, &out.ValuesFrom
|
||||
*out = make([]meta.ValuesReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Values != nil {
|
||||
in, out := &in.Values, &out.Values
|
||||
*out = new(apiextensionsv1.JSON)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.CommonMetadata != nil {
|
||||
in, out := &in.CommonMetadata, &out.CommonMetadata
|
||||
*out = new(CommonMetadata)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PostRenderers != nil {
|
||||
in, out := &in.PostRenderers, &out.PostRenderers
|
||||
*out = make([]PostRenderer, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseSpec.
|
||||
func (in *HelmReleaseSpec) DeepCopy() *HelmReleaseSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseStatus) DeepCopyInto(out *HelmReleaseStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]v1.Condition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.History != nil {
|
||||
in, out := &in.History, &out.History
|
||||
*out = make(Snapshots, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(Snapshot)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
}
|
||||
if in.LastAttemptedReleaseActionDuration != nil {
|
||||
in, out := &in.LastAttemptedReleaseActionDuration, &out.LastAttemptedReleaseActionDuration
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
out.ReconcileRequestStatus = in.ReconcileRequestStatus
|
||||
out.ForceRequestStatus = in.ForceRequestStatus
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseStatus.
|
||||
func (in *HelmReleaseStatus) DeepCopy() *HelmReleaseStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *IgnoreRule) DeepCopyInto(out *IgnoreRule) {
|
||||
*out = *in
|
||||
if in.Paths != nil {
|
||||
in, out := &in.Paths, &out.Paths
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Target != nil {
|
||||
in, out := &in.Target, &out.Target
|
||||
*out = new(kustomize.Selector)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnoreRule.
|
||||
func (in *IgnoreRule) DeepCopy() *IgnoreRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(IgnoreRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Install) DeepCopyInto(out *Install) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.Remediation != nil {
|
||||
in, out := &in.Remediation, &out.Remediation
|
||||
*out = new(InstallRemediation)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Install.
|
||||
func (in *Install) DeepCopy() *Install {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Install)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *InstallRemediation) DeepCopyInto(out *InstallRemediation) {
|
||||
*out = *in
|
||||
if in.IgnoreTestFailures != nil {
|
||||
in, out := &in.IgnoreTestFailures, &out.IgnoreTestFailures
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.RemediateLastFailure != nil {
|
||||
in, out := &in.RemediateLastFailure, &out.RemediateLastFailure
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallRemediation.
|
||||
func (in *InstallRemediation) DeepCopy() *InstallRemediation {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(InstallRemediation)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Kustomize) DeepCopyInto(out *Kustomize) {
|
||||
*out = *in
|
||||
if in.Patches != nil {
|
||||
in, out := &in.Patches, &out.Patches
|
||||
*out = make([]kustomize.Patch, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Images != nil {
|
||||
in, out := &in.Images, &out.Images
|
||||
*out = make([]kustomize.Image, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kustomize.
|
||||
func (in *Kustomize) DeepCopy() *Kustomize {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Kustomize)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PostRenderer) DeepCopyInto(out *PostRenderer) {
|
||||
*out = *in
|
||||
if in.Kustomize != nil {
|
||||
in, out := &in.Kustomize, &out.Kustomize
|
||||
*out = new(Kustomize)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostRenderer.
|
||||
func (in *PostRenderer) DeepCopy() *PostRenderer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PostRenderer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Rollback) DeepCopyInto(out *Rollback) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rollback.
|
||||
func (in *Rollback) DeepCopy() *Rollback {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Rollback)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Snapshot) DeepCopyInto(out *Snapshot) {
|
||||
*out = *in
|
||||
in.FirstDeployed.DeepCopyInto(&out.FirstDeployed)
|
||||
in.LastDeployed.DeepCopyInto(&out.LastDeployed)
|
||||
in.Deleted.DeepCopyInto(&out.Deleted)
|
||||
if in.TestHooks != nil {
|
||||
in, out := &in.TestHooks, &out.TestHooks
|
||||
*out = new(map[string]*TestHookStatus)
|
||||
if **in != nil {
|
||||
in, out := *in, *out
|
||||
*out = make(map[string]*TestHookStatus, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal *TestHookStatus
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
inVal := (*in)[key]
|
||||
in, out := &inVal, &outVal
|
||||
*out = new(TestHookStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
(*out)[key] = outVal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshot.
|
||||
func (in *Snapshot) DeepCopy() *Snapshot {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Snapshot)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in Snapshots) DeepCopyInto(out *Snapshots) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(Snapshots, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(Snapshot)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshots.
|
||||
func (in Snapshots) DeepCopy() Snapshots {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Snapshots)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Test) DeepCopyInto(out *Test) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.Filters != nil {
|
||||
in, out := &in.Filters, &out.Filters
|
||||
*out = new([]Filter)
|
||||
if **in != nil {
|
||||
in, out := *in, *out
|
||||
*out = make([]Filter, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Test.
|
||||
func (in *Test) DeepCopy() *Test {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Test)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TestHookStatus) DeepCopyInto(out *TestHookStatus) {
|
||||
*out = *in
|
||||
in.LastStarted.DeepCopyInto(&out.LastStarted)
|
||||
in.LastCompleted.DeepCopyInto(&out.LastCompleted)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestHookStatus.
|
||||
func (in *TestHookStatus) DeepCopy() *TestHookStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TestHookStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Uninstall) DeepCopyInto(out *Uninstall) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.DeletionPropagation != nil {
|
||||
in, out := &in.DeletionPropagation, &out.DeletionPropagation
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Uninstall.
|
||||
func (in *Uninstall) DeepCopy() *Uninstall {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Uninstall)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Upgrade) DeepCopyInto(out *Upgrade) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(v1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.Remediation != nil {
|
||||
in, out := &in.Remediation, &out.Remediation
|
||||
*out = new(UpgradeRemediation)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Upgrade.
|
||||
func (in *Upgrade) DeepCopy() *Upgrade {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Upgrade)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UpgradeRemediation) DeepCopyInto(out *UpgradeRemediation) {
|
||||
*out = *in
|
||||
if in.IgnoreTestFailures != nil {
|
||||
in, out := &in.IgnoreTestFailures, &out.IgnoreTestFailures
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.RemediateLastFailure != nil {
|
||||
in, out := &in.RemediateLastFailure, &out.RemediateLastFailure
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Strategy != nil {
|
||||
in, out := &in.Strategy, &out.Strategy
|
||||
*out = new(RemediationStrategy)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeRemediation.
|
||||
func (in *UpgradeRemediation) DeepCopy() *UpgradeRemediation {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UpgradeRemediation)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
|
@ -15,9 +15,6 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
// Package v2beta1 contains API Schema definitions for the helm v2beta1 API group
|
||||
//
|
||||
// Deprecated: v2beta1 is no longer supported, use v2 instead.
|
||||
//
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=helm.toolkit.fluxcd.io
|
||||
package v2beta1
|
||||
|
|
|
@ -28,9 +28,6 @@ import (
|
|||
|
||||
"github.com/fluxcd/pkg/apis/kustomize"
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2"
|
||||
"github.com/fluxcd/helm-controller/api/v2beta2"
|
||||
)
|
||||
|
||||
const HelmReleaseKind = "HelmRelease"
|
||||
|
@ -70,19 +67,9 @@ type HelmReleaseSpec struct {
|
|||
// Chart defines the template of the v1beta2.HelmChart that should be created
|
||||
// for this HelmRelease.
|
||||
// +required
|
||||
Chart *HelmChartTemplate `json:"chart,omitempty"`
|
||||
|
||||
// ChartRef holds a reference to a source controller resource containing the
|
||||
// Helm chart artifact.
|
||||
//
|
||||
// Note: this field is provisional to the v2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
ChartRef *v2.CrossNamespaceSourceReference `json:"chartRef,omitempty"`
|
||||
Chart HelmChartTemplate `json:"chart"`
|
||||
|
||||
// Interval at which to reconcile the Helm release.
|
||||
// This interval is approximate and may be subject to jitter to ensure
|
||||
// efficient use of resources.
|
||||
// +kubebuilder:validation:Type=string
|
||||
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
|
||||
// +required
|
||||
|
@ -165,15 +152,6 @@ type HelmReleaseSpec struct {
|
|||
// +optional
|
||||
PersistentClient *bool `json:"persistentClient,omitempty"`
|
||||
|
||||
// DriftDetection holds the configuration for detecting and handling
|
||||
// differences between the manifest in the Helm storage and the resources
|
||||
// currently existing in the cluster.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
DriftDetection *v2beta2.DriftDetection `json:"driftDetection,omitempty"`
|
||||
|
||||
// Install holds the configuration for Helm install actions for this HelmRelease.
|
||||
// +optional
|
||||
Install *Install `json:"install,omitempty"`
|
||||
|
@ -850,13 +828,6 @@ type Uninstall struct {
|
|||
// a Helm uninstall is performed.
|
||||
// +optional
|
||||
DisableWait bool `json:"disableWait,omitempty"`
|
||||
|
||||
// DeletionPropagation specifies the deletion propagation policy when
|
||||
// a Helm uninstall is performed.
|
||||
// +kubebuilder:default=background
|
||||
// +kubebuilder:validation:Enum=background;foreground;orphan
|
||||
// +optional
|
||||
DeletionPropagation *string `json:"deletionPropagation,omitempty"`
|
||||
}
|
||||
|
||||
// GetTimeout returns the configured timeout for the Helm uninstall action, or
|
||||
|
@ -868,26 +839,12 @@ func (in Uninstall) GetTimeout(defaultTimeout metav1.Duration) metav1.Duration {
|
|||
return *in.Timeout
|
||||
}
|
||||
|
||||
// GetDeletionPropagation returns the configured deletion propagation policy
|
||||
// for the Helm uninstall action, or 'background'.
|
||||
func (in Uninstall) GetDeletionPropagation() string {
|
||||
if in.DeletionPropagation == nil {
|
||||
return "background"
|
||||
}
|
||||
return *in.DeletionPropagation
|
||||
}
|
||||
|
||||
// HelmReleaseStatus defines the observed state of a HelmRelease.
|
||||
type HelmReleaseStatus struct {
|
||||
// ObservedGeneration is the last observed generation.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||
|
||||
// ObservedPostRenderersDigest is the digest for the post-renderers of
|
||||
// the last successful reconciliation attempt.
|
||||
// +optional
|
||||
ObservedPostRenderersDigest string `json:"observedPostRenderersDigest,omitempty"`
|
||||
|
||||
meta.ReconcileRequestStatus `json:",inline"`
|
||||
|
||||
// Conditions holds the conditions for the HelmRelease.
|
||||
|
@ -930,62 +887,6 @@ type HelmReleaseStatus struct {
|
|||
// state. It is reset after a successful reconciliation.
|
||||
// +optional
|
||||
UpgradeFailures int64 `json:"upgradeFailures,omitempty"`
|
||||
|
||||
// StorageNamespace is the namespace of the Helm release storage for the
|
||||
// current release.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
StorageNamespace string `json:"storageNamespace,omitempty"`
|
||||
|
||||
// History holds the history of Helm releases performed for this HelmRelease
|
||||
// up to the last successfully completed release.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
History v2.Snapshots `json:"history,omitempty"`
|
||||
|
||||
// LastAttemptedGeneration is the last generation the controller attempted
|
||||
// to reconcile.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
LastAttemptedGeneration int64 `json:"lastAttemptedGeneration,omitempty"`
|
||||
|
||||
// LastAttemptedConfigDigest is the digest for the config (better known as
|
||||
// "values") of the last reconciliation attempt.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
LastAttemptedConfigDigest string `json:"lastAttemptedConfigDigest,omitempty"`
|
||||
|
||||
// LastAttemptedReleaseAction is the last release action performed for this
|
||||
// HelmRelease. It is used to determine the active remediation strategy.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
LastAttemptedReleaseAction string `json:"lastAttemptedReleaseAction,omitempty"`
|
||||
|
||||
// LastHandledForceAt holds the value of the most recent force request
|
||||
// value, so a change of the annotation value can be detected.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
LastHandledForceAt string `json:"lastHandledForceAt,omitempty"`
|
||||
|
||||
// LastHandledResetAt holds the value of the most recent reset request
|
||||
// value, so a change of the annotation value can be detected.
|
||||
//
|
||||
// Note: this field is provisional to the v2beta2 API, and not actively used
|
||||
// by v2beta1 HelmReleases.
|
||||
// +optional
|
||||
LastHandledResetAt string `json:"lastHandledResetAt,omitempty"`
|
||||
}
|
||||
|
||||
// GetHelmChart returns the namespace and name of the HelmChart.
|
||||
|
@ -1095,9 +996,13 @@ const (
|
|||
)
|
||||
|
||||
// +genclient
|
||||
// +genclient:Namespaced
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:shortName=hr
|
||||
// +kubebuilder:skipversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
|
||||
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
|
||||
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
|
||||
|
||||
// HelmRelease is the Schema for the helmreleases API
|
||||
type HelmRelease struct {
|
||||
|
@ -1201,7 +1106,6 @@ func (in *HelmRelease) SetConditions(conditions []metav1.Condition) {
|
|||
}
|
||||
|
||||
// GetStatusConditions returns a pointer to the Status.Conditions slice.
|
||||
//
|
||||
// Deprecated: use GetConditions instead.
|
||||
func (in *HelmRelease) GetStatusConditions() *[]metav1.Condition {
|
||||
return &in.Status.Conditions
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
Copyright 2021 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -21,8 +22,6 @@ limitations under the License.
|
|||
package v2beta1
|
||||
|
||||
import (
|
||||
"github.com/fluxcd/helm-controller/api/v2"
|
||||
"github.com/fluxcd/helm-controller/api/v2beta2"
|
||||
"github.com/fluxcd/pkg/apis/kustomize"
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
|
@ -208,21 +207,12 @@ func (in *HelmReleaseList) DeepCopyObject() runtime.Object {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) {
|
||||
*out = *in
|
||||
if in.Chart != nil {
|
||||
in, out := &in.Chart, &out.Chart
|
||||
*out = new(HelmChartTemplate)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ChartRef != nil {
|
||||
in, out := &in.ChartRef, &out.ChartRef
|
||||
*out = new(v2.CrossNamespaceSourceReference)
|
||||
**out = **in
|
||||
}
|
||||
in.Chart.DeepCopyInto(&out.Chart)
|
||||
out.Interval = in.Interval
|
||||
if in.KubeConfig != nil {
|
||||
in, out := &in.KubeConfig, &out.KubeConfig
|
||||
*out = new(meta.KubeConfigReference)
|
||||
(*in).DeepCopyInto(*out)
|
||||
**out = **in
|
||||
}
|
||||
if in.DependsOn != nil {
|
||||
in, out := &in.DependsOn, &out.DependsOn
|
||||
|
@ -244,11 +234,6 @@ func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) {
|
|||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.DriftDetection != nil {
|
||||
in, out := &in.DriftDetection, &out.DriftDetection
|
||||
*out = new(v2beta2.DriftDetection)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Install != nil {
|
||||
in, out := &in.Install, &out.Install
|
||||
*out = new(Install)
|
||||
|
@ -314,17 +299,6 @@ func (in *HelmReleaseStatus) DeepCopyInto(out *HelmReleaseStatus) {
|
|||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.History != nil {
|
||||
in, out := &in.History, &out.History
|
||||
*out = make(v2.Snapshots, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(v2.Snapshot)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseStatus.
|
||||
|
@ -496,11 +470,6 @@ func (in *Uninstall) DeepCopyInto(out *Uninstall) {
|
|||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.DeletionPropagation != nil {
|
||||
in, out := &in.DeletionPropagation, &out.DeletionPropagation
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Uninstall.
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
Copyright 2023 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import "github.com/fluxcd/pkg/apis/meta"
|
||||
|
||||
const (
|
||||
// ForceRequestAnnotation is the annotation used for triggering a one-off forced
|
||||
// Helm release, even when there are no new changes in the HelmRelease.
|
||||
// The value is interpreted as a token, and must equal the value of
|
||||
// meta.ReconcileRequestAnnotation in order to trigger a release.
|
||||
ForceRequestAnnotation string = "reconcile.fluxcd.io/forceAt"
|
||||
|
||||
// ResetRequestAnnotation is the annotation used for resetting the failure counts
|
||||
// of a HelmRelease, so that it can be retried again.
|
||||
// The value is interpreted as a token, and must equal the value of
|
||||
// meta.ReconcileRequestAnnotation in order to reset the failure counts.
|
||||
ResetRequestAnnotation string = "reconcile.fluxcd.io/resetAt"
|
||||
)
|
||||
|
||||
// ShouldHandleResetRequest returns true if the HelmRelease has a reset request
|
||||
// annotation, and the value of the annotation matches the value of the
|
||||
// meta.ReconcileRequestAnnotation annotation.
|
||||
//
|
||||
// To ensure that the reset request is handled only once, the value of
|
||||
// HelmReleaseStatus.LastHandledResetAt is updated to match the value of the
|
||||
// reset request annotation (even if the reset request is not handled because
|
||||
// the value of the meta.ReconcileRequestAnnotation annotation does not match).
|
||||
func ShouldHandleResetRequest(obj *HelmRelease) bool {
|
||||
return handleRequest(obj, ResetRequestAnnotation, &obj.Status.LastHandledResetAt)
|
||||
}
|
||||
|
||||
// ShouldHandleForceRequest returns true if the HelmRelease has a force request
|
||||
// annotation, and the value of the annotation matches the value of the
|
||||
// meta.ReconcileRequestAnnotation annotation.
|
||||
//
|
||||
// To ensure that the force request is handled only once, the value of
|
||||
// HelmReleaseStatus.LastHandledForceAt is updated to match the value of the
|
||||
// force request annotation (even if the force request is not handled because
|
||||
// the value of the meta.ReconcileRequestAnnotation annotation does not match).
|
||||
func ShouldHandleForceRequest(obj *HelmRelease) bool {
|
||||
return handleRequest(obj, ForceRequestAnnotation, &obj.Status.LastHandledForceAt)
|
||||
}
|
||||
|
||||
// handleRequest returns true if the HelmRelease has a request annotation, and
|
||||
// the value of the annotation matches the value of the meta.ReconcileRequestAnnotation
|
||||
// annotation.
|
||||
//
|
||||
// The lastHandled argument is used to ensure that the request is handled only
|
||||
// once, and is updated to match the value of the request annotation (even if
|
||||
// the request is not handled because the value of the meta.ReconcileRequestAnnotation
|
||||
// annotation does not match).
|
||||
func handleRequest(obj *HelmRelease, annotation string, lastHandled *string) bool {
|
||||
requestAt, requestOk := obj.GetAnnotations()[annotation]
|
||||
reconcileAt, reconcileOk := meta.ReconcileAnnotationValue(obj.GetAnnotations())
|
||||
|
||||
var lastHandledRequest string
|
||||
if requestOk {
|
||||
lastHandledRequest = *lastHandled
|
||||
*lastHandled = requestAt
|
||||
}
|
||||
|
||||
if requestOk && reconcileOk && requestAt == reconcileAt {
|
||||
lastHandledReconcile := obj.Status.GetLastHandledReconcileRequest()
|
||||
if lastHandledReconcile != reconcileAt && lastHandledRequest != requestAt {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
|
@ -1,165 +0,0 @@
|
|||
/*
|
||||
Copyright 2023 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
)
|
||||
|
||||
func TestShouldHandleResetRequest(t *testing.T) {
|
||||
t.Run("should handle reset request", func(t *testing.T) {
|
||||
obj := &HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
ResetRequestAnnotation: "b",
|
||||
},
|
||||
},
|
||||
Status: HelmReleaseStatus{
|
||||
LastHandledResetAt: "a",
|
||||
ReconcileRequestStatus: meta.ReconcileRequestStatus{
|
||||
LastHandledReconcileAt: "a",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if !ShouldHandleResetRequest(obj) {
|
||||
t.Error("ShouldHandleResetRequest() = false")
|
||||
}
|
||||
|
||||
if obj.Status.LastHandledResetAt != "b" {
|
||||
t.Error("ShouldHandleResetRequest did not update LastHandledResetAt")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestShouldHandleForceRequest(t *testing.T) {
|
||||
t.Run("should handle force request", func(t *testing.T) {
|
||||
obj := &HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
ForceRequestAnnotation: "b",
|
||||
},
|
||||
},
|
||||
Status: HelmReleaseStatus{
|
||||
LastHandledForceAt: "a",
|
||||
ReconcileRequestStatus: meta.ReconcileRequestStatus{
|
||||
LastHandledReconcileAt: "a",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if !ShouldHandleForceRequest(obj) {
|
||||
t.Error("ShouldHandleForceRequest() = false")
|
||||
}
|
||||
|
||||
if obj.Status.LastHandledForceAt != "b" {
|
||||
t.Error("ShouldHandleForceRequest did not update LastHandledForceAt")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func Test_handleRequest(t *testing.T) {
|
||||
const requestAnnotation = "requestAnnotation"
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
annotations map[string]string
|
||||
lastHandledReconcile string
|
||||
lastHandledRequest string
|
||||
want bool
|
||||
expectLastHandledRequest string
|
||||
}{
|
||||
{
|
||||
name: "valid request and reconcile annotations",
|
||||
annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
requestAnnotation: "b",
|
||||
},
|
||||
want: true,
|
||||
expectLastHandledRequest: "b",
|
||||
},
|
||||
{
|
||||
name: "mismatched annotations",
|
||||
annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
requestAnnotation: "c",
|
||||
},
|
||||
want: false,
|
||||
expectLastHandledRequest: "c",
|
||||
},
|
||||
{
|
||||
name: "reconcile matches previous request",
|
||||
annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
requestAnnotation: "b",
|
||||
},
|
||||
lastHandledReconcile: "a",
|
||||
lastHandledRequest: "b",
|
||||
want: false,
|
||||
expectLastHandledRequest: "b",
|
||||
},
|
||||
{
|
||||
name: "request matches previous reconcile",
|
||||
annotations: map[string]string{
|
||||
meta.ReconcileRequestAnnotation: "b",
|
||||
requestAnnotation: "b",
|
||||
},
|
||||
lastHandledReconcile: "b",
|
||||
lastHandledRequest: "a",
|
||||
want: false,
|
||||
expectLastHandledRequest: "b",
|
||||
},
|
||||
{
|
||||
name: "missing annotations",
|
||||
annotations: map[string]string{},
|
||||
lastHandledRequest: "a",
|
||||
want: false,
|
||||
expectLastHandledRequest: "a",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
obj := &HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: tt.annotations,
|
||||
},
|
||||
Status: HelmReleaseStatus{
|
||||
ReconcileRequestStatus: meta.ReconcileRequestStatus{
|
||||
LastHandledReconcileAt: tt.lastHandledReconcile,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lastHandled := tt.lastHandledRequest
|
||||
result := handleRequest(obj, requestAnnotation, &lastHandled)
|
||||
|
||||
if result != tt.want {
|
||||
t.Errorf("handleRequest() = %v, want %v", result, tt.want)
|
||||
}
|
||||
if lastHandled != tt.expectLastHandledRequest {
|
||||
t.Errorf("lastHandledRequest = %v, want %v", lastHandled, tt.expectLastHandledRequest)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
const (
|
||||
// ReleasedCondition represents the status of the last release attempt
|
||||
// (install/upgrade/test) against the latest desired state.
|
||||
ReleasedCondition string = "Released"
|
||||
|
||||
// TestSuccessCondition represents the status of the last test attempt against
|
||||
// the latest desired state.
|
||||
TestSuccessCondition string = "TestSuccess"
|
||||
|
||||
// RemediatedCondition represents the status of the last remediation attempt
|
||||
// (uninstall/rollback) due to a failure of the last release attempt against the
|
||||
// latest desired state.
|
||||
RemediatedCondition string = "Remediated"
|
||||
)
|
||||
|
||||
const (
|
||||
// InstallSucceededReason represents the fact that the Helm install for the
|
||||
// HelmRelease succeeded.
|
||||
InstallSucceededReason string = "InstallSucceeded"
|
||||
|
||||
// InstallFailedReason represents the fact that the Helm install for the
|
||||
// HelmRelease failed.
|
||||
InstallFailedReason string = "InstallFailed"
|
||||
|
||||
// UpgradeSucceededReason represents the fact that the Helm upgrade for the
|
||||
// HelmRelease succeeded.
|
||||
UpgradeSucceededReason string = "UpgradeSucceeded"
|
||||
|
||||
// UpgradeFailedReason represents the fact that the Helm upgrade for the
|
||||
// HelmRelease failed.
|
||||
UpgradeFailedReason string = "UpgradeFailed"
|
||||
|
||||
// TestSucceededReason represents the fact that the Helm tests for the
|
||||
// HelmRelease succeeded.
|
||||
TestSucceededReason string = "TestSucceeded"
|
||||
|
||||
// TestFailedReason represents the fact that the Helm tests for the HelmRelease
|
||||
// failed.
|
||||
TestFailedReason string = "TestFailed"
|
||||
|
||||
// RollbackSucceededReason represents the fact that the Helm rollback for the
|
||||
// HelmRelease succeeded.
|
||||
RollbackSucceededReason string = "RollbackSucceeded"
|
||||
|
||||
// RollbackFailedReason represents the fact that the Helm test for the
|
||||
// HelmRelease failed.
|
||||
RollbackFailedReason string = "RollbackFailed"
|
||||
|
||||
// UninstallSucceededReason represents the fact that the Helm uninstall for the
|
||||
// HelmRelease succeeded.
|
||||
UninstallSucceededReason string = "UninstallSucceeded"
|
||||
|
||||
// UninstallFailedReason represents the fact that the Helm uninstall for the
|
||||
// HelmRelease failed.
|
||||
UninstallFailedReason string = "UninstallFailed"
|
||||
|
||||
// ArtifactFailedReason represents the fact that the artifact download for the
|
||||
// HelmRelease failed.
|
||||
ArtifactFailedReason string = "ArtifactFailed"
|
||||
|
||||
// InitFailedReason represents the fact that the initialization of the Helm
|
||||
// configuration failed.
|
||||
InitFailedReason string = "InitFailed"
|
||||
|
||||
// GetLastReleaseFailedReason represents the fact that observing the last
|
||||
// release failed.
|
||||
GetLastReleaseFailedReason string = "GetLastReleaseFailed"
|
||||
|
||||
// DependencyNotReadyReason represents the fact that
|
||||
// one of the dependencies is not ready.
|
||||
DependencyNotReadyReason string = "DependencyNotReady"
|
||||
|
||||
// ReconciliationSucceededReason represents the fact that
|
||||
// the reconciliation succeeded.
|
||||
ReconciliationSucceededReason string = "ReconciliationSucceeded"
|
||||
|
||||
// ReconciliationFailedReason represents the fact that
|
||||
// the reconciliation failed.
|
||||
ReconciliationFailedReason string = "ReconciliationFailed"
|
||||
)
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v2beta2 contains API Schema definitions for the helm v2beta2 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=helm.toolkit.fluxcd.io
|
||||
package v2beta2
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
GroupVersion = schema.GroupVersion{Group: "helm.toolkit.fluxcd.io", Version: "v2beta2"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
File diff suppressed because it is too large
Load Diff
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
// CrossNamespaceObjectReference contains enough information to let you locate
|
||||
// the typed referenced object at cluster level.
|
||||
type CrossNamespaceObjectReference struct {
|
||||
// APIVersion of the referent.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
|
||||
// Kind of the referent.
|
||||
// +kubebuilder:validation:Enum=HelmRepository;GitRepository;Bucket
|
||||
// +required
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// Name of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// CrossNamespaceSourceReference contains enough information to let you locate
|
||||
// the typed referenced object at cluster level.
|
||||
type CrossNamespaceSourceReference struct {
|
||||
// APIVersion of the referent.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
|
||||
// Kind of the referent.
|
||||
// +kubebuilder:validation:Enum=OCIRepository;HelmChart
|
||||
// +required
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Name of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the referent, defaults to the namespace of the Kubernetes
|
||||
// resource object that contains the reference.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// ValuesReference contains a reference to a resource containing Helm values,
|
||||
// and optionally the key they can be found at.
|
||||
type ValuesReference struct {
|
||||
// Kind of the values referent, valid values are ('Secret', 'ConfigMap').
|
||||
// +kubebuilder:validation:Enum=Secret;ConfigMap
|
||||
// +required
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Name of the values referent. Should reside in the same namespace as the
|
||||
// referring resource.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// ValuesKey is the data key where the values.yaml or a specific value can be
|
||||
// found at. Defaults to 'values.yaml'.
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +kubebuilder:validation:Pattern=`^[\-._a-zA-Z0-9]+$`
|
||||
// +optional
|
||||
ValuesKey string `json:"valuesKey,omitempty"`
|
||||
|
||||
// TargetPath is the YAML dot notation path the value should be merged at. When
|
||||
// set, the ValuesKey is expected to be a single flat value. Defaults to 'None',
|
||||
// which results in the values getting merged at the root.
|
||||
// +kubebuilder:validation:MaxLength=250
|
||||
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
|
||||
// +optional
|
||||
TargetPath string `json:"targetPath,omitempty"`
|
||||
|
||||
// Optional marks this ValuesReference as optional. When set, a not found error
|
||||
// for the values reference is ignored, but any ValuesKey, TargetPath or
|
||||
// transient error will still result in a reconciliation failure.
|
||||
// +optional
|
||||
Optional bool `json:"optional,omitempty"`
|
||||
}
|
||||
|
||||
// GetValuesKey returns the defined ValuesKey, or the default ('values.yaml').
|
||||
func (in ValuesReference) GetValuesKey() string {
|
||||
if in.ValuesKey == "" {
|
||||
return "values.yaml"
|
||||
}
|
||||
return in.ValuesKey
|
||||
}
|
|
@ -1,236 +0,0 @@
|
|||
/*
|
||||
Copyright 2023 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
// snapshotStatusDeployed indicates that the release the snapshot was taken
|
||||
// from is currently deployed.
|
||||
snapshotStatusDeployed = "deployed"
|
||||
// snapshotStatusSuperseded indicates that the release the snapshot was taken
|
||||
// from has been superseded by a newer release.
|
||||
snapshotStatusSuperseded = "superseded"
|
||||
|
||||
// snapshotTestPhaseFailed indicates that the test of the release the snapshot
|
||||
// was taken from has failed.
|
||||
snapshotTestPhaseFailed = "Failed"
|
||||
)
|
||||
|
||||
// Snapshots is a list of Snapshot objects.
|
||||
type Snapshots []*Snapshot
|
||||
|
||||
// Len returns the number of Snapshots.
|
||||
func (in Snapshots) Len() int {
|
||||
return len(in)
|
||||
}
|
||||
|
||||
// SortByVersion sorts the Snapshots by version, in descending order.
|
||||
func (in Snapshots) SortByVersion() {
|
||||
sort.Slice(in, func(i, j int) bool {
|
||||
return in[i].Version > in[j].Version
|
||||
})
|
||||
}
|
||||
|
||||
// Latest returns the most recent Snapshot.
|
||||
func (in Snapshots) Latest() *Snapshot {
|
||||
if len(in) == 0 {
|
||||
return nil
|
||||
}
|
||||
in.SortByVersion()
|
||||
return in[0]
|
||||
}
|
||||
|
||||
// Previous returns the most recent Snapshot before the Latest that has a
|
||||
// status of "deployed" or "superseded", or nil if there is no such Snapshot.
|
||||
// Unless ignoreTests is true, Snapshots with a test in the "Failed" phase are
|
||||
// ignored.
|
||||
func (in Snapshots) Previous(ignoreTests bool) *Snapshot {
|
||||
if len(in) < 2 {
|
||||
return nil
|
||||
}
|
||||
in.SortByVersion()
|
||||
for i := range in[1:] {
|
||||
s := in[i+1]
|
||||
if s.Status == snapshotStatusDeployed || s.Status == snapshotStatusSuperseded {
|
||||
if ignoreTests || !s.HasTestInPhase(snapshotTestPhaseFailed) {
|
||||
return s
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Truncate removes all Snapshots up to the Previous deployed Snapshot.
|
||||
// If there is no previous-deployed Snapshot, the most recent 5 Snapshots are
|
||||
// retained.
|
||||
func (in *Snapshots) Truncate(ignoreTests bool) {
|
||||
if in.Len() < 2 {
|
||||
return
|
||||
}
|
||||
|
||||
in.SortByVersion()
|
||||
for i := range (*in)[1:] {
|
||||
s := (*in)[i+1]
|
||||
if s.Status == snapshotStatusDeployed || s.Status == snapshotStatusSuperseded {
|
||||
if ignoreTests || !s.HasTestInPhase(snapshotTestPhaseFailed) {
|
||||
*in = (*in)[:i+2]
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if in.Len() > defaultMaxHistory {
|
||||
// If none of the Snapshots are deployed or superseded, and there
|
||||
// are more than the defaultMaxHistory, truncate to the most recent
|
||||
// Snapshots.
|
||||
*in = (*in)[:defaultMaxHistory]
|
||||
}
|
||||
}
|
||||
|
||||
// Snapshot captures a point-in-time copy of the status information for a Helm release,
|
||||
// as managed by the controller.
|
||||
type Snapshot struct {
|
||||
// APIVersion is the API version of the Snapshot.
|
||||
// Provisional: when the calculation method of the Digest field is changed,
|
||||
// this field will be used to distinguish between the old and new methods.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
// Digest is the checksum of the release object in storage.
|
||||
// It has the format of `<algo>:<checksum>`.
|
||||
// +required
|
||||
Digest string `json:"digest"`
|
||||
// Name is the name of the release.
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
// Namespace is the namespace the release is deployed to.
|
||||
// +required
|
||||
Namespace string `json:"namespace"`
|
||||
// Version is the version of the release object in storage.
|
||||
// +required
|
||||
Version int `json:"version"`
|
||||
// Status is the current state of the release.
|
||||
// +required
|
||||
Status string `json:"status"`
|
||||
// ChartName is the chart name of the release object in storage.
|
||||
// +required
|
||||
ChartName string `json:"chartName"`
|
||||
// ChartVersion is the chart version of the release object in
|
||||
// storage.
|
||||
// +required
|
||||
ChartVersion string `json:"chartVersion"`
|
||||
// ConfigDigest is the checksum of the config (better known as
|
||||
// "values") of the release object in storage.
|
||||
// It has the format of `<algo>:<checksum>`.
|
||||
// +required
|
||||
ConfigDigest string `json:"configDigest"`
|
||||
// FirstDeployed is when the release was first deployed.
|
||||
// +required
|
||||
FirstDeployed metav1.Time `json:"firstDeployed"`
|
||||
// LastDeployed is when the release was last deployed.
|
||||
// +required
|
||||
LastDeployed metav1.Time `json:"lastDeployed"`
|
||||
// Deleted is when the release was deleted.
|
||||
// +optional
|
||||
Deleted metav1.Time `json:"deleted,omitempty"`
|
||||
// TestHooks is the list of test hooks for the release as observed to be
|
||||
// run by the controller.
|
||||
// +optional
|
||||
TestHooks *map[string]*TestHookStatus `json:"testHooks,omitempty"`
|
||||
// OCIDigest is the digest of the OCI artifact associated with the release.
|
||||
// +optional
|
||||
OCIDigest string `json:"ociDigest,omitempty"`
|
||||
}
|
||||
|
||||
// FullReleaseName returns the full name of the release in the format
|
||||
// of '<namespace>/<name>.<version>
|
||||
func (in *Snapshot) FullReleaseName() string {
|
||||
if in == nil {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%s/%s.v%d", in.Namespace, in.Name, in.Version)
|
||||
}
|
||||
|
||||
// VersionedChartName returns the full name of the chart in the format of
|
||||
// '<name>@<version>'.
|
||||
func (in *Snapshot) VersionedChartName() string {
|
||||
if in == nil {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%s@%s", in.ChartName, in.ChartVersion)
|
||||
}
|
||||
|
||||
// HasBeenTested returns true if TestHooks is not nil. This includes an empty
|
||||
// map, which indicates the chart has no tests.
|
||||
func (in *Snapshot) HasBeenTested() bool {
|
||||
return in != nil && in.TestHooks != nil
|
||||
}
|
||||
|
||||
// GetTestHooks returns the TestHooks for the release if not nil.
|
||||
func (in *Snapshot) GetTestHooks() map[string]*TestHookStatus {
|
||||
if in == nil || in.TestHooks == nil {
|
||||
return nil
|
||||
}
|
||||
return *in.TestHooks
|
||||
}
|
||||
|
||||
// HasTestInPhase returns true if any of the TestHooks is in the given phase.
|
||||
func (in *Snapshot) HasTestInPhase(phase string) bool {
|
||||
if in != nil {
|
||||
for _, h := range in.GetTestHooks() {
|
||||
if h.Phase == phase {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTestHooks sets the TestHooks for the release.
|
||||
func (in *Snapshot) SetTestHooks(hooks map[string]*TestHookStatus) {
|
||||
if in == nil || hooks == nil {
|
||||
return
|
||||
}
|
||||
in.TestHooks = &hooks
|
||||
}
|
||||
|
||||
// Targets returns true if the Snapshot targets the given release data.
|
||||
func (in *Snapshot) Targets(name, namespace string, version int) bool {
|
||||
if in != nil {
|
||||
return in.Name == name && in.Namespace == namespace && in.Version == version
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// TestHookStatus holds the status information for a test hook as observed
|
||||
// to be run by the controller.
|
||||
type TestHookStatus struct {
|
||||
// LastStarted is the time the test hook was last started.
|
||||
// +optional
|
||||
LastStarted metav1.Time `json:"lastStarted,omitempty"`
|
||||
// LastCompleted is the time the test hook last completed.
|
||||
// +optional
|
||||
LastCompleted metav1.Time `json:"lastCompleted,omitempty"`
|
||||
// Phase the test hook was observed to be in.
|
||||
// +optional
|
||||
Phase string `json:"phase,omitempty"`
|
||||
}
|
|
@ -1,298 +0,0 @@
|
|||
/*
|
||||
Copyright 2023 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSnapshots_Sort(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
want Snapshots
|
||||
}{
|
||||
{
|
||||
name: "sorts by descending version",
|
||||
in: Snapshots{
|
||||
{Version: 1},
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
{Version: 1},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "already sorted",
|
||||
in: Snapshots{
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
{Version: 1},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
{Version: 1},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tt.in.SortByVersion()
|
||||
|
||||
if !reflect.DeepEqual(tt.in, tt.want) {
|
||||
t.Errorf("SortByVersion() got %v, want %v", tt.in, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshots_Latest(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
want *Snapshot
|
||||
}{
|
||||
{
|
||||
name: "returns most recent snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1},
|
||||
{Version: 3},
|
||||
{Version: 2},
|
||||
},
|
||||
want: &Snapshot{Version: 3},
|
||||
},
|
||||
{
|
||||
name: "returns nil if empty",
|
||||
in: Snapshots{},
|
||||
want: nil,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := tt.in.Latest(); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Latest() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshots_Previous(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
ignoreTests bool
|
||||
want *Snapshot
|
||||
}{
|
||||
{
|
||||
name: "returns previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 2, Status: "deployed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 1, Status: "superseded"},
|
||||
},
|
||||
want: &Snapshot{Version: 2, Status: "deployed"},
|
||||
},
|
||||
{
|
||||
name: "includes snapshots with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 1, Status: "superseded"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
ignoreTests: true,
|
||||
want: &Snapshot{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
{
|
||||
name: "ignores snapshots with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 1, Status: "superseded"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
ignoreTests: false,
|
||||
want: &Snapshot{Version: 2, Status: "superseded"},
|
||||
},
|
||||
{
|
||||
name: "returns nil without previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1, Status: "deployed"},
|
||||
},
|
||||
want: nil,
|
||||
},
|
||||
{
|
||||
name: "returns nil without snapshot matching criteria",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"test": {Phase: "Failed"},
|
||||
}},
|
||||
},
|
||||
ignoreTests: false,
|
||||
want: nil,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := tt.in.Previous(tt.ignoreTests); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Previous() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshots_Truncate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in Snapshots
|
||||
ignoreTests bool
|
||||
want Snapshots
|
||||
}{
|
||||
{
|
||||
name: "keeps previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1, Status: "superseded"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
{Version: 4, Status: "deployed"},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "superseded"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ignores snapshots with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
{Version: 2, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-grpc-test-h0tc2": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-jwt-test-vzusa": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-service-test-b647e": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
}},
|
||||
},
|
||||
ignoreTests: false,
|
||||
want: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
{Version: 2, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-grpc-test-h0tc2": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-jwt-test-vzusa": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-service-test-b647e": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "keeps previous snapshot with failed tests",
|
||||
in: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
{Version: 2, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-grpc-test-h0tc2": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-jwt-test-vzusa": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
"upgrade-test-fail-podinfo-service-test-b647e": {
|
||||
Phase: "Succeeded",
|
||||
},
|
||||
}},
|
||||
{Version: 1, Status: "superseded"},
|
||||
},
|
||||
ignoreTests: true,
|
||||
want: Snapshots{
|
||||
{Version: 4, Status: "deployed"},
|
||||
{Version: 3, Status: "superseded", TestHooks: &map[string]*TestHookStatus{
|
||||
"upgrade-test-fail-podinfo-fault-test-tiz9x": {Phase: "Failed"},
|
||||
"upgrade-test-fail-podinfo-grpc-test-gddcw": {},
|
||||
}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "retains most recent snapshots when all have failed",
|
||||
in: Snapshots{
|
||||
{Version: 6, Status: "deployed"},
|
||||
{Version: 5, Status: "failed"},
|
||||
{Version: 4, Status: "failed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "failed"},
|
||||
{Version: 1, Status: "failed"},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 6, Status: "deployed"},
|
||||
{Version: 5, Status: "failed"},
|
||||
{Version: 4, Status: "failed"},
|
||||
{Version: 3, Status: "failed"},
|
||||
{Version: 2, Status: "failed"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "without previous snapshot",
|
||||
in: Snapshots{
|
||||
{Version: 1, Status: "deployed"},
|
||||
},
|
||||
want: Snapshots{
|
||||
{Version: 1, Status: "deployed"},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tt.in.Truncate(tt.ignoreTests)
|
||||
|
||||
if !reflect.DeepEqual(tt.in, tt.want) {
|
||||
t.Errorf("Truncate() got %v, want %v", tt.in, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -1,749 +0,0 @@
|
|||
//go:build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"github.com/fluxcd/helm-controller/api/v2"
|
||||
"github.com/fluxcd/pkg/apis/kustomize"
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CrossNamespaceObjectReference) DeepCopyInto(out *CrossNamespaceObjectReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceObjectReference.
|
||||
func (in *CrossNamespaceObjectReference) DeepCopy() *CrossNamespaceObjectReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CrossNamespaceObjectReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceSourceReference.
|
||||
func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CrossNamespaceSourceReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DriftDetection) DeepCopyInto(out *DriftDetection) {
|
||||
*out = *in
|
||||
if in.Ignore != nil {
|
||||
in, out := &in.Ignore, &out.Ignore
|
||||
*out = make([]IgnoreRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriftDetection.
|
||||
func (in *DriftDetection) DeepCopy() *DriftDetection {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DriftDetection)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Filter) DeepCopyInto(out *Filter) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter.
|
||||
func (in *Filter) DeepCopy() *Filter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Filter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplate) DeepCopyInto(out *HelmChartTemplate) {
|
||||
*out = *in
|
||||
if in.ObjectMeta != nil {
|
||||
in, out := &in.ObjectMeta, &out.ObjectMeta
|
||||
*out = new(HelmChartTemplateObjectMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplate.
|
||||
func (in *HelmChartTemplate) DeepCopy() *HelmChartTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplateObjectMeta) DeepCopyInto(out *HelmChartTemplateObjectMeta) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplateObjectMeta.
|
||||
func (in *HelmChartTemplateObjectMeta) DeepCopy() *HelmChartTemplateObjectMeta {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplateObjectMeta)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplateSpec) DeepCopyInto(out *HelmChartTemplateSpec) {
|
||||
*out = *in
|
||||
out.SourceRef = in.SourceRef
|
||||
if in.Interval != nil {
|
||||
in, out := &in.Interval, &out.Interval
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.ValuesFiles != nil {
|
||||
in, out := &in.ValuesFiles, &out.ValuesFiles
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Verify != nil {
|
||||
in, out := &in.Verify, &out.Verify
|
||||
*out = new(HelmChartTemplateVerification)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplateSpec.
|
||||
func (in *HelmChartTemplateSpec) DeepCopy() *HelmChartTemplateSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplateSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmChartTemplateVerification) DeepCopyInto(out *HelmChartTemplateVerification) {
|
||||
*out = *in
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(meta.LocalObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartTemplateVerification.
|
||||
func (in *HelmChartTemplateVerification) DeepCopy() *HelmChartTemplateVerification {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmChartTemplateVerification)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRelease) DeepCopyInto(out *HelmRelease) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRelease.
|
||||
func (in *HelmRelease) DeepCopy() *HelmRelease {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRelease)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmRelease) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseList) DeepCopyInto(out *HelmReleaseList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmRelease, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseList.
|
||||
func (in *HelmReleaseList) DeepCopy() *HelmReleaseList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmReleaseList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) {
|
||||
*out = *in
|
||||
if in.Chart != nil {
|
||||
in, out := &in.Chart, &out.Chart
|
||||
*out = new(HelmChartTemplate)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ChartRef != nil {
|
||||
in, out := &in.ChartRef, &out.ChartRef
|
||||
*out = new(CrossNamespaceSourceReference)
|
||||
**out = **in
|
||||
}
|
||||
out.Interval = in.Interval
|
||||
if in.KubeConfig != nil {
|
||||
in, out := &in.KubeConfig, &out.KubeConfig
|
||||
*out = new(meta.KubeConfigReference)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.DependsOn != nil {
|
||||
in, out := &in.DependsOn, &out.DependsOn
|
||||
*out = make([]meta.NamespacedObjectReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.MaxHistory != nil {
|
||||
in, out := &in.MaxHistory, &out.MaxHistory
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.PersistentClient != nil {
|
||||
in, out := &in.PersistentClient, &out.PersistentClient
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.DriftDetection != nil {
|
||||
in, out := &in.DriftDetection, &out.DriftDetection
|
||||
*out = new(DriftDetection)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Install != nil {
|
||||
in, out := &in.Install, &out.Install
|
||||
*out = new(Install)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Upgrade != nil {
|
||||
in, out := &in.Upgrade, &out.Upgrade
|
||||
*out = new(Upgrade)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Test != nil {
|
||||
in, out := &in.Test, &out.Test
|
||||
*out = new(Test)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Rollback != nil {
|
||||
in, out := &in.Rollback, &out.Rollback
|
||||
*out = new(Rollback)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Uninstall != nil {
|
||||
in, out := &in.Uninstall, &out.Uninstall
|
||||
*out = new(Uninstall)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ValuesFrom != nil {
|
||||
in, out := &in.ValuesFrom, &out.ValuesFrom
|
||||
*out = make([]ValuesReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Values != nil {
|
||||
in, out := &in.Values, &out.Values
|
||||
*out = new(v1.JSON)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PostRenderers != nil {
|
||||
in, out := &in.PostRenderers, &out.PostRenderers
|
||||
*out = make([]PostRenderer, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseSpec.
|
||||
func (in *HelmReleaseSpec) DeepCopy() *HelmReleaseSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseStatus) DeepCopyInto(out *HelmReleaseStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]metav1.Condition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.History != nil {
|
||||
in, out := &in.History, &out.History
|
||||
*out = make(v2.Snapshots, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(v2.Snapshot)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
}
|
||||
out.ReconcileRequestStatus = in.ReconcileRequestStatus
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseStatus.
|
||||
func (in *HelmReleaseStatus) DeepCopy() *HelmReleaseStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *IgnoreRule) DeepCopyInto(out *IgnoreRule) {
|
||||
*out = *in
|
||||
if in.Paths != nil {
|
||||
in, out := &in.Paths, &out.Paths
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Target != nil {
|
||||
in, out := &in.Target, &out.Target
|
||||
*out = new(kustomize.Selector)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnoreRule.
|
||||
func (in *IgnoreRule) DeepCopy() *IgnoreRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(IgnoreRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Install) DeepCopyInto(out *Install) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.Remediation != nil {
|
||||
in, out := &in.Remediation, &out.Remediation
|
||||
*out = new(InstallRemediation)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Install.
|
||||
func (in *Install) DeepCopy() *Install {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Install)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *InstallRemediation) DeepCopyInto(out *InstallRemediation) {
|
||||
*out = *in
|
||||
if in.IgnoreTestFailures != nil {
|
||||
in, out := &in.IgnoreTestFailures, &out.IgnoreTestFailures
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.RemediateLastFailure != nil {
|
||||
in, out := &in.RemediateLastFailure, &out.RemediateLastFailure
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallRemediation.
|
||||
func (in *InstallRemediation) DeepCopy() *InstallRemediation {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(InstallRemediation)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Kustomize) DeepCopyInto(out *Kustomize) {
|
||||
*out = *in
|
||||
if in.Patches != nil {
|
||||
in, out := &in.Patches, &out.Patches
|
||||
*out = make([]kustomize.Patch, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.PatchesStrategicMerge != nil {
|
||||
in, out := &in.PatchesStrategicMerge, &out.PatchesStrategicMerge
|
||||
*out = make([]v1.JSON, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.PatchesJSON6902 != nil {
|
||||
in, out := &in.PatchesJSON6902, &out.PatchesJSON6902
|
||||
*out = make([]kustomize.JSON6902Patch, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Images != nil {
|
||||
in, out := &in.Images, &out.Images
|
||||
*out = make([]kustomize.Image, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kustomize.
|
||||
func (in *Kustomize) DeepCopy() *Kustomize {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Kustomize)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PostRenderer) DeepCopyInto(out *PostRenderer) {
|
||||
*out = *in
|
||||
if in.Kustomize != nil {
|
||||
in, out := &in.Kustomize, &out.Kustomize
|
||||
*out = new(Kustomize)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostRenderer.
|
||||
func (in *PostRenderer) DeepCopy() *PostRenderer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PostRenderer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Rollback) DeepCopyInto(out *Rollback) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rollback.
|
||||
func (in *Rollback) DeepCopy() *Rollback {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Rollback)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Snapshot) DeepCopyInto(out *Snapshot) {
|
||||
*out = *in
|
||||
in.FirstDeployed.DeepCopyInto(&out.FirstDeployed)
|
||||
in.LastDeployed.DeepCopyInto(&out.LastDeployed)
|
||||
in.Deleted.DeepCopyInto(&out.Deleted)
|
||||
if in.TestHooks != nil {
|
||||
in, out := &in.TestHooks, &out.TestHooks
|
||||
*out = new(map[string]*TestHookStatus)
|
||||
if **in != nil {
|
||||
in, out := *in, *out
|
||||
*out = make(map[string]*TestHookStatus, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal *TestHookStatus
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
inVal := (*in)[key]
|
||||
in, out := &inVal, &outVal
|
||||
*out = new(TestHookStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
(*out)[key] = outVal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshot.
|
||||
func (in *Snapshot) DeepCopy() *Snapshot {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Snapshot)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in Snapshots) DeepCopyInto(out *Snapshots) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(Snapshots, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(Snapshot)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshots.
|
||||
func (in Snapshots) DeepCopy() Snapshots {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Snapshots)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Test) DeepCopyInto(out *Test) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.Filters != nil {
|
||||
in, out := &in.Filters, &out.Filters
|
||||
*out = new([]Filter)
|
||||
if **in != nil {
|
||||
in, out := *in, *out
|
||||
*out = make([]Filter, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Test.
|
||||
func (in *Test) DeepCopy() *Test {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Test)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TestHookStatus) DeepCopyInto(out *TestHookStatus) {
|
||||
*out = *in
|
||||
in.LastStarted.DeepCopyInto(&out.LastStarted)
|
||||
in.LastCompleted.DeepCopyInto(&out.LastCompleted)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestHookStatus.
|
||||
func (in *TestHookStatus) DeepCopy() *TestHookStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TestHookStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Uninstall) DeepCopyInto(out *Uninstall) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.DeletionPropagation != nil {
|
||||
in, out := &in.DeletionPropagation, &out.DeletionPropagation
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Uninstall.
|
||||
func (in *Uninstall) DeepCopy() *Uninstall {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Uninstall)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Upgrade) DeepCopyInto(out *Upgrade) {
|
||||
*out = *in
|
||||
if in.Timeout != nil {
|
||||
in, out := &in.Timeout, &out.Timeout
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
if in.Remediation != nil {
|
||||
in, out := &in.Remediation, &out.Remediation
|
||||
*out = new(UpgradeRemediation)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Upgrade.
|
||||
func (in *Upgrade) DeepCopy() *Upgrade {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Upgrade)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UpgradeRemediation) DeepCopyInto(out *UpgradeRemediation) {
|
||||
*out = *in
|
||||
if in.IgnoreTestFailures != nil {
|
||||
in, out := &in.IgnoreTestFailures, &out.IgnoreTestFailures
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.RemediateLastFailure != nil {
|
||||
in, out := &in.RemediateLastFailure, &out.RemediateLastFailure
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Strategy != nil {
|
||||
in, out := &in.Strategy, &out.Strategy
|
||||
*out = new(RemediationStrategy)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeRemediation.
|
||||
func (in *UpgradeRemediation) DeepCopy() *UpgradeRemediation {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UpgradeRemediation)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ValuesReference) DeepCopyInto(out *ValuesReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValuesReference.
|
||||
func (in *ValuesReference) DeepCopy() *ValuesReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ValuesReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||
kind: Kustomization
|
||||
namespace: helm-system
|
||||
resources:
|
||||
- https://github.com/fluxcd/source-controller/releases/download/v1.6.0/source-controller.crds.yaml
|
||||
- https://github.com/fluxcd/source-controller/releases/download/v1.6.0/source-controller.deployment.yaml
|
||||
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0-rc.4/source-controller.crds.yaml
|
||||
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0-rc.4/source-controller.deployment.yaml
|
||||
- ../crd
|
||||
- ../rbac
|
||||
- ../manager
|
||||
|
|
|
@ -5,4 +5,4 @@ resources:
|
|||
images:
|
||||
- name: fluxcd/helm-controller
|
||||
newName: fluxcd/helm-controller
|
||||
newTag: v1.3.0
|
||||
newTag: v0.34.0
|
||||
|
|
|
@ -45,7 +45,6 @@ rules:
|
|||
- source.toolkit.fluxcd.io
|
||||
resources:
|
||||
- helmcharts
|
||||
- ocirepositories
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
|
@ -54,6 +53,5 @@ rules:
|
|||
- source.toolkit.fluxcd.io
|
||||
resources:
|
||||
- helmcharts/status
|
||||
- ocirepositories/status
|
||||
verbs:
|
||||
- get
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-ocirepository
|
||||
spec:
|
||||
interval: 5m
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: podinfo
|
||||
test:
|
||||
enable: true
|
||||
values:
|
||||
replicaCount: 2
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-gitrepository
|
||||
|
@ -10,3 +10,9 @@ spec:
|
|||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: podinfo
|
||||
interval: 1m
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
test:
|
||||
enable: true
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-helmrepository
|
||||
|
@ -11,4 +11,9 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
test:
|
||||
enable: true
|
|
@ -1,9 +0,0 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
spec:
|
||||
interval: 1m
|
||||
url: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
ref:
|
||||
semver: 6.x
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: podinfo
|
|
@ -11,6 +11,6 @@ spec:
|
|||
{{- if .Values.branch }}
|
||||
branch: "{{ .Values.branch }}"
|
||||
{{- end}}
|
||||
{{- if .Values.tag }}
|
||||
{{- if .Values.branch }}
|
||||
tag: "{{ .Values.tag }}"
|
||||
{{- end}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: crds-upgrade-test
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: crds-upgrade-test
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: crds-upgrade-test
|
||||
|
|
|
@ -51,7 +51,7 @@ spec:
|
|||
interval: 1m
|
||||
url: https://stefanprodan.github.io/podinfo
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: backend
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: frontend
|
||||
|
|
|
@ -51,7 +51,7 @@ spec:
|
|||
interval: 1m
|
||||
url: https://stefanprodan.github.io/podinfo
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
@ -67,7 +67,7 @@ spec:
|
|||
kind: HelmRepository
|
||||
name: podinfo
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-create-target-ns
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-fail-remediate
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,12 +11,10 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
install:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
uninstall:
|
||||
keepHistory: true
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-fail-retry
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
install:
|
||||
remediation:
|
||||
retries: 1
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-fail
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
kind: HelmChart
|
||||
metadata:
|
||||
name: podinfo-hc
|
||||
spec:
|
||||
chart: podinfo
|
||||
version: '6.2.1'
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo-oci
|
||||
interval: 30s
|
||||
verify:
|
||||
provider: cosign
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-from-hc
|
||||
spec:
|
||||
chartRef:
|
||||
kind: HelmChart
|
||||
name: podinfo-hc
|
||||
interval: 30s
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
|
@ -1,25 +0,0 @@
|
|||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo-ocirepo
|
||||
spec:
|
||||
interval: 30s
|
||||
url: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
ref:
|
||||
tag: 6.6.0
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-from-ocirepo
|
||||
spec:
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: podinfo-ocirepo
|
||||
interval: 30s
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-test-fail-ignore
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
test:
|
||||
enable: true
|
||||
ignoreFailures: true
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-test-fail
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
test:
|
||||
enable: true
|
||||
values:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-git
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-oci
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: post-renderer-kustomize
|
||||
|
@ -7,7 +7,7 @@ spec:
|
|||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
version: '>=6.0.0 <6.9.0'
|
||||
version: '>=6.0.0 <7.0.0'
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
|
@ -16,20 +16,20 @@ spec:
|
|||
fullnameOverride: mypodinfo
|
||||
postRenderers:
|
||||
- kustomize:
|
||||
patches:
|
||||
- patch: |
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: mypodinfo
|
||||
labels:
|
||||
xxxx: yyyy
|
||||
patchesStrategicMerge:
|
||||
- kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: mypodinfo
|
||||
labels:
|
||||
xxxx: yyyy
|
||||
patchesJson6902:
|
||||
- target:
|
||||
group: apps
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: mypodinfo
|
||||
patch: |
|
||||
- op: add
|
||||
path: /metadata/labels/yyyy
|
||||
value: xxxx
|
||||
patch:
|
||||
- op: add
|
||||
path: /metadata/labels/yyyy
|
||||
value: xxxx
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: status-defaults
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: targetnamespace
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate-uninstall
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate-uninstall
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-retry
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-retry
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
upgrade:
|
||||
remediation:
|
||||
retries: 1
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: upgrade-from-ocirepo-source
|
||||
spec:
|
||||
interval: 30s
|
||||
url: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
ref:
|
||||
digest: "sha256:cdd538a0167e4b51152b71a477e51eb6737553510ce8797dbcc537e1342311bb"
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-from-ocirepo-source
|
||||
spec:
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: upgrade-from-ocirepo-source
|
||||
interval: 30s
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: upgrade-from-ocirepo-source
|
||||
spec:
|
||||
interval: 30s
|
||||
url: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
ref:
|
||||
digest: "sha256:0cc9a8446c95009ef382f5eade883a67c257f77d50f84e78ecef2aac9428d1e5"
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-test-fail
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-test-fail
|
||||
spec:
|
||||
interval: 30s
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
test:
|
||||
enable: true
|
||||
values:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: valuesfrom
|
||||
|
@ -11,7 +11,7 @@ spec:
|
|||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 10m
|
||||
interval: 1m
|
||||
valuesFrom:
|
||||
- kind: ConfigMap
|
||||
name: valuesfrom-config
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h1>Helm API reference v2beta1</h1>
|
||||
<h1>HelmRelease API reference</h1>
|
||||
<p>Packages:</p>
|
||||
<ul class="simple">
|
||||
<li>
|
||||
|
@ -92,9 +92,7 @@ Kubernetes meta/v1.Duration
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Interval at which to reconcile the Helm release.
|
||||
This interval is approximate and may be subject to jitter to ensure
|
||||
efficient use of resources.</p>
|
||||
<p>Interval at which to reconcile the Helm release.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -903,9 +901,7 @@ Kubernetes meta/v1.Duration
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Interval at which to reconcile the Helm release.
|
||||
This interval is approximate and may be subject to jitter to ensure
|
||||
efficient use of resources.</p>
|
||||
<p>Interval at which to reconcile the Helm release.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1944,19 +1940,6 @@ bool
|
|||
a Helm uninstall is performed.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>deletionPropagation</code><br>
|
||||
<em>
|
||||
string
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>DeletionPropagation specifies the deletion propagation policy when
|
||||
a Helm uninstall is performed.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
3086
docs/api/v2/helm.md
3086
docs/api/v2/helm.md
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -35,7 +35,6 @@ actions that should be (conditionally) executed. Based on this the reconciler:
|
|||
- performs a Helm install or upgrade action if needed
|
||||
- performs a Helm test action if enabled
|
||||
- performs a reconciliation strategy (rollback, uninstall) and retries as configured if any Helm action failed
|
||||
- performs in cluster drift detection and correction if enabled
|
||||
|
||||
The controller that runs these Helm actions relies on [source-controller](https://github.com/fluxcd/source-controller)
|
||||
for providing the Helm charts from Helm repositories or any other source that source-controller
|
||||
|
@ -51,7 +50,7 @@ trigger a Helm uninstall.
|
|||
Alerting can be configured with a Kubernetes custom resource that specifies a webhook address, and a
|
||||
group of `HelmRelease` resources to be monitored using the [notification-controller](https://github.com/fluxcd/notification-controller).
|
||||
|
||||
The API design of the controller can be found at [helm.toolkit.fluxcd.io/v2](./v2/helmreleases.md).
|
||||
The API design of the controller can be found at [helm.toolkit.fluxcd.io/v2beta1](./v2beta1/helmreleases.md).
|
||||
|
||||
## Backward compatibility
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# helm.toolkit.fluxcd.io/v2
|
||||
|
||||
This is the v2 API specification for declaratively managing Helm chart
|
||||
releases with Kubernetes manifests.
|
||||
|
||||
## Specification
|
||||
|
||||
- [HelmRelease CRD](helmreleases.md)
|
||||
+ [Example](helmreleases.md#example)
|
||||
+ [Writing a HelmRelease spec](helmreleases.md#writing-a-helmrelease-spec)
|
||||
+ [Working with HelmReleases](helmreleases.md#working-with-helmreleases)
|
||||
+ [HelmRelease Status](helmreleases.md#helmrelease-status)
|
||||
|
||||
## Implementation
|
||||
|
||||
* [helm-controller](https://github.com/fluxcd/helm-controller/)
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,5 @@
|
|||
# Helm Releases
|
||||
|
||||
<!-- menuweight:20 -->
|
||||
|
||||
The `HelmRelease` API defines a resource for automated controller driven Helm releases.
|
||||
|
||||
## Specification
|
||||
|
@ -20,8 +18,6 @@ type HelmReleaseSpec struct {
|
|||
Chart HelmChartTemplate `json:"chart"`
|
||||
|
||||
// Interval at which to reconcile the Helm release.
|
||||
// This interval is approximate and may be subject to jitter to ensure
|
||||
// efficient use of resources.
|
||||
// +required
|
||||
Interval metav1.Duration `json:"interval"`
|
||||
|
||||
|
@ -484,13 +480,6 @@ type Uninstall struct {
|
|||
// a Helm uninstall is performed.
|
||||
// +optional
|
||||
DisableWait bool `json:"disableWait,omitempty"`
|
||||
|
||||
// DeletionPropagation specifies the deletion propagation policy when
|
||||
// a Helm uninstall is performed.
|
||||
// +kubebuilder:default=background
|
||||
// +kubebuilder:validation:Enum=background;foreground;orphan
|
||||
// +optional
|
||||
DeletionPropagation *string `json:"deletionPropagation,omitempty"`
|
||||
}
|
||||
|
||||
// Kustomize Helm PostRenderer specification.
|
||||
|
@ -824,11 +813,6 @@ desired state, so an upgrade is made in this case as well.
|
|||
The `spec.interval` tells the reconciler at which interval to reconcile the release. The
|
||||
interval time units are `s`, `m` and `h` e.g. `interval: 5m`, the minimum value should be 60 seconds.
|
||||
|
||||
**Note:** The controller can be configured to apply a jitter to the interval in
|
||||
order to distribute the load more evenly when multiple HelmRelease objects are
|
||||
set up with the same interval. For more information, please refer to the
|
||||
[helm-controller configuration options](https://fluxcd.io/flux/components/helm/options/).
|
||||
|
||||
The reconciler can be told to reconcile the `HelmRelease` outside of the specified interval
|
||||
by annotating the object with a `reconcile.fluxcd.io/requestedAt` annotation. For example:
|
||||
|
||||
|
@ -1027,7 +1011,7 @@ spec:
|
|||
## Role-based access control
|
||||
|
||||
By default, a `HelmRelease` runs under the cluster admin account and can create, modify, delete cluster level objects
|
||||
(cluster roles, cluster role binding, CRDs, etc) and namespaced objects (deployments, ingresses, etc).
|
||||
(cluster roles, cluster role binding, CRDs, etc) and namespeced objects (deployments, ingresses, etc).
|
||||
For certain `HelmReleases` a cluster admin may wish to control what types of Kubernetes objects can
|
||||
be reconciled and under which namespace.
|
||||
To restrict a `HelmRelease`, one can assign a service account under which the reconciliation is performed.
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# helm.toolkit.fluxcd.io/v2beta2
|
||||
|
||||
This is the v2beta2 API specification for declaratively managing Helm chart
|
||||
releases with Kubernetes manifests.
|
||||
|
||||
## Specification
|
||||
|
||||
- [HelmRelease CRD](helmreleases.md)
|
||||
+ [Example](helmreleases.md#example)
|
||||
+ [Writing a HelmRelease spec](helmreleases.md#writing-a-helmrelease-spec)
|
||||
+ [Working with HelmReleases](helmreleases.md#working-with-helmreleases)
|
||||
+ [HelmRelease Status](helmreleases.md#helmrelease-status)
|
||||
|
||||
## Implementation
|
||||
|
||||
* [helm-controller](https://github.com/fluxcd/helm-controller/)
|
File diff suppressed because it is too large
Load Diff
304
go.mod
304
go.mod
|
@ -1,225 +1,173 @@
|
|||
module github.com/fluxcd/helm-controller
|
||||
|
||||
go 1.24.0
|
||||
go 1.18
|
||||
|
||||
replace github.com/fluxcd/helm-controller/api => ./api
|
||||
|
||||
require (
|
||||
github.com/fluxcd/helm-controller/api v0.34.0
|
||||
github.com/fluxcd/pkg/apis/acl v0.1.0
|
||||
github.com/fluxcd/pkg/apis/event v0.5.0
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.1.0
|
||||
github.com/fluxcd/pkg/apis/meta v1.1.0
|
||||
github.com/fluxcd/pkg/runtime v0.38.1
|
||||
github.com/fluxcd/pkg/ssa v0.28.1
|
||||
github.com/fluxcd/source-controller/api v1.0.0-rc.4
|
||||
github.com/go-logr/logr v1.2.4
|
||||
github.com/google/go-cmp v0.5.9
|
||||
github.com/hashicorp/go-retryablehttp v0.7.2
|
||||
github.com/onsi/gomega v1.27.7
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/go-digest/blake3 v0.0.0-20230329235805-65fac7b55eb7
|
||||
github.com/spf13/pflag v1.0.5
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
helm.sh/helm/v3 v3.12.0
|
||||
k8s.io/api v0.27.2
|
||||
k8s.io/apiextensions-apiserver v0.27.2
|
||||
k8s.io/apimachinery v0.27.2
|
||||
k8s.io/cli-runtime v0.27.2
|
||||
k8s.io/client-go v0.27.2
|
||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106
|
||||
sigs.k8s.io/cli-utils v0.34.0
|
||||
sigs.k8s.io/controller-runtime v0.15.0
|
||||
sigs.k8s.io/kustomize/api v0.13.4
|
||||
sigs.k8s.io/yaml v1.3.0
|
||||
)
|
||||
|
||||
// Replace digest lib to master to gather access to BLAKE3.
|
||||
// xref: https://github.com/opencontainers/go-digest/pull/66
|
||||
replace github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.1-0.20231025023718-d50d2fec9c98
|
||||
replace github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.1-0.20220411205349-bde1400a84be
|
||||
|
||||
// Pin kustomize to v5.7.0
|
||||
// Pin kustomize to v5.0.3
|
||||
replace (
|
||||
sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.20.0
|
||||
sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.20.0
|
||||
sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.13.4
|
||||
sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.3.0
|
||||
github.com/fluxcd/cli-utils v0.36.0-flux.14
|
||||
github.com/fluxcd/helm-controller/api v1.3.0
|
||||
github.com/fluxcd/pkg/apis/acl v0.8.0
|
||||
github.com/fluxcd/pkg/apis/event v0.18.0
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.11.0
|
||||
github.com/fluxcd/pkg/apis/meta v1.18.0
|
||||
github.com/fluxcd/pkg/auth v0.27.0
|
||||
github.com/fluxcd/pkg/cache v0.10.0
|
||||
github.com/fluxcd/pkg/chartutil v1.9.0
|
||||
github.com/fluxcd/pkg/runtime v0.80.0
|
||||
github.com/fluxcd/pkg/ssa v0.51.0
|
||||
github.com/fluxcd/pkg/testserver v0.11.0
|
||||
github.com/fluxcd/source-controller/api v1.6.0
|
||||
github.com/go-logr/logr v1.4.3
|
||||
github.com/google/cel-go v0.23.2
|
||||
github.com/google/go-cmp v0.7.0
|
||||
github.com/hashicorp/go-retryablehttp v0.7.8
|
||||
github.com/mitchellh/copystructure v1.2.0
|
||||
github.com/onsi/gomega v1.37.0
|
||||
github.com/opencontainers/go-digest v1.0.1-0.20231025023718-d50d2fec9c98
|
||||
github.com/opencontainers/go-digest/blake3 v0.0.0-20250116041648-1e56c6daea3b
|
||||
github.com/spf13/pflag v1.0.6
|
||||
github.com/wI2L/jsondiff v0.7.0
|
||||
golang.org/x/text v0.27.0
|
||||
helm.sh/helm/v3 v3.18.4
|
||||
k8s.io/api v0.33.2
|
||||
k8s.io/apiextensions-apiserver v0.33.2
|
||||
k8s.io/apimachinery v0.33.2
|
||||
k8s.io/cli-runtime v0.33.2
|
||||
k8s.io/client-go v0.33.2
|
||||
k8s.io/kubectl v0.33.2
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
|
||||
sigs.k8s.io/controller-runtime v0.21.0
|
||||
sigs.k8s.io/kustomize/api v0.20.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.20.0
|
||||
sigs.k8s.io/yaml v1.5.0
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.23.0 // indirect
|
||||
cloud.google.com/go/auth v0.16.2 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.7.0 // indirect
|
||||
dario.cat/mergo v1.0.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry v0.2.3 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice v1.0.0 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
|
||||
github.com/BurntSushi/toml v1.5.0 // indirect
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/BurntSushi/toml v1.2.1 // indirect
|
||||
github.com/MakeNowJust/heredoc v1.0.0 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
|
||||
github.com/Masterminds/squirrel v1.5.4 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.36.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.29.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.70 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.45.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.33.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.66.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect
|
||||
github.com/aws/smithy-go v1.22.4 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.2.0 // indirect
|
||||
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
|
||||
github.com/Masterminds/squirrel v1.5.3 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/carapace-sh/carapace-shlex v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/chai2010/gettext-go v1.0.2 // indirect
|
||||
github.com/containerd/containerd v1.7.27 // indirect
|
||||
github.com/containerd/errdefs v1.0.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/platforms v0.2.1 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/docker/cli v28.2.2+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.9.3 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
|
||||
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
|
||||
github.com/containerd/containerd v1.7.0 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/docker/cli v20.10.21+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.2+incompatible // indirect
|
||||
github.com/docker/docker v20.10.24+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.7.0 // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-metrics v0.0.1 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
|
||||
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
|
||||
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
|
||||
github.com/fatih/color v1.16.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
|
||||
github.com/go-errors/errors v1.5.1 // indirect
|
||||
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-gorp/gorp/v3 v3.0.5 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-logr/zapr v1.3.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.1 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.1 // indirect
|
||||
github.com/go-logr/zapr v1.2.4 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.1 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/gnostic-models v0.7.0 // indirect
|
||||
github.com/google/go-containerregistry v0.20.6 // indirect
|
||||
github.com/google/s2a-go v0.1.9 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
|
||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/gnostic v0.6.9 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/gosuri/uitable v0.0.4 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/huandu/xstrings v1.5.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.4.0 // indirect
|
||||
github.com/huandu/xstrings v1.4.0 // indirect
|
||||
github.com/imdario/mergo v0.3.13 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
||||
github.com/jmoiron/sqlx v1.3.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/klauspost/compress v1.16.0 // indirect
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
github.com/lib/pq v1.10.9 // indirect
|
||||
github.com/lib/pq v1.10.7 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/mailru/easyjson v0.9.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/spdystream v0.5.0 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/moby/locker v1.0.1 // indirect
|
||||
github.com/moby/spdystream v0.2.0 // indirect
|
||||
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||
github.com/morikuni/aec v1.0.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/opencontainers/image-spec v1.1.1 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.65.0 // indirect
|
||||
github.com/prometheus/procfs v0.17.0 // indirect
|
||||
github.com/rubenv/sql-migrate v1.8.0 // indirect
|
||||
github.com/prometheus/client_golang v1.15.1 // indirect
|
||||
github.com/prometheus/client_model v0.4.0 // indirect
|
||||
github.com/prometheus/common v0.42.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/rubenv/sql-migrate v1.3.1 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/shopspring/decimal v1.4.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/spf13/cast v1.7.0 // indirect
|
||||
github.com/spf13/cobra v1.9.1 // indirect
|
||||
github.com/stoewer/go-strcase v1.3.0 // indirect
|
||||
github.com/stretchr/testify v1.10.0 // indirect
|
||||
github.com/tidwall/gjson v1.18.0 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.1 // indirect
|
||||
github.com/tidwall/sjson v1.2.5 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/cobra v1.6.1 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
github.com/zeebo/blake3 v0.2.3 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
|
||||
go.opentelemetry.io/otel v1.37.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.37.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.37.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||
golang.org/x/crypto v0.39.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
|
||||
golang.org/x/net v0.41.0 // indirect
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/sys v0.34.0 // indirect
|
||||
golang.org/x/term v0.33.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
|
||||
google.golang.org/api v0.241.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
|
||||
google.golang.org/grpc v1.73.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
github.com/xlab/treeprint v1.1.0 // indirect
|
||||
github.com/zeebo/blake3 v0.1.1 // indirect
|
||||
go.opentelemetry.io/otel v1.14.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.14.0 // indirect
|
||||
go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 // indirect
|
||||
go.uber.org/atomic v1.10.0 // indirect
|
||||
go.uber.org/multierr v1.8.0 // indirect
|
||||
go.uber.org/zap v1.24.0 // indirect
|
||||
golang.org/x/crypto v0.5.0 // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
golang.org/x/oauth2 v0.5.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/term v0.8.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
|
||||
google.golang.org/grpc v1.53.0 // indirect
|
||||
google.golang.org/protobuf v1.30.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
gotest.tools/v3 v3.4.0 // indirect
|
||||
k8s.io/apiserver v0.33.2 // indirect
|
||||
k8s.io/component-base v0.33.2 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 // indirect
|
||||
oras.land/oras-go/v2 v2.6.0 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
|
||||
k8s.io/apiserver v0.27.2 // indirect
|
||||
k8s.io/component-base v0.27.2 // indirect
|
||||
k8s.io/klog/v2 v2.100.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
|
||||
k8s.io/kubectl v0.27.1 // indirect
|
||||
oras.land/oras-go v1.2.2 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.14.2 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
)
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
{{ define "packages" }}
|
||||
<h1>Helm API reference
|
||||
{{- with (index .packages 0) -}}
|
||||
{{ with (index .GoPackages 0 ) -}}
|
||||
{{ printf " %s" .Name -}}
|
||||
{{ end -}}
|
||||
{{ end }}</h1>
|
||||
<h1>HelmRelease API reference</h1>
|
||||
|
||||
{{ with .packages}}
|
||||
<p>Packages:</p>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
Copyright 2021 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
Copyright 2023 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package acl
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/fluxcd/pkg/runtime/acl"
|
||||
)
|
||||
|
||||
var (
|
||||
// AllowCrossNamespaceRef is a global flag that can be used to allow
|
||||
// cross-namespace references.
|
||||
AllowCrossNamespaceRef = false
|
||||
)
|
||||
|
||||
// AllowsAccessTo returns an error if the object does not allow access to the
|
||||
// given reference.
|
||||
func AllowsAccessTo(obj client.Object, kind string, ref types.NamespacedName) error {
|
||||
if !AllowCrossNamespaceRef && obj.GetNamespace() != ref.Namespace {
|
||||
return acl.AccessDeniedError(fmt.Sprintf("cross-namespace references are not allowed: cannot access %s %s",
|
||||
kind, ref.String(),
|
||||
))
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
Copyright 2023 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package acl
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2"
|
||||
)
|
||||
|
||||
func TestAllowsAccessTo(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
allow bool
|
||||
obj client.Object
|
||||
ref types.NamespacedName
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "allow cross-namespace reference",
|
||||
allow: true,
|
||||
obj: &v2.HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "some-name",
|
||||
Namespace: "some-namespace",
|
||||
},
|
||||
},
|
||||
ref: types.NamespacedName{
|
||||
Name: "some-name",
|
||||
Namespace: "some-other-namespace",
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "disallow cross-namespace reference",
|
||||
allow: false,
|
||||
obj: &v2.HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "some-name",
|
||||
Namespace: "some-namespace",
|
||||
},
|
||||
},
|
||||
ref: types.NamespacedName{
|
||||
Name: "some-name",
|
||||
Namespace: "some-other-namespace",
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "allow same-namespace reference",
|
||||
allow: false,
|
||||
obj: &v2.HelmRelease{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "some-name",
|
||||
Namespace: "some-namespace",
|
||||
},
|
||||
},
|
||||
ref: types.NamespacedName{
|
||||
Name: "some-name",
|
||||
Namespace: "some-namespace",
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
curAllow := AllowCrossNamespaceRef
|
||||
AllowCrossNamespaceRef = tt.allow
|
||||
t.Cleanup(func() { AllowCrossNamespaceRef = curAllow })
|
||||
|
||||
if err := AllowsAccessTo(tt.obj, "mock", tt.ref); (err != nil) != tt.wantErr {
|
||||
t.Errorf("AllowsAccessTo() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue