Compare commits

...

835 Commits

Author SHA1 Message Date
Matheus Pimenta cf5702068b
Merge pull request #1286 from cappyzawa/feat/object-level-config-validation
Add object-level configuration validation
2025-08-17 17:17:35 +01:00
cappyzawa 5aa1414d79
Add object-level configuration validation
Validates that ObjectLevelWorkloadIdentity feature gate is enabled
when default kubeconfig service account flags are set. This prevents
misconfiguration where lockdown flags are used without enabling
the required feature gate.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-18 00:51:48 +09:00
Matheus Pimenta b549f4f76e
Merge pull request #1284 from cappyzawa/rfc-0010-multi-tenancy-lockdown
[RFC-0010] Add multi-tenancy lockdown for kubeconfig
2025-08-17 10:04:15 +01:00
cappyzawa 82fae0c8eb
[RFC-0010] Add multi-tenancy lockdown for kubeconfig
Adds new controller flag to enforce ServiceAccount usage in
multi-tenant clusters where administrators need to lock down workload
identity access:

- --default-kubeconfig-service-account

This flag complements the existing --default-service-account flag to
provide multi-tenancy lockdown coverage for kubeconfig ServiceAccount
fields in the HelmRelease API.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-17 17:44:14 +09:00
Stefan Prodan 5c7f2c8abf
Merge pull request #1282 from fluxcd/action-duration
Record the last Helm release action duration in status
2025-08-13 14:12:03 +03:00
Stefan Prodan acc61348b4
Record the last Helm release action duration in status
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-08-13 13:36:05 +03:00
Stefan Prodan 28bf06454e
Merge pull request #1280 from fluxcd/remove-v2beta1-api
Remove deprecated APIs in group `helm.toolkit.fluxcd.io/v2beta1`
2025-08-11 17:54:01 +03:00
Stefan Prodan d7cd9ae5be
Remove deprecated APIs in group `helm.toolkit.fluxcd.io/v2beta1`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-08-08 14:34:51 +03:00
Matheus Pimenta 8555152550
Merge pull request #1276 from fluxcd/fix-source-requeue
Fix requeue interval for SourceNotReady
2025-07-31 16:39:45 +01:00
Matheus Pimenta 593c05e0c8
Fix requeue interval for SourceNotReady
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-31 16:27:21 +01:00
Stefan Prodan 183a4f4ae7
Merge pull request #1271 from fluxcd/feat-dependson-cel
Extend the readiness evaluation of dependencies with CEL expressions
2025-07-29 08:28:00 +03:00
Stefan Prodan 40d128a05d
docs: Add dependency ready expression to API docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-07-23 09:00:17 +03:00
Stefan Prodan 32f20f7344
controller: Implement CEL evaluation for dependency checks
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-07-23 09:00:10 +03:00
Stefan Prodan 9b6b090ca4
controller: Add `AdditiveCELDependencyCheck` feature gate
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-07-22 22:06:12 +03:00
Stefan Prodan 6d5856c00e
controller: Move manager and indexers to dedicated files
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-07-22 21:18:55 +03:00
Stefan Prodan 4ffe621c6b
api: Add the `readyExpr` field to `dependsOn`
Extend the readiness evaluation of dependencies with CEL expressions

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-07-22 21:09:30 +03:00
Matheus Pimenta fc12477df0
Merge pull request #1267 from ymettier/fix-issue-1265
Fix continuous drift due to unstable hashing of values
2025-07-21 09:38:47 +01:00
Yves Mettier d4cfe9de0e Fix continuous drift due to unstable hashing of values
Signed-off-by: Yves Mettier <ymettier@free.fr>
2025-07-21 09:21:56 +01:00
Matheus Pimenta 5a28a7610e
Merge pull request #1266 from fluxcd/fix-source-index
Fix watch index conflict between HelmChart and OCIRepository kinds
2025-07-19 18:40:16 +01:00
Matheus Pimenta 7780c45bf3
Fix watch index conflict between HelmChart and OCIRepository kinds
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-19 18:06:12 +01:00
Matheus Pimenta 3b75b3b8b8
Merge pull request #1262 from fluxcd/restconfig-azure-cloud
[RFC-0010] Support all Azure clouds for remote clusters at the controller level
2025-07-18 08:25:40 +01:00
Matheus Pimenta 29fd31c6eb
[RFC-0010] Support all Azure clouds for remote clusters at the controller level
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-18 08:11:02 +01:00
Matheus Pimenta 3bb7850483
Merge pull request #1258 from fluxcd/watch-label
Introduce label selector for watching ConfigMaps and Secrets
2025-07-17 10:38:46 +01:00
Matheus Pimenta 7c18470676
Introduce label selector for watching ConfigMaps and Secrets
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-17 10:28:09 +01:00
Stefan Prodan 0971d38c41
Merge pull request #1257 from fluxcd/dependabot-schedule
Update dependabot config
2025-07-15 10:53:11 +03:00
Stefan Prodan 1d4c164221
Update dependabot config
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-07-15 09:01:42 +03:00
Stefan Prodan 050b2ca508
Merge pull request #1246 from fluxcd/dependabot/github_actions/ci-f6eef230b4
Bump the ci group across 1 directory with 6 updates
2025-07-15 08:57:12 +03:00
dependabot[bot] 15635bc28f
Bump the ci group across 1 directory with 6 updates
Bumps the ci group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [korthout/backport-action](https://github.com/korthout/backport-action) | `3.2.0` | `3.2.1` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.10.0` | `3.11.1` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.17.0` | `6.18.0` |
| [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.8.2` | `3.9.1` |
| [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.20.0` | `0.20.1` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.28.18` | `3.29.0` |



Updates `korthout/backport-action` from 3.2.0 to 3.2.1
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](436145e922...0193454f0c)

Updates `docker/setup-buildx-action` from 3.10.0 to 3.11.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](b5ca514318...e468171a9d)

Updates `docker/build-push-action` from 6.17.0 to 6.18.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](1dc7386353...263435318d)

Updates `sigstore/cosign-installer` from 3.8.2 to 3.9.1
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](3454372f43...398d4b0eee)

Updates `anchore/sbom-action` from 0.20.0 to 0.20.1
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](e11c554f70...9246b90769)

Updates `github/codeql-action` from 3.28.18 to 3.29.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ff0a06e83c...ce28f5bb42)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-version: 3.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-version: 3.11.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-version: 6.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.9.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-version: 0.20.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-version: 3.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-15 04:36:57 +00:00
Matheus Pimenta d992a7920f
Merge pull request #1249 from fluxcd/restconfig
[RFC-0010] Introduce workload identity auth for remote clusters
2025-07-14 18:46:02 +01:00
Matheus Pimenta 12ad940135
[RFC-0010] Introduce workload identity auth for remote clusters
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-14 16:56:11 +01:00
Matheus Pimenta 2bb5c51dfe
Merge pull request #1247 from cappyzawa/update-kustomize-v5.7.0
Update kustomize to v5.7.0
2025-06-30 11:06:27 +01:00
cappyzawa 4862194f41
Update kustomize to v5.7.0
Update kustomize from v5.6.0 to v5.7.0 for consistency across
FluxCD components, aligning with the kustomize-controller
update that addresses issues with multiple $patch: delete
strategic merge patches in a single patch file.

Updated dependencies:
- sigs.k8s.io/kustomize/api v0.19.0 -> v0.20.0
- sigs.k8s.io/kustomize/kyaml v0.19.0 -> v0.20.0

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-06-30 09:57:37 +09:00
Matheus Pimenta 68dc67620a
Merge pull request #1000 from hoffimar/deprecations
Move 'Deprecated' comments to own paragraph
2025-06-29 15:40:30 +01:00
Martin Hoffmann 0887009d50
Move 'Deprecated' comments to own paragraph
As described at https://go.dev/wiki/Deprecated, the `Deprecated` comments shall start a new paragraph. This way, the deprecation is also visible to other tools like staticcheck and vscode.

Signed-off-by: Martin Hoffmann <hoffimar@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-06-29 15:26:43 +01:00
Matheus Pimenta bd9fad5238
Merge pull request #1236 from fluxcd/force-annotation
Use `reconcile.fluxcd.io/forceAt` annotation from fluxcd/pkg/apis/meta
2025-06-21 09:58:06 +01:00
Matheus Pimenta d89a6d12a3
Use reconcile.fluxcd.io/forceAt annotation from fluxcd/pkg/apis/meta
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-06-21 09:02:15 +01:00
Stefan Prodan 5cbc4a6fbd
Merge pull request #1223 from abhijith-darshan/feat/common_labels_annotations
feat: adds CommonMetadata to HelmRelease postrenderer
2025-06-17 12:01:05 +03:00
abhijith-darshan b62d7a8ad7
(chore): kustomize post-renderer with common-metadata
(chore): adds commonAnnotations and commonLabels to kustomize

if applied, this commit will pass the common labels and annotations specified in postRenderers kustomization and which gets propagated to all resources

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): generates updated api-docs

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds common metadata to spec

HelmRelease postRenderer uses `CommonMetadata` struct from kustomize controller to have a common CRD specification usage across flux API types

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): update helm release post renderer

HelmRelease kustomize post renderer uses the CommonMetadata type from kustomize controller to propagate common labels and annotations across all resources. Labels are not propagated to `selector.matchLabels`

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): generates updated CRD and api docs

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds common metadata types

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): removes common metadata

removes the insertion of common metadata info in `Kustomize.Run()`

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds common-metadata types

this commit adds CommonMetadata to HelmRelease spec as an optional field and when used will run a helm postRenderer to add specified labels and annotations resources contained in helm template. The digest of common metadata is stored as ObservedCommonMetadataDigest in the resource status

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): common post-renderer

this commit combines common metadata rendering and origin labels rendering into common_renderer.go with re-usable methods for label transformer and annotation transformer. Precedence is given to origin labels rendering over common metadata rendering.

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): trigger upgrade on commonMetadata value changes

this commit ensures that when commonMetadata value has changed after install triggers an upgrade action to re-render the new commonMetadata values to the helm release. The digest of commonMetadata values are stored in .status.ObservedCommonMetadataDigest for release state out-of-sync detection.

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(fix): adheres to import ordering

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(fix): revert go mod updates

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): updates copyright headers

Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Abhijith Ravindra <137736216+abhijith-darshan@users.noreply.github.com>

(chore): adds copyright headers

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): updates copyright headers

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): keep go mod in sync with upstream/main

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds common metadata documentation

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): fix precedence of label application

This commit will ensure that OriginLabels run last so that it has a higher precedence over CommonMetadata.Labels

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>
2025-06-12 12:45:33 +02:00
Matheus Pimenta dc9e30967f
Merge pull request #1231 from fluxcd/update-labels
Add 1.3.x release label
2025-05-28 15:13:09 +01:00
Matheus Pimenta 395b8ef9a5
Add 1.3.x release label
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-28 15:00:04 +01:00
Matheus Pimenta 9a745206cf
Merge pull request #1230 from fluxcd/release/v1.3.x
Release/v1.3.x
2025-05-28 14:55:20 +01:00
Matheus Pimenta e47f47f128
Merge pull request #1229 from fluxcd/release-v1.3.0
Release v1.3.0
2025-05-28 14:32:44 +01:00
Matheus Pimenta aa70ca3df9
Release v1.3.0
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-28 14:14:08 +01:00
Matheus Pimenta 483f166c6a
Add changelog entry for v1.3.0
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-28 14:05:26 +01:00
Stefan Prodan b6d8e39ccc
Merge pull request #1227 from fluxcd/oci-ga
Update controller to OCIRepository v1 (GA)
2025-05-28 15:34:57 +03:00
Stefan Prodan 034ea18c4b
Update controller to OCIRepository v1 (GA)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-05-28 14:37:02 +03:00
Matheus Pimenta ff69170036
Update dependencies
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-28 10:46:46 +01:00
Stefan Prodan b2e904652c
Merge pull request #1221 from fluxcd/dependabot/github_actions/ci-5eaca88b60
Bump the ci group across 1 directory with 3 updates
2025-05-27 12:33:23 +03:00
dependabot[bot] 4653af4067
Bump the ci group across 1 directory with 3 updates
Bumps the ci group with 3 updates in the / directory: [docker/build-push-action](https://github.com/docker/build-push-action), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/build-push-action` from 6.16.0 to 6.17.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](14487ce63c...1dc7386353)

Updates `anchore/sbom-action` from 0.19.0 to 0.20.0
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](9f73021414...e11c554f70)

Updates `github/codeql-action` from 3.28.17 to 3.28.18
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](60168efe1c...ff0a06e83c)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 6.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-version: 0.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-version: 3.28.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 03:06:56 +00:00
Matheus Pimenta 68883e40fb
Merge pull request #1220 from fluxcd/upgrade-deps
Upgrade fluxcd/pkg packages
2025-05-23 08:29:35 +01:00
Matheus Pimenta 95e69b5d4c
Upgrade fluxcd/pkg packages
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-17 20:11:16 +01:00
leigh capili 8710b4ae26
Merge pull request #1218 from fluxcd/upgrade-deps
Upgrade fluxcd/pkg packages
2025-05-16 20:39:16 -04:00
Matheus Pimenta da1d17bd7a
Upgrade fluxcd/pkg packages
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-16 15:51:32 +01:00
Stefan Prodan 2bee1224e0
Merge pull request #1206 from fluxcd/dependabot/github_actions/ci-4c7c75f92f
Bump the ci group across 1 directory with 14 updates
2025-05-12 09:38:03 +03:00
dependabot[bot] a6486334aa
Bump the ci group across 1 directory with 14 updates
Bumps the ci group with 14 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [korthout/backport-action](https://github.com/korthout/backport-action) | `3.1.0` | `3.2.0` |
| [actions/setup-go](https://github.com/actions/setup-go) | `5.3.0` | `5.4.0` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3.4.0` | `3.6.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.9.0` | `3.10.0` |
| [actions/cache](https://github.com/actions/cache) | `4.2.0` | `4.2.3` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.13.0` | `6.16.0` |
| [docker/login-action](https://github.com/docker/login-action) | `3.3.0` | `3.4.0` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `5.6.1` | `5.7.0` |
| [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.8.0` | `3.8.2` |
| [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.18.0` | `0.19.0` |
| [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | `6.2.1` | `6.3.0` |
| [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) | `2.0.0` | `2.1.0` |
| [fossa-contrib/fossa-action](https://github.com/fossa-contrib/fossa-action) | `3.0.0` | `3.0.1` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.28.9` | `3.28.16` |



Updates `korthout/backport-action` from 3.1.0 to 3.2.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](be567af183...436145e922)

Updates `actions/setup-go` from 5.3.0 to 5.4.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](f111f3307d...0aaccfd150)

Updates `docker/setup-qemu-action` from 3.4.0 to 3.6.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](4574d27a47...29109295f8)

Updates `docker/setup-buildx-action` from 3.9.0 to 3.10.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f7ce87c1d6...b5ca514318)

Updates `actions/cache` from 4.2.0 to 4.2.3
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](1bd1e32a3b...5a3ec84eff)

Updates `docker/build-push-action` from 6.13.0 to 6.16.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](ca877d9245...14487ce63c)

Updates `docker/login-action` from 3.3.0 to 3.4.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](9780b0c442...74a5d14239)

Updates `docker/metadata-action` from 5.6.1 to 5.7.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](369eb591f4...902fa8ec7d)

Updates `sigstore/cosign-installer` from 3.8.0 to 3.8.2
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](c56c2d3e59...3454372f43)

Updates `anchore/sbom-action` from 0.18.0 to 0.19.0
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](f325610c9f...9f73021414)

Updates `goreleaser/goreleaser-action` from 6.2.1 to 6.3.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](90a3faa9d0...9c156ee8a1)

Updates `slsa-framework/slsa-github-generator` from 2.0.0 to 2.1.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v2.0.0...v2.1.0)

Updates `fossa-contrib/fossa-action` from 3.0.0 to 3.0.1
- [Release notes](https://github.com/fossa-contrib/fossa-action/releases)
- [Changelog](https://github.com/fossa-contrib/fossa-action/blob/master/CHANGELOG.md)
- [Commits](cdc5065bcd...3d2ef181b1)

Updates `github/codeql-action` from 3.28.9 to 3.28.16
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9e8d0789d4...28deaeda66)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: actions/setup-go
  dependency-version: 5.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-qemu-action
  dependency-version: 3.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-version: 3.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: actions/cache
  dependency-version: 4.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-version: 6.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/login-action
  dependency-version: 3.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/metadata-action
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-version: 0.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: slsa-framework/slsa-github-generator
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: fossa-contrib/fossa-action
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-version: 3.28.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-12 03:26:40 +00:00
Stefan Prodan 724fae4a57
Merge pull request #1212 from fluxcd/DisableChartDigestTracking
Add `DisableChartDigestTracking` feature gate
2025-05-09 20:14:41 +03:00
Stefan Prodan da305300b3
Add DisableChartDigestTracking feature gate
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-05-08 01:03:17 +03:00
Stefan Prodan b91fd90c75
Merge pull request #1209 from fluxcd/k8s-1.33
Update to Kubernetes 1.33.0 and Go 1.24.0
2025-04-29 16:04:11 +03:00
Stefan Prodan 709b76a022
Update to Kubernetes 1.33.0 and Go 1.24.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-04-29 15:51:11 +03:00
Stefan Prodan 597dd184a9
Merge pull request #1204 from fluxcd/helm-v3.17.3
Update dependencies to Helm v3.17.3
2025-04-11 12:15:34 +03:00
Stefan Prodan 9134ee5788
Update dependencies to Helm v3.17.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-04-11 11:09:39 +03:00
Matheus Pimenta 8e02c59a8a
Merge pull request #1188 from drawdrop/main
fix: fix the wrong error return value
2025-03-04 11:33:50 +00:00
drawdrop 7cdf9dfbfe fix: fix the wrong error return value
Signed-off-by: drawdrop <cricis@icloud.com>
2025-03-03 22:13:43 +08:00
Matheus Pimenta 25c6bb691d
Merge pull request #1176 from fluxcd/update-labels
Add 1.2.x release label
2025-02-19 09:46:48 +00:00
Matheus Pimenta ebabf4ad3a
Add 1.2.x release label
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-19 09:11:51 +00:00
Matheus Pimenta 2e8c037d4e
Merge pull request #1175 from fluxcd/release/v1.2.x
Release/v1.2.x
2025-02-19 09:10:37 +00:00
Matheus Pimenta 8e4de326fa
Merge pull request #1174 from fluxcd/release-v1.2.0
Release v1.2.0
2025-02-19 08:45:35 +00:00
Matheus Pimenta 9463301e5e
Release v1.2.0
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-19 08:22:50 +00:00
Matheus Pimenta 94c60d50dc
Add changelog entry for v1.2.0
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-19 08:22:49 +00:00
Matheus Pimenta 34d0036cbd
Merge pull request #1170 from fluxcd/dependabot/go_modules/go-deps-d8ecef8942
Bump the go-deps group across 1 directory with 2 updates
2025-02-18 17:24:24 +00:00
dependabot[bot] e22eb2732d
Bump the go-deps group across 1 directory with 2 updates
Bumps the go-deps group with 2 updates in the / directory: [github.com/fluxcd/pkg/ssa](https://github.com/fluxcd/pkg) and [golang.org/x/text](https://github.com/golang/text).


Updates `github.com/fluxcd/pkg/ssa` from 0.44.0 to 0.45.1
- [Commits](https://github.com/fluxcd/pkg/compare/oci/v0.44.0...ssa/v0.45.1)

Updates `golang.org/x/text` from 0.21.0 to 0.22.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: github.com/fluxcd/pkg/ssa
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-18 16:57:21 +00:00
Matheus Pimenta 93eef0d99c
Merge pull request #1173 from fluxcd/upgrade-helm
Upgrade helm to v3.17.1
2025-02-18 16:47:20 +00:00
Matheus Pimenta 25f3db5d67
Upgrade helm to v3.17.1
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-18 14:06:29 +00:00
Stefan Prodan 3385e3f458
Merge pull request #1167 from fluxcd/dependabot/github_actions/ci-4ac27b1555
Bump the ci group across 1 directory with 2 updates
2025-02-18 15:23:49 +02:00
dependabot[bot] f80b06b1a7
Bump the ci group across 1 directory with 2 updates
Bumps the ci group with 2 updates in the / directory: [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `goreleaser/goreleaser-action` from 6.1.0 to 6.2.1
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](9ed2f89a66...90a3faa9d0)

Updates `github/codeql-action` from 3.28.8 to 3.28.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](dd746615b3...9e8d0789d4)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 03:33:14 +00:00
Matheus Pimenta da8af058ce
Merge pull request #1171 from fluxcd/upgrade-deps
Update source-controller API to v1.5.0
2025-02-13 16:34:56 +00:00
Matheus Pimenta 763e03c19c
Update source-controller API to v1.5.0
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-13 16:24:18 +00:00
Stefan Prodan 15d0dc8252
Merge pull request #1169 from sslavic/stevo-rollback-remed-max-hist
fix: use HelmRelease max history for rollback remediation
2025-02-11 16:52:33 +02:00
Stevo Slavic dda1d355b7 fix: use HelmRelease max history for rollback remediation
Signed-off-by: Stevo Slavic <sslavic@gmail.com>
2025-02-11 15:17:29 +01:00
Matheus Pimenta 8dfcca2cb0
Merge pull request #1168 from fluxcd/upgrade-deps
Upgrade pkg/runtime
2025-02-11 12:07:45 +00:00
Matheus Pimenta 679975691b
Upgrade pkg/runtime
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-02-11 11:52:03 +00:00
Stefan Prodan c2233b903b
Merge pull request #1165 from fluxcd/dependabot/github_actions/ci-05f176d660
Bump the ci group across 1 directory with 3 updates
2025-02-09 11:43:27 +02:00
dependabot[bot] 6252c3f045
Bump the ci group across 1 directory with 3 updates
Bumps the ci group with 3 updates in the / directory: [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) and [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer).


Updates `docker/setup-qemu-action` from 3.3.0 to 3.4.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](53851d1459...4574d27a47)

Updates `docker/setup-buildx-action` from 3.8.0 to 3.9.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](6524bf65af...f7ce87c1d6)

Updates `sigstore/cosign-installer` from 3.7.0 to 3.8.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](dc72c7d5c4...c56c2d3e59)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-07 04:06:00 +00:00
Stefan Prodan d854623221
Merge pull request #1158 from fluxcd/dependabot/github_actions/ci-fbaebe1433
Bump the ci group across 1 directory with 12 updates
2025-01-31 15:53:08 +02:00
dependabot[bot] f52212e47d
Bump the ci group across 1 directory with 12 updates
Bumps the ci group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.2.0` | `4.2.2` |
| [actions/setup-go](https://github.com/actions/setup-go) | `5.0.2` | `5.3.0` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3.2.0` | `3.3.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.6.1` | `3.8.0` |
| [actions/cache](https://github.com/actions/cache) | `4.0.2` | `4.2.0` |
| [helm/kind-action](https://github.com/helm/kind-action) | `1.10.0` | `1.12.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.7.0` | `6.13.0` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `5.5.1` | `5.6.1` |
| [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.6.0` | `3.7.0` |
| [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.17.2` | `0.18.0` |
| [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | `6.0.0` | `6.1.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.26.9` | `3.28.8` |



Updates `actions/checkout` from 4.2.0 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](d632683dd7...11bd71901b)

Updates `actions/setup-go` from 5.0.2 to 5.3.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0a12ed9d6a...f111f3307d)

Updates `docker/setup-qemu-action` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](49b3bc8e6b...53851d1459)

Updates `docker/setup-buildx-action` from 3.6.1 to 3.8.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](988b5a0280...6524bf65af)

Updates `actions/cache` from 4.0.2 to 4.2.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0c45773b62...1bd1e32a3b)

Updates `helm/kind-action` from 1.10.0 to 1.12.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](0025e74a8c...a1b0e39133)

Updates `docker/build-push-action` from 6.7.0 to 6.13.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](5cd11c3a4c...ca877d9245)

Updates `docker/metadata-action` from 5.5.1 to 5.6.1
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](8e5442c4ef...369eb591f4)

Updates `sigstore/cosign-installer` from 3.6.0 to 3.7.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](4959ce089c...dc72c7d5c4)

Updates `anchore/sbom-action` from 0.17.2 to 0.18.0
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](61119d458a...f325610c9f)

Updates `goreleaser/goreleaser-action` from 6.0.0 to 6.1.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](286f3b13b1...9ed2f89a66)

Updates `github/codeql-action` from 3.26.9 to 3.28.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](461ef6c76d...dd746615b3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 13:40:23 +00:00
Stefan Prodan 22c809de3b
Merge pull request #1160 from fluxcd/helm-v3.17.0
Update dependencies to Helm v3.17.0 and Kustomize v5.6.0
2025-01-31 15:37:24 +02:00
Stefan Prodan 751d48a2e0
Update dependencies to Helm v3.17.0 and Kustomize v5.6.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-01-31 15:22:00 +02:00
Matheus Pimenta 8e6106b40d
Merge pull request #1142 from fluxcd/upgrade-runtime
Upgrade runtime
2025-01-10 13:59:11 +00:00
Matheus Pimenta 483cf06f4e
Upgrade runtime
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-01-10 13:43:57 +00:00
Matheus Pimenta 58d5812b33
Merge pull request #1123 from fluxcd/remove-subchart-crd
Fix install and upgrade applying subchart CRDs when condition is false
2025-01-10 12:22:30 +00:00
Matheus Pimenta dd3b66a3c5
Fix install and upgrade applying subchart CRDs when condition is false
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-01-10 12:09:40 +00:00
Stefan Prodan 9b78c2e670
Merge pull request #1140 from kumar-mallikarjuna/fix-1139
Add `disableTakeOwnership` to Helm install/upgrade actions
2025-01-10 13:45:35 +02:00
Kumar Mallikarjuna 53578dd43f Update API docs and descriptions
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
2025-01-10 16:21:57 +05:30
Kumar Mallikarjuna 2ffd183ac1 Update `disableTakeOwnership` docs
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
2025-01-10 16:12:19 +05:30
Kumar Mallikarjuna 1607808aea Fix `disableTakeOwnership` docs
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
2025-01-10 16:09:35 +05:30
Kumar Mallikarjuna 0da7fbddc9 Add tests for `disableTakeOwnership`
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
2025-01-09 15:26:48 +05:30
Kumar Mallikarjuna aad273dfb7 Change install->upgrade in docs
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
2025-01-09 15:11:14 +05:30
Kumar Mallikarjuna 98622cd087 Add `disableTakeOwnership` to Helm install/upgrade actions
This change adds a new field called `disableTakeOwnership` to `.spec.install` and `.spec.upgrade`. The flag allows users to disable ignoring helm annotations and labels before taking ownership of existing resources during install and upgrade.

Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna.work@gmail.com>
2025-01-08 23:26:05 +05:30
Stefan Prodan e8986629e1
Merge pull request #1129 from fluxcd/k8s-1.32
Update dependencies to Kubernetes 1.32.0 and Go 1.23.0
2024-12-12 19:28:33 +02:00
Stefan Prodan e1f1022e2e
Update dependencies to Kubernetes 1.32.0 and Go 1.23.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-12-12 19:13:31 +02:00
Stefan Prodan 8991959261
Merge pull request #1126 from fluxcd/alias-ValuesReference
Make `ValuesReference` an alias for backwards compat
2024-12-12 16:39:03 +02:00
Stefan Prodan af516b84b0
Make `ValuesReference` an alias for backwards compat
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-12-12 16:27:54 +02:00
Stefan Prodan 66f024c654
Merge pull request #1127 from fluxcd/debug-helm-values
docs: Rendering the final Values locally
2024-12-11 15:57:53 +02:00
Stefan Prodan ebf412639e
docs: Rendering the final Values locally
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-12-11 14:13:34 +02:00
Stefan Prodan ee7554998e
Merge pull request #1122 from fluxcd/chartutil-v1.0.0
Refactor values composition to use `pkg/chartutil`
2024-12-10 12:22:50 +02:00
Stefan Prodan 9c58e02b62
Refactor values composition to use `pkg/chartutil`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-12-10 12:04:54 +02:00
Stefan Prodan f48671c020
Merge pull request #1121 from fluxcd/kustomize-v5.5
Update Kustomize packages to v5.5.0
2024-12-06 18:12:56 +02:00
Stefan Prodan 1c9a8b14f2
Update Kustomize packages to v5.5.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-12-06 17:34:58 +02:00
Hidde Beydals d8eee36ffe
Merge pull request #1103 from fluxcd/dependabot/go_modules/go-deps-d4cf87f8bc 2024-11-16 20:30:45 +01:00
dependabot[bot] 5fe9108465
Bump the go-deps group across 1 directory with 2 updates
Bumps the go-deps group with 1 update in the / directory: [github.com/onsi/gomega](https://github.com/onsi/gomega).


Updates `github.com/onsi/gomega` from 1.34.2 to 1.35.1
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.34.2...v1.35.1)

Updates `golang.org/x/text` from 0.18.0 to 0.19.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-16 18:48:57 +00:00
Hidde Beydals 57737ba42a
Merge pull request #1084 from luisdavim/client_reties 2024-11-16 19:47:50 +01:00
Luis Davim 26bdaec567 fix: handle "leader changed" errors
Fixes fluxcd/flux2/#4804 by copying the solution used in helm/helm#11426

Signed-off-by: Luis Davim <luis.davim@gmail.com>
2024-11-16 13:03:48 +00:00
Stefan Prodan 5beaf80cfc
Merge pull request #1102 from baburciu/accept-underscore-ocirepo-tag-hr
Replace `_` with `+` when verifying the chart version matches the OCI artifact tag
2024-11-01 18:34:42 +02:00
Bogdan-Adrian Burciu caf49d2459 replace _ with + for OCI artifacts tags when pulled for helm
Signed-off-by: Bogdan-Adrian Burciu <bogdanadrian.burciu@yahoo.com>
2024-11-01 12:40:01 +00:00
Sunny c8ae4b6ad2
Merge pull request #1076 from fluxcd/label-sync
Label sync for release/v1.1.x
2024-09-27 19:47:51 +05:30
Sunny 9d14244a87 Label sync for release/v1.1.x
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-27 17:49:19 +05:30
Stefan Prodan e632ffdf4d
Merge pull request #1075 from fluxcd/release/v1.1.x
Merge `release/v1.1.x` back to `main`
2024-09-26 23:59:14 +03:00
Sunny 44247e2310
Merge pull request #1074 from fluxcd/release-v1.1.0
Release v1.1.0
2024-09-27 01:22:22 +05:30
Sunny d1a931ae8c Release v1.1.0
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-27 00:32:56 +05:30
Sunny 037bc864be Add changelog entry for v1.1.0
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-27 00:32:49 +05:30
Stefan Prodan b0010b0cd5
Merge pull request #1070 from fluxcd/deps-api-reader
Allow cross-shard dependency check
2024-09-26 21:33:41 +03:00
Stefan Prodan 72ec296d18
Allow cross-shard dependency check
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-26 21:15:31 +03:00
Stefan Prodan c71258e597
Merge pull request #1073 from fluxcd/update-sc
Update source-controller to v1.4.1
2024-09-26 21:04:11 +03:00
Sunny e3ab7cecbe Update source-controller to v1.4.1
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-26 17:19:14 +00:00
Stefan Prodan 2e3efaf633
Merge pull request #1072 from fluxcd/dependabot/github_actions/ci-74c3fc3a14
Bump the ci group across 1 directory with 2 updates
2024-09-26 11:04:30 +03:00
dependabot[bot] 2932347391
Bump the ci group across 1 directory with 2 updates
Bumps the ci group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](692973e3d9...d632683dd7)

Updates `github/codeql-action` from 3.26.4 to 3.26.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f0f3afee80...461ef6c76d)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-26 07:52:33 +00:00
Stefan Prodan 18d2406754
Merge pull request #1071 from fluxcd/deps-update
Update flux deps and k8s deps to 1.31.1
2024-09-26 10:20:14 +03:00
Sunny 5d1381215e Update SC in config/default
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-25 21:45:54 +00:00
Sunny 701ea28bc9 Update flux deps and k8s deps to 1.31.1
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-25 21:18:33 +00:00
Stefan Prodan 754c2ba1cb
Merge pull request #1068 from fluxcd/disable-schema-validation
Add `disableSchemaValidation` to Helm install/upgrade actions
2024-09-24 09:32:30 +03:00
Stefan Prodan 54f0b42b34
Add `disableSchemaValidation` to Helm install/upgrade actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-20 22:28:51 +03:00
Stefan Prodan a7c83f6260
Merge pull request #1024 from cwrau/fix/dont-ignore-helm-errors
fix: remove digest check to never ignore helm errors
2024-09-20 21:17:38 +02:00
Sunny 7fee60ed7f Add docs for handling failed uninstall
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-18 23:16:29 +00:00
Sunny ad0d38c19a Add tests for uninstall error
Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-18 22:20:51 +00:00
Chris Werner Rau f65b95b75d fix: remove digest check to never ignore helm errors
Closes #1021

Signed-off-by: Chris Werner Rau <cwrau@cwrau.info>
2024-09-19 03:33:41 +05:30
Stefan Prodan 037e21595a
Merge pull request #1064 from fluxcd/controller-gen-v0.16.1
Update controller-gen to v0.16.1
2024-09-13 16:22:58 +03:00
Stefan Prodan b36b123dcb
Add required kind field to tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-13 13:14:52 +03:00
Stefan Prodan 46f88f471d
Update controller-gen to v0.16.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-13 13:04:40 +03:00
Stefan Prodan 797461a3dc
Merge pull request #1062 from fluxcd/helm-v3.16.0
Update Helm to v3.16.1 and enable the adoption of existing resources
2024-09-13 13:02:57 +03:00
Stefan Prodan 9f5457d7ea
Update Helm to v3.16.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-13 12:51:19 +03:00
Stefan Prodan 3c0ef0e030
Enable `TakeOwnership` at install/upgrade
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-13 12:51:15 +03:00
Stefan Prodan bbd364f7a0
Update Helm to v3.16.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-13 12:51:14 +03:00
Stefan Prodan 94748cab5a
Merge pull request #1060 from Preisschild/feat/targetpath-allow-overwrite
Allow overwriting inline values with targetPath
2024-09-13 10:35:41 +03:00
Florian Ströger c07f10866b Allow overwriting inline values with targetPath
When using Helm with both a values file and --set, the set will always
have precedence over the values.yaml. This allows specifying the normal
config inside a yaml file and specifying a secret outside that yaml via
--set.

When using flux, this normally works too (using inline values to specify
most of the config and a reference with targetPath to get a secret), but
if you want to overwrite a secret key inside an array the inline values
will always overwrite the whole array and the referenced secret key will
not appear at all.

By making sure that when you specify a targetPath it has precedence over
inline values it will be merged properly.

Signed-off-by: Ströger Florian <florian@florianstroeger.com>
2024-09-08 16:12:51 +02:00
Stefan Prodan e05c4ffc4b
Merge pull request #1052 from fluxcd/dependabot/github_actions/ci-4516fd8e81
Bump the ci group across 1 directory with 3 updates
2024-08-22 10:07:33 +03:00
dependabot[bot] c3a8dbcbe9
Bump the ci group across 1 directory with 3 updates
Bumps the ci group with 3 updates in the / directory: [korthout/backport-action](https://github.com/korthout/backport-action), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `korthout/backport-action` from 3.0.2 to 3.1.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](bd410d37cd...be567af183)

Updates `anchore/sbom-action` from 0.17.1 to 0.17.2
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](ab9d16d4b4...61119d458a)

Updates `github/codeql-action` from 3.26.2 to 3.26.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](429e197704...f0f3afee80)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 03:55:04 +00:00
Stefan Prodan 7177d4a402
Merge pull request #1049 from fluxcd/go-1.23
Build with Go 1.23
2024-08-15 12:31:41 +03:00
Stefan Prodan 73dd4d8172
Build with Go 1.23
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-08-15 12:10:30 +03:00
Stefan Prodan cd5214cff5
Merge pull request #1048 from fluxcd/k8s-1.31
Update dependencies to Kubernetes v1.31.0
2024-08-15 11:29:46 +03:00
Stefan Prodan e53d5c036b
Update dependencies to Kubernetes v1.31.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-08-15 11:15:19 +03:00
Stefan Prodan f681236b84
Merge pull request #1046 from fluxcd/dependabot/github_actions/ci-99774d93c7
Bump the ci group across 1 directory with 9 updates
2024-08-15 09:56:40 +03:00
dependabot[bot] b038750217
Bump the ci group across 1 directory with 9 updates
Bumps the ci group with 9 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.6` | `4.1.7` |
| [actions/setup-go](https://github.com/actions/setup-go) | `5.0.1` | `5.0.2` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3.0.0` | `3.2.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.3.0` | `3.6.1` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `5.4.0` | `6.7.0` |
| [docker/login-action](https://github.com/docker/login-action) | `3.2.0` | `3.3.0` |
| [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.5.0` | `3.6.0` |
| [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.16.0` | `0.17.1` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.25.8` | `3.26.2` |



Updates `actions/checkout` from 4.1.6 to 4.1.7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

Updates `actions/setup-go` from 5.0.1 to 5.0.2
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](cdcb360436...0a12ed9d6a)

Updates `docker/setup-qemu-action` from 3.0.0 to 3.2.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](68827325e0...49b3bc8e6b)

Updates `docker/setup-buildx-action` from 3.3.0 to 3.6.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](d70bba72b1...988b5a0280)

Updates `docker/build-push-action` from 5.4.0 to 6.7.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](ca052bb54a...5cd11c3a4c)

Updates `docker/login-action` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](0d4c9c5ea7...9780b0c442)

Updates `sigstore/cosign-installer` from 3.5.0 to 3.6.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](59acb6260d...4959ce089c)

Updates `anchore/sbom-action` from 0.16.0 to 0.17.1
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](e8d2a6937e...ab9d16d4b4)

Updates `github/codeql-action` from 3.25.8 to 3.26.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2e230e8fe0...429e197704)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-15 03:18:03 +00:00
Stefan Prodan 70dadf74f0
Merge pull request #1025 from octo/fix-conditions-usage
Fix incorrect use of format strings with the `conditions` package.
2024-07-12 11:15:13 +03:00
Florian Forster c94eb8ec21
Fix incorrect use of format strings with the `conditions` package.
The `Mark…` functions in the `conditions` package accept a format string and
(optional) arguments, just like `fmt.Printf` and friends.

In many places, the code passed an error message as the format string, causing
it to be interpreted as a format string by the `fmt` package. This leads to
issues when the message contains percent signs, e.g. URL-encoded values.

This PR adds a format string and shortens `err.Error()` to `err`, which yields
the same output.

This change is identical in principle to
fluxcd/source-controller#1529.

Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-07-12 09:46:13 +02:00
souleb 655432b46d
Merge pull request #1010 from fluxcd/fix-1008
Re-enable logging json patch on StatusDrifted
2024-06-19 10:11:55 +02:00
Soule BA a3c4b4da62
Re-enable logging json patch on StatusDrifted
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-06-19 00:28:05 +02:00
Stefan Prodan ad7e418948
Merge pull request #1004 from fluxcd/dependabot/github_actions/ci-6e6887dbc2
Bump the ci group across 1 directory with 5 updates
2024-06-11 09:50:36 +03:00
Stefan Prodan ffeb21acbe
Adapt config to GoRelease v2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-06-11 09:41:08 +03:00
dependabot[bot] c8c450a02f
Bump the ci group across 1 directory with 5 updates
Bumps the ci group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [korthout/backport-action](https://github.com/korthout/backport-action) | `2.5.0` | `3.0.2` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `5.3.0` | `5.4.0` |
| [docker/login-action](https://github.com/docker/login-action) | `3.1.0` | `3.2.0` |
| [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | `5.1.0` | `6.0.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.25.6` | `3.25.8` |



Updates `korthout/backport-action` from 2.5.0 to 3.0.2
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](ef20d86abc...bd410d37cd)

Updates `docker/build-push-action` from 5.3.0 to 5.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](2cdde995de...ca052bb54a)

Updates `docker/login-action` from 3.1.0 to 3.2.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](e92390c5fb...0d4c9c5ea7)

Updates `goreleaser/goreleaser-action` from 5.1.0 to 6.0.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](5742e2a039...286f3b13b1)

Updates `github/codeql-action` from 3.25.6 to 3.25.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9fdb3e4972...2e230e8fe0)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 03:58:19 +00:00
Max Jonas Werner ce58e47242
Merge pull request #990 from fluxcd/rev-vers 2024-05-27 07:58:26 +01:00
Max Jonas Werner 98ecb33ef4 Ignore 'v' version prefix in OCI artifact and Helm chart
Tools such as Bitnami's charts-syncer strip the `v` prefix from the
chart version so that the OCI artifact version differs from the
version defined in the chart's metadata. This leads to an error
similar to this returned from h-c:

```
artifact revision 1.14.5 does not match chart version v1.14.5
```

This commit makes h-c ignore a leading `v` prefix in either the chart
version of the OCI artifact tag.

Signed-off-by: Max Jonas Werner <max.werner@associmates.eu>
2024-05-26 19:47:50 +01:00
Stefan Prodan bd7e561811
Merge pull request #986 from sestegra/crd-default-values
doc: fix HelmRelease default value for `.spec.upgrade.crds`
2024-05-25 15:21:48 +03:00
Stéphane Este-Gracias b98fde5de4
Merge branch 'main' into crd-default-values 2024-05-25 13:24:00 +02:00
souleb f731a805b1
Merge pull request #994 from fluxcd/dependabot/github_actions/ci-c7f71143c6
build(deps): bump the ci group with 2 updates
2024-05-21 09:46:14 +02:00
dependabot[bot] 35976156df
---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 04:00:03 +00:00
souleb 7a6a2d430a
Merge pull request #991 from fluxcd/dependabot/github_actions/ci-a3f50e56c6
build(deps): bump the ci group across 1 directory with 2 updates
2024-05-17 12:07:51 +02:00
dependabot[bot] 6e47eac4fe
build(deps): bump the ci group across 1 directory with 2 updates
Bumps the ci group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.5 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](44c2b7a8a4...a5ac7e51b4)

Updates `github/codeql-action` from 3.25.4 to 3.25.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ccf74c9479...b7cec75265)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 03:36:42 +00:00
souleb 5efa0aa970
Merge pull request #987 from fluxcd/dependabot/github_actions/ci-65bd204c79
build(deps): bump the ci group across 1 directory with 2 updates
2024-05-13 10:05:18 +02:00
dependabot[bot] 3f91647ef9
build(deps): bump the ci group across 1 directory with 2 updates
Bumps the ci group with 2 updates in the / directory: [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `goreleaser/goreleaser-action` from 5.0.0 to 5.1.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](7ec5c2b0c6...5742e2a039)

Updates `github/codeql-action` from 3.25.3 to 3.25.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d39d31e687...ccf74c9479)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 03:26:18 +00:00
Stéphane Este-Gracias f8c9766f89
doc: fix helmrelease default value for .spec.upgrade.crds
Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
2024-05-10 19:21:50 +02:00
Stefan Prodan e7dc85eddc
Merge pull request #985 from fluxcd/pick-changelog-v1.0.1
Add changelog entry for v1.0.1
2024-05-10 18:26:32 +03:00
Soule BA e475c1ffe3
Add changelog entry for v1.0.1
Signed-off-by: Soule BA <bah.soule@gmail.com>
(cherry picked from commit 964e7500ad)
2024-05-10 18:13:10 +03:00
Stefan Prodan 1526d3a615
Merge pull request #982 from fluxcd/fix-upgrade
Fix: Allow upgrading from v2beta1 to v2 (GA)
2024-05-10 16:52:23 +03:00
Stefan Prodan d909c31b5e
Fix: Allow upgrading from v2beta1 to v2 (GA)
Add `.spec.chartRef` placeholder to v2beta1 to allow upgrading to v2 GA.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-10 16:27:15 +03:00
souleb bc1219fbc1
Merge pull request #980 from fluxcd/chartTemplate-as-pointer
Fix: Make `HelmChartTemplate` a pointer in `.spec.chart`
2024-05-10 12:58:01 +02:00
Soule BA 16b61c6f8a
Make chartTemplate a pointer in .spec.chart
If implemented, this will omit empty `.spec.chart` in rendered yamls.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-05-10 12:45:33 +02:00
Stefan Prodan 2c26ac1d62
Merge pull request #978 from fluxcd/release/v1.0.x
Housekeeping: merge `release/v1.0.x` back into `main`
2024-05-09 17:20:34 +03:00
Stefan Prodan 519df15ce6
Merge branch 'main' into release/v1.0.x 2024-05-09 15:50:51 +03:00
Stefan Prodan cee99531fb
Merge pull request #971 from fluxcd/release-v1.0.0
Release v1.0.0
2024-05-09 15:47:52 +03:00
Stefan Prodan 93702c7a57
Release v1.0.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-09 15:32:35 +03:00
Stefan Prodan 7ccb1cbfb3
Add changelog entry for v1.0.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-09 15:32:35 +03:00
Stefan Prodan 999b855107
Merge pull request #977 from fluxcd/backport-972-to-release/v1.0.x
[release/v1.0.x] PostRenderersDigest observation improvements
2024-05-09 15:31:52 +03:00
Sunny e0629b7967 PostRenderersDigest observation improvements
Move the post renderers digest set/update code from summarize() to
atomic release reconciler in order to update the observation only at the
end of a successful reconciliation. summarize() is for summarizing the
status conditions and is also called by all the other action
sub-reconcilers, which can update the post renderers digest observation
too early.
Updating the observed post renderers digest at the very end of a
reconciliation introduces an issue where a digest mismatch in
DetermineReleaseState() could result in the release to get stuck in a
loop as even after running an upgrade due to post renderers value, the
new observation isn't reflected immediately in the middle of atomic
reconciliation. This can be solved by checking post renderers digest
value only for new configurations where the object generation and the
ready status condition observed generations don't match, in other words
when the generation of a configuration has not be processed. This
assumes that an upgrade due to any other reason also takes into account
the post renderers value and need not be checked separately for the same
config generation.

Signed-off-by: Sunny <github@darkowlzz.space>
(cherry picked from commit 63f7a76319)
2024-05-09 12:21:35 +00:00
Stefan Prodan f88b3be818
Merge pull request #972 from fluxcd/improve-postrenderer-tracking
PostRenderersDigest observation improvements
2024-05-09 15:21:19 +03:00
Sunny 63f7a76319
PostRenderersDigest observation improvements
Move the post renderers digest set/update code from summarize() to
atomic release reconciler in order to update the observation only at the
end of a successful reconciliation. summarize() is for summarizing the
status conditions and is also called by all the other action
sub-reconcilers, which can update the post renderers digest observation
too early.
Updating the observed post renderers digest at the very end of a
reconciliation introduces an issue where a digest mismatch in
DetermineReleaseState() could result in the release to get stuck in a
loop as even after running an upgrade due to post renderers value, the
new observation isn't reflected immediately in the middle of atomic
reconciliation. This can be solved by checking post renderers digest
value only for new configurations where the object generation and the
ready status condition observed generations don't match, in other words
when the generation of a configuration has not be processed. This
assumes that an upgrade due to any other reason also takes into account
the post renderers value and need not be checked separately for the same
config generation.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-05-09 10:58:41 +00:00
Stefan Prodan 44724ff2cd
Merge pull request #976 from fluxcd/backport-975-to-release/v1.0.x
[release/v1.0.x] Prevent snapshot drift when upgrading to API v2
2024-05-09 11:38:12 +03:00
Stefan Prodan 1f63b8a40a Prevent snapshot drift when upgrading to API v2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit 56b5f14b34)
2024-05-09 08:23:30 +00:00
Stefan Prodan 461d45db75
Merge pull request #975 from fluxcd/fix-snaphot-drift
Prevent snapshot drift when upgrading to API v2
2024-05-09 11:23:16 +03:00
Stefan Prodan 56b5f14b34
Prevent snapshot drift when upgrading to API v2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-09 10:18:38 +03:00
Stefan Prodan 538d48e8ab
Merge pull request #973 from matheuscscp/new-release-label
Add 1.0.x release label
2024-05-08 17:29:06 +03:00
Matheus Pimenta b9386cea68 Add 1.0.x release label
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-05-08 15:15:30 +01:00
Stefan Prodan 57a3c1fcfd
Merge pull request #967 from fluxcd/dependabot/github_actions/ci-2057180a66
build(deps): bump the ci group across 1 directory with 2 updates
2024-05-08 09:43:57 +03:00
dependabot[bot] 457c80578f
build(deps): bump the ci group across 1 directory with 2 updates
Bumps the ci group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-go](https://github.com/actions/setup-go).


Updates `actions/checkout` from 4.1.4 to 4.1.5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](0ad4b8fada...44c2b7a8a4)

Updates `actions/setup-go` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0c52d547c9...cdcb360436)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-08 03:34:21 +00:00
souleb acf98e9ea4
Merge pull request #966 from fluxcd/dependabot/go_modules/go-deps-134d2f154a
build(deps): bump golang.org/x/text from 0.14.0 to 0.15.0 in the go-deps group
2024-05-07 23:53:20 +02:00
dependabot[bot] ba10289963
build(deps): bump golang.org/x/text in the go-deps group
Bumps the go-deps group with 1 update: [golang.org/x/text](https://github.com/golang/text).


Updates `golang.org/x/text` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-07 23:41:54 +02:00
souleb 9da5599163
Merge pull request #965 from fluxcd/fix-964
Track changes in `.spec.postRenderers`
2024-05-07 23:23:34 +02:00
Soule BA 4b6febf48c
Add test cases for Summarize() and DetermineReleaseState()
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-05-07 23:13:47 +02:00
Soule BA 4069ad47e9
A better implementation for observing Postrenderers
This implementation update `.status.ObervedPostRenderersDigest` after a
successful reconciliation if `spec.postRenderers` is not nil.

Changes to `spec.postRenderers` are detected for `deployed` releases.
`Failed` and `Uninstalled` releases are detected earlier in the
reconciliation process.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-05-07 14:17:17 +02:00
Soule BA e58a102de9
document lastAttemptedPostRenderersDigest behavior
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-05-07 11:59:23 +02:00
Soule BA aa70ac2b31
fix: detect changes in spec.postRenderers
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-05-07 11:57:52 +02:00
Stefan Prodan 921def627c
Merge pull request #968 from fluxcd/app-version-meta-event
Add the chart app version to status and events metadata
2024-05-07 12:39:10 +03:00
Stefan Prodan 863d3115f3
Add app version to CRD manifests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-07 12:18:20 +03:00
Stefan Prodan 17633702fa
Add event example to API docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-07 08:23:22 +03:00
Stefan Prodan 7f78cdc368
Add the chart app version to events metadata
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-07 00:14:55 +03:00
Stefan Prodan f8aa5b42a8
Merge pull request #963 from fluxcd/helm-ga
Promote `HelmRelease` API to v2 (GA)
2024-05-06 12:00:58 +03:00
Stefan Prodan 92ec780c98
Update API version in comments and docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-06 11:46:16 +03:00
Stefan Prodan f04e393645
docs: Add `layerSelector` to OCIRepository example
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-04 19:38:14 +03:00
Stefan Prodan 42fe4a39c1
Remove deprecated `patchesStrategicMerge` and `patchesJson6902` from v2 API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-04 12:41:24 +03:00
Stefan Prodan dfee7b086d
Set group version for GA API to v2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-04 12:24:33 +03:00
Stefan Prodan 64d1236c17
Remove deprecated `.status.lastAppliedRevision` from v2 API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-04 12:24:33 +03:00
Stefan Prodan 2cbd2bd944
Remove deprecated `.spec.valuesFile` from v2 API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-04 12:24:32 +03:00
Stefan Prodan 23f2ebe86d
Update copyright year (GA API)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-03 17:35:01 +03:00
Stefan Prodan f76d6fe026
Update samples to GA APIs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-03 17:12:22 +03:00
Stefan Prodan c9c0beb261
Add API docs for `HelmRelease` v2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-03 16:30:58 +03:00
Stefan Prodan 00785fbfa3
Promote `HelmRelease` API to v2 (GA)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-03 16:25:14 +03:00
Stefan Prodan 739d0a9cf9
Merge pull request #942 from isometry/feature/ignore-missing-values-files
Add `.spec.ignoreMissingValuesFiles` to HelmChartTemplate API
2024-05-03 16:13:33 +03:00
Robin Breathe bca7983d77
feat(HelmChartTemplateSpec): optionally ignore missing valuesFiles
Signed-off-by: Robin Breathe <robin@isometry.net>
2024-05-03 14:01:20 +02:00
Stefan Prodan 5eacdb24a0
Merge pull request #962 from fluxcd/helmchart-v1
Update `HelmChart` API to v1 (GA)
2024-05-03 14:37:22 +03:00
Stefan Prodan d0900635cf
Update `HelmChart` API to v1 (GA)
Bump source-controller to v1.3.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-03 13:43:51 +03:00
Stefan Prodan b31701ebf4
Merge pull request #885 from fluxcd/drift-correction-ready-condition
Update Ready condition during drift correction
2024-04-29 14:42:25 +03:00
Stefan Prodan 7289c17e86
Merge pull request #958 from fluxcd/dependabot/github_actions/ci-3daa6e97ec
build(deps): bump the ci group across 1 directory with 3 updates
2024-04-29 09:13:25 +03:00
dependabot[bot] fd91ff6a71
build(deps): bump the ci group across 1 directory with 3 updates
Bumps the ci group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.3 to 4.1.4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1d96c772d1...0ad4b8fada)

Updates `anchore/sbom-action` from 0.15.10 to 0.15.11
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](ab5d7b5f48...7ccf588e3c)

Updates `github/codeql-action` from 3.25.2 to 3.25.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](8f596b4ae3...d39d31e687)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 03:33:06 +00:00
Stefan Prodan 23262e0f5e
Merge pull request #944 from fluxcd/kubernetes-1.30
Update dependencies to Kubernetes 1.30
2024-04-26 12:53:32 +03:00
Stefan Prodan ab237a97aa
Update dependencies to Kubernetes 1.30
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-26 12:24:28 +03:00
Stefan Prodan 839433f67b
Merge pull request #954 from fluxcd/dependabot/github_actions/ci-aa3e267b82
build(deps): bump the ci group across 1 directory with 6 updates
2024-04-23 11:53:18 +03:00
dependabot[bot] 14448aae4c
build(deps): bump the ci group across 1 directory with 6 updates
Bumps the ci group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.2` | `4.1.3` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.2.0` | `3.3.0` |
| [helm/kind-action](https://github.com/helm/kind-action) | `1.9.0` | `1.10.0` |
| [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.4.0` | `3.5.0` |
| [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) | `1.10.0` | `2.0.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.24.9` | `3.25.2` |



Updates `actions/checkout` from 4.1.2 to 4.1.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](9bb56186c3...1d96c772d1)

Updates `docker/setup-buildx-action` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](2b51285047...d70bba72b1)

Updates `helm/kind-action` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](99576bfa6d...0025e74a8c)

Updates `sigstore/cosign-installer` from 3.4.0 to 3.5.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](e1523de757...59acb6260d)

Updates `slsa-framework/slsa-github-generator` from 1.10.0 to 2.0.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.10.0...v2.0.0)

Updates `github/codeql-action` from 3.24.9 to 3.25.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b1aada464...8f596b4ae3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-23 08:43:31 +00:00
souleb 9f82dde128
Merge pull request #945 from fluxcd/enable-hc-sources
Add support for `HelmChart` as chartRef
2024-04-23 10:41:11 +02:00
souleb 8b95f3509c
Update docs/spec/v2beta2/helmreleases.md
Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: souleb <bah.soule@gmail.com>
2024-04-22 12:19:35 +02:00
Soule BA 1b5a62f5c9
document helmchart chart reference
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-22 11:26:57 +02:00
Soule BA 3bb715ad97
Enable HelmChart ChartRef
If implemented, user will be able to share an existing HelmChart custom
resource between HelmReleases.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 17:03:31 +02:00
souleb 5e760db4a8
Merge pull request #905 from fluxcd/enable-ocirepo-sources
Add support for `OCIRepository` as chartRef
2024-04-18 13:39:31 +02:00
Soule BA a98d9574d6
fix requestForOCIRepository change
Use artifact digest instead of revision to validate whether to trigger a
new reconciliation

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:42 +02:00
Soule BA f5447b4430
All observeFuncs make take into account existing OCI Digest in snapshots
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:41 +02:00
Soule BA 65a02c8c6c
Add a test when switching from chart template to chartRef
The test case successfully upgrade with the same chart because version
is not computed the same way (12 digits of digest appended for
OCIRepository source).

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:41 +02:00
Soule BA edec322a3d
Take into account the oci-digest
This commit add the oci artifact digest into the release observed
snapshot. This is used to later to add that value as an annotation.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:41 +02:00
Soule BA 49b47d4c44
adding a section for chartRef in the doc
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:41 +02:00
Soule BA aeac55dba9
Adding 12 first character of digest to chart version
This is needed for an OCIRepository source in order to detect change for
mutable tags.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:41 +02:00
souleb 7864e3a9a2
Apply suggestions from code review
Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: souleb <bah.soule@gmail.com>
2024-04-18 13:07:41 +02:00
Soule BA d1d2d0002e
adding an upgrade from ocirepo test
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:40 +02:00
Soule BA 686fe58f6e
address review comments
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:40 +02:00
Soule BA 157f806598
fix methods names
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:07:40 +02:00
souleb 350accfba9
Update api/v2beta2/helmrelease_types.go
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: souleb <bah.soule@gmail.com>
2024-04-18 13:07:08 +02:00
Soule BA 20e14fe304
This commit enable reusing an existing OCIRepo as chartRef.
It takes into account switching from a chart
template to a referenced source (garbage collection).

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-18 13:05:04 +02:00
Sunny 56478cf1c8
Update Ready condition during drift correction
Update the Ready condition during drift correction to reflect the
current state of reconciliation. Without this, any previous Ready
condition value continues to persist on the object. If there was a
previous failure due to which Ready=False condition is present on the
object, the same value continues to persist if the atomic release
reconciliation enters a drift detection and correction loop. Resulting
in the status to show inaccurate state of the reconciliation.

Examples of two different scenarios that arise due to this issue:
- If a release without any dependency is installed, the status shows
  Ready=True for InstallSucceeded reason. But right after the
  installation, if a drift is detected the status continues to show the
  same Ready=True value. There's no indication that a drift correction
  is going on in the status. The events and logs do show that drift
  correction is taking place. But it can be confusing to see positive
  Ready value. Also, since the Ready condition message is copied for
  Reconciling condition, Reconciling=True with a "Helm install
  succeeded..." is seen.
- If a release depends on another release, and reconciliation results in
  dependency not ready error at first, Ready=False condition is added on
  the object. On subsequent runs, even when the dependencies are ready,
  the Ready=False condition isn't updated, resulting in stale Ready
  value until atomic release reconciliation completes. But if the atomic
  reconciliation enters a drift detection and correction loop, the
  Ready=False with dependency error persists in the status. This gives
  the impression that something is wrong with dependency check but based
  on the logs and events, the controller could be stuck in drift
  detection and correction loop.

Updating the Ready condition during drift detection shows the current
state of reconciliation, avoiding the confusing scenarios described
above.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-04-17 19:59:54 +00:00
souleb 9059e7f176
Merge pull request #935 from fluxcd/fix-925
Fix patching on drift detection
2024-04-09 16:19:54 +02:00
Soule BA de6588422f
Fix patching on drift detection
Make sure that `/data` for configmaps are not masked

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-09 13:02:10 +02:00
Stefan Prodan d2371a2e46
Merge pull request #932 from fluxcd/kustomize-v5.4.0
Update dependencies to Kustomize v5.4.0
2024-04-05 16:30:14 +03:00
Stefan Prodan d3997fdafe
Update dependencies to Kustomize v5.4.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-05 10:25:07 +03:00
Stefan Prodan 64073a821b
Merge pull request #930 from fluxcd/add-notation-provider
Add `notation` verification provider to API
2024-04-03 12:43:35 +03:00
Stefan Prodan 6bbdf4707e
Add notation verification provider to API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-02 21:03:27 +03:00
Stefan Prodan 4e6692c9d2
Merge pull request #929 from fluxcd/dependabot/github_actions/ci-a098ba917e
build(deps): bump the ci group with 11 updates
2024-04-02 18:03:03 +03:00
dependabot[bot] 09281bb723
build(deps): bump the ci group with 11 updates
Bumps the ci group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.1` | `4.1.2` |
| [korthout/backport-action](https://github.com/korthout/backport-action) | `2.4.1` | `2.5.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.0.0` | `3.2.0` |
| [actions/cache](https://github.com/actions/cache) | `4.0.0` | `4.0.2` |
| [helm/kind-action](https://github.com/helm/kind-action) | `1.8.0` | `1.9.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `5.1.0` | `5.3.0` |
| [docker/login-action](https://github.com/docker/login-action) | `3.0.0` | `3.1.0` |
| [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.15.8` | `0.15.10` |
| [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) | `1.9.0` | `1.10.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.24.0` | `3.24.9` |
| [EndBug/label-sync](https://github.com/endbug/label-sync) | `2.3.2` | `2.3.3` |


Updates `actions/checkout` from 4.1.1 to 4.1.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](b4ffde65f4...9bb56186c3)

Updates `korthout/backport-action` from 2.4.1 to 2.5.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](e8161d6a0d...ef20d86abc)

Updates `docker/setup-buildx-action` from 3.0.0 to 3.2.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f95db51fdd...2b51285047)

Updates `actions/cache` from 4.0.0 to 4.0.2
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](13aacd865c...0c45773b62)

Updates `helm/kind-action` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](dda0770415...99576bfa6d)

Updates `docker/build-push-action` from 5.1.0 to 5.3.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](4a13e500e5...2cdde995de)

Updates `docker/login-action` from 3.0.0 to 3.1.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](343f7c4344...e92390c5fb)

Updates `anchore/sbom-action` from 0.15.8 to 0.15.10
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](b6a39da807...ab5d7b5f48)

Updates `slsa-framework/slsa-github-generator` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.9.0...v1.10.0)

Updates `github/codeql-action` from 3.24.0 to 3.24.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e8893c57a1...1b1aada464)

Updates `EndBug/label-sync` from 2.3.2 to 2.3.3
- [Release notes](https://github.com/endbug/label-sync/releases)
- [Commits](da00f2c11f...5207415819)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: EndBug/label-sync
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-02 11:31:27 +00:00
Stefan Prodan 65b54580cf
Merge pull request #879 from fluxcd/helm-v3.14.0
Update controller to Helm v3.14.3 and Kubernetes v1.29.0
2024-04-02 14:29:09 +03:00
Stefan Prodan aa202e76cd
Build with Go 1.22
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-02 13:53:40 +03:00
Stefan Prodan 40ff025ff2
Update `fluxcd/pkg` dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-02 13:49:47 +03:00
Stefan Prodan 5ffeecb21f
Update controller to Helm v3.14.2 and Kubernetes v1.29.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-02 13:38:08 +03:00
souleb 07c0a0b315
Merge pull request #910 from fluxcd/update-controller-gen-0.14
Update controller-gen to v0.14.0
2024-03-12 14:12:06 +01:00
Soule BA 9e881d5210
updating controller-gen to v0.14.0
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-03-12 12:23:45 +01:00
souleb 5e83e51fcc
Merge pull request #908 from fluxcd/add-reconciliation-events
Use corev1 event type for sending events
2024-03-07 22:48:19 +01:00
Soule BA ff1421257e
fix: use corev1 event type for sending events
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-03-07 22:00:26 +01:00
souleb b79cad068d
Merge pull request #907 from fluxcd/add-reconciliation-events
Reintroduce missing events for helmChart reconciliation failures
2024-03-07 13:07:01 +01:00
Soule BA e283ead7f3
Reintroduce missing events for helmChart reconciliation
If implemented this PR reintroduce events for some failling action
during the reconciliation process, related to the helmChart retrieval
and loading of chart and values.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-03-06 15:52:41 +01:00
Stefan Prodan 493dd66190
Merge pull request #901 from gmolau/main
Remove `genclient:Namespaced` tag
2024-02-29 13:51:47 +00:00
Georg Molau ae301aa0ab Remove `genclient:Namespaced` tag
This tag isn't used by controller-tools, only `nonNamespaced` is.

Context: https://cloud-native.slack.com/archives/CLAJ40HV3/p1708794732147909
Signed-off-by: Georg Molau <georg.molau@gmail.com>
2024-02-27 22:23:27 +01:00
Sunny 0114b20936
Merge pull request #887 from fluxcd/release-v0.37.4
Release v0.37.4
2024-02-05 14:03:12 +05:30
Sunny 48781f2222
Release v0.37.4
Signed-off-by: Sunny <github@darkowlzz.space>
2024-02-05 08:19:18 +00:00
Sunny 0bd797a287
Merge pull request #884 from fluxcd/update-stale-ready-condition
Remove stale Ready=False conditions value to show more accurate status
2024-02-05 13:47:26 +05:30
Sunny 59c577a924 Remove stale Ready=False conditions values
When the reconciliation begins, while fulfilling the prerequisites,
Ready=False condition for various reasons are added on the object. On
failure, this reason is persisted on the object. On a subsequent
reconciliation, when the failure is recovered, the Ready=False condition
is not updates until the atomic reconciliation reaches a conclusion.
During this period if the atomic reconciliation enters a retry loop due
to constant drift detection and correction, the stale Ready=False
condition with incorrect reason persists on the object. The Ready=False
message is also copied to Reconciling=True condition, resulting in an
incorrect depiction of what's actually happening.
For example, if previously the HelmRelease failed with dependency not
ready error, on a subsequent reconciliation, even after going past the
dependency check and returning from atomic reconciliation due to drift
detection and correction loop scenario, the Ready=False condition
continues to show the stale dependency not ready error.

In order to show more accurate status, the Ready=False conditions added
while fulfilling prerequisites can be removed once those checks have
succeeded, updating Ready=False to Ready=Unknown with "reconciliation in
progress" message. If the atomic reconciliation gets stuck in the drift
detection and correction loop with this, the Ready and Reconciling
conditons would show "reconciliation in progress". This should be a
better indicator of what's going on. The events and logs can be checked
to determine accurately what's causing the reconciliation to be
progressing for ever.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-02-05 13:31:05 +05:30
Stefan Prodan d370e73a17
Merge pull request #886 from fluxcd/dependabot/github_actions/ci-bb3c355948
build(deps): bump the ci group with 4 updates
2024-02-05 09:15:15 +02:00
dependabot[bot] 1c61870ed1
build(deps): bump the ci group with 4 updates
Bumps the ci group with 4 updates: [docker/metadata-action](https://github.com/docker/metadata-action), [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/metadata-action` from 5.5.0 to 5.5.1
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](dbef88086f...8e5442c4ef)

Updates `sigstore/cosign-installer` from 3.3.0 to 3.4.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](9614fae9e5...e1523de757)

Updates `anchore/sbom-action` from 0.15.6 to 0.15.8
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](c6aed38a43...b6a39da807)

Updates `github/codeql-action` from 3.23.2 to 3.24.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b7bf0a3ed3...e8893c57a1)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 03:13:24 +00:00
Sunny c2c1064a4c
Merge pull request #883 from fluxcd/release-v0.37.3
Release v0.37.3
2024-02-01 21:16:47 +05:30
Sunny 38c5d80410
Release v0.37.3
Signed-off-by: Sunny <github@darkowlzz.space>
2024-02-01 15:34:01 +00:00
Sunny 0d87c62d65
Merge pull request #882 from fluxcd/deps-update
Update source-controller dependency
2024-02-01 20:45:05 +05:30
Sunny d86240ae6a
Update source-controller dependency
Signed-off-by: Sunny <github@darkowlzz.space>
2024-02-01 14:50:58 +00:00
Stefan Prodan b4e4885181
Merge pull request #877 from fluxcd/dependabot/github_actions/ci-c0ab02bc06
build(deps): bump the ci group with 3 updates
2024-01-29 18:00:19 +02:00
dependabot[bot] 88905cc024
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [korthout/backport-action](https://github.com/korthout/backport-action), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `korthout/backport-action` from 2.3.0 to 2.4.1
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](addffea45a...e8161d6a0d)

Updates `anchore/sbom-action` from 0.15.4 to 0.15.6
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](41f7a6c033...c6aed38a43)

Updates `github/codeql-action` from 3.23.1 to 3.23.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0b21cf2492...b7bf0a3ed3)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 15:44:54 +00:00
Stefan Prodan a5bcfc5dcc
Merge pull request #876 from fluxcd/dependabot/go_modules/go-deps-9b6914d736
Update controller to Kubernetes 1.28.6
2024-01-29 17:42:44 +02:00
Stefan Prodan 951accaba0
Update API to Kubernetes v1.28.6
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-01-29 17:30:39 +02:00
dependabot[bot] 9aa21f630d
build(deps): bump the go-deps group with 6 updates
Bumps the go-deps group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [github.com/fluxcd/cli-utils](https://github.com/fluxcd/cli-utils) | `0.36.0-flux.2` | `0.36.0-flux.3` |
| [github.com/fluxcd/pkg/apis/event](https://github.com/fluxcd/pkg) | `0.6.0` | `0.7.0` |
| [github.com/fluxcd/pkg/apis/kustomize](https://github.com/fluxcd/pkg) | `1.2.0` | `1.3.0` |
| [github.com/fluxcd/pkg/apis/meta](https://github.com/fluxcd/pkg) | `1.2.0` | `1.3.0` |
| [github.com/fluxcd/pkg/runtime](https://github.com/fluxcd/pkg) | `0.43.3` | `0.44.0` |
| [github.com/fluxcd/pkg/ssa](https://github.com/fluxcd/pkg) | `0.35.0` | `0.36.0` |


Updates `github.com/fluxcd/cli-utils` from 0.36.0-flux.2 to 0.36.0-flux.3
- [Commits](https://github.com/fluxcd/cli-utils/compare/v0.36.0-flux.2...v0.36.0-flux.3)

Updates `github.com/fluxcd/pkg/apis/event` from 0.6.0 to 0.7.0
- [Commits](https://github.com/fluxcd/pkg/compare/git/v0.6.0...git/v0.7.0)

Updates `github.com/fluxcd/pkg/apis/kustomize` from 1.2.0 to 1.3.0
- [Commits](https://github.com/fluxcd/pkg/compare/apis/meta/v1.2.0...apis/meta/v1.3.0)

Updates `github.com/fluxcd/pkg/apis/meta` from 1.2.0 to 1.3.0
- [Commits](https://github.com/fluxcd/pkg/compare/apis/meta/v1.2.0...apis/meta/v1.3.0)

Updates `github.com/fluxcd/pkg/runtime` from 0.43.3 to 0.44.0
- [Commits](https://github.com/fluxcd/pkg/compare/runtime/v0.43.3...runtime/v0.44.0)

Updates `github.com/fluxcd/pkg/ssa` from 0.35.0 to 0.36.0
- [Commits](https://github.com/fluxcd/pkg/compare/oci/v0.35.0...ssa/v0.36.0)

---
updated-dependencies:
- dependency-name: github.com/fluxcd/cli-utils
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/fluxcd/pkg/apis/event
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/fluxcd/pkg/apis/kustomize
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/fluxcd/pkg/apis/meta
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/fluxcd/pkg/runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/fluxcd/pkg/ssa
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 15:14:10 +00:00
Stefan Prodan d3abdcbb0a
Merge pull request #874 from fluxcd/dependabot-gomod
ci: Enable dependabot `gomod` updates
2024-01-29 17:13:01 +02:00
Stefan Prodan aaef3c8f6f
ci: Enable dependabot `gomod` updates
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-01-29 17:00:52 +02:00
Stefan Prodan df804884f2
Merge pull request #872 from fluxcd/go-1.21
Update Go to 1.21
2024-01-23 16:20:18 +02:00
Stefan Prodan d442ea336b
Update Go to 1.21
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-01-22 18:03:20 +02:00
Stefan Prodan 610f6e6d38
Merge pull request #871 from fluxcd/dependabot/github_actions/ci-da0b9f8a90
build(deps): bump the ci group with 3 updates
2024-01-22 09:02:35 +02:00
dependabot[bot] 3bb90c000f
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [actions/cache](https://github.com/actions/cache), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/cache` from 3.3.3 to 4.0.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](e12d46a63a...13aacd865c)

Updates `anchore/sbom-action` from 0.15.3 to 0.15.4
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](c7f031d924...41f7a6c033)

Updates `github/codeql-action` from 3.23.0 to 3.23.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e5f05b81d5...0b21cf2492)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 03:19:54 +00:00
Stefan Prodan 5c340a14ac
Merge pull request #867 from fluxcd/dependabot/github_actions/ci-31f014aa78
build(deps): bump the ci group with 3 updates
2024-01-15 09:39:50 +02:00
dependabot[bot] b636a2f9db
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [actions/cache](https://github.com/actions/cache), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/cache` from 3.3.2 to 3.3.3
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](704facf57e...e12d46a63a)

Updates `anchore/sbom-action` from 0.15.2 to 0.15.3
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](719133684c...c7f031d924)

Updates `github/codeql-action` from 3.22.12 to 3.23.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](012739e508...e5f05b81d5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 03:26:09 +00:00
Stefan Prodan 6875f5a9df
Merge pull request #865 from fluxcd/dependabot/github_actions/ci-9edfa6747d
build(deps): bump the ci group with 2 updates
2024-01-08 09:56:12 +02:00
dependabot[bot] 827a17336e
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [docker/metadata-action](https://github.com/docker/metadata-action) and [anchore/sbom-action](https://github.com/anchore/sbom-action).


Updates `docker/metadata-action` from 5.4.0 to 5.5.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](9dc751fe24...dbef88086f)

Updates `anchore/sbom-action` from 0.15.1 to 0.15.2
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](5ecf649a41...719133684c)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 03:48:10 +00:00
Stefan Prodan 45ed0538ee
Merge pull request #862 from fluxcd/dependabot/github_actions/ci-67e8f91c0c
build(deps): bump the ci group with 2 updates
2024-01-02 10:35:43 +02:00
dependabot[bot] f315821a49
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [docker/metadata-action](https://github.com/docker/metadata-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/metadata-action` from 5.3.0 to 5.4.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](31cebacef4...9dc751fe24)

Updates `github/codeql-action` from 3.22.11 to 3.22.12
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b374143c11...012739e508)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 08:22:57 +00:00
Stefan Prodan 17edadc2be
Merge pull request #860 from fluxcd/dependabot/go_modules/github.com/containerd/containerd-1.7.11
build(deps): bump github.com/containerd/containerd from 1.7.6 to 1.7.11
2024-01-02 10:20:50 +02:00
dependabot[bot] a52f65f09c
build(deps): bump github.com/containerd/containerd from 1.7.6 to 1.7.11
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.6 to 1.7.11.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.6...v1.7.11)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 21:23:45 +00:00
Hidde Beydals 24c6729a23
Merge pull request #859 from fluxcd/release-v0.37.2
Release v0.37.2
2023-12-19 17:24:41 +01:00
Hidde Beydals 9ffe94267d
Release v0.37.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-19 17:11:53 +01:00
Hidde Beydals 02fbbbe628
Merge pull request #858 from fluxcd/fix-namespace-selector
Properly configure namespace selector
2023-12-19 17:05:19 +01:00
Hidde Beydals 54eed52a6b
Properly configure namespace selector
This accidentally did not get `if`-wrapped in
eaa2a8c2fe, breaking the configuration
option to watch a single namespace, and thereby as by-effect the
breakage of sharding.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-19 16:52:50 +01:00
Hidde Beydals b993ca39f0
Merge pull request #856 from fluxcd/dependabot/go_modules/golang.org/x/crypto-0.17.0
build(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
2023-12-19 09:37:37 +01:00
dependabot[bot] fe2255f7ac
build(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 00:08:03 +00:00
Hidde Beydals 8db699925d
Merge pull request #854 from fluxcd/dependabot/github_actions/ci-66820a5bfd
build(deps): bump the ci group with 3 updates
2023-12-18 08:51:10 +01:00
dependabot[bot] 754d2fa8bf
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [korthout/backport-action](https://github.com/korthout/backport-action), [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `korthout/backport-action` from 2.2.0 to 2.3.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](b982d297e3...addffea45a)

Updates `sigstore/cosign-installer` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](1fc5bd396d...9614fae9e5)

Updates `github/codeql-action` from 2.22.9 to 3.22.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](c0d1daa7f7...b374143c11)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 03:41:19 +00:00
Hidde Beydals 8094f19cee
Merge pull request #852 from fluxcd/release-v0.37.1
Release v0.37.1
2023-12-15 09:57:28 +01:00
Hidde Beydals 46a564b62f
Release v0.37.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-15 09:43:36 +01:00
Hidde Beydals 5c56856b7a
Merge pull request #851 from fluxcd/fix-bw-compat-v2beta1
api: ensure backwards compatibility v2beta1
2023-12-15 09:25:04 +01:00
Hidde Beydals 09366330f4
api: ensure backwards compatibility v2beta1
As we are (still) not making use of conversion webhooks, new fields can
only be introduced by including them in all served API versions. As
otherwise conversion will fail.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-15 08:45:51 +01:00
Hidde Beydals 603d3219da
Merge pull request #848 from fluxcd/remediation-stall
Early stall condition detection after remediation
2023-12-14 10:28:28 +01:00
Sunny fa5e284222 Early stall condition detection after remediation
Detect stall condition due to exhausted remediation retry right after
remediating. This helps return from AtomicRelease.Reconcile() with
proper stalled status condition and error. Without this, after
remediation, a stalled condition detection required a new
reconciliation, leaving the status of the object without any Reconciling
or Stalled condition.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-14 09:05:27 +01:00
Hidde Beydals abcdfef2de
Merge pull request #849 from fluxcd/update-helm
Update Helm to v3.13.3
2023-12-14 09:05:17 +01:00
Hidde Beydals 1c67732b23
Update Helm to v3.13.3
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-14 08:48:59 +01:00
Hidde Beydals 6921825f64
Merge pull request #846 from fluxcd/update-runtime
Update runtime to v0.43.3
2023-12-13 15:01:35 +01:00
Hidde Beydals 238880a10b
Update runtime to v0.43.3
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-13 14:41:25 +01:00
Hidde Beydals bafafe2c9d
Merge pull request #845 from fluxcd/retry-http-log-errors
loader: log HTTP errors to provide faster feedback
2023-12-13 11:42:07 +01:00
Hidde Beydals 07e204615b
loader: log HTTP errors to provide faster feedback
This configures a logger on the HTTP client used to load a Helm chart,
ensuring HTTP errors surface faster.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-13 11:30:37 +01:00
Hidde Beydals 259b8f812f
Merge pull request #844 from fluxcd/sc-hostname-overwrite
loader: allow overwrite of URL hostname again
2023-12-13 09:56:37 +01:00
Hidde Beydals 1e66201829
loader: allow overwrite of URL hostname again
This adds back the support for overwriting the host name a chart is
downloaded from (again) using the `SOURCE_CONTROLLER_LOCALHOST`
environment variable.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-13 09:35:05 +01:00
Hidde Beydals 8a6e68b4ea
Merge pull request #843 from fluxcd/fix-spec-typos
docs/spec: address typo
2023-12-13 09:09:32 +01:00
Hidde Beydals 504b268be8
docs/spec: address typo
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-13 08:52:04 +01:00
Hidde Beydals 50aab28614
Merge pull request #842 from fluxcd/release-v0.37.0
Release v0.37.0
2023-12-12 09:00:10 +01:00
Hidde Beydals 4cae41ce3e
Release v0.37.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-12 08:48:56 +01:00
Hidde Beydals 14a333d46a
Merge pull request #828 from fluxcd/document-v2beta2
docs/spec: document `v2beta2` API
2023-12-11 19:22:31 +01:00
Hidde Beydals bb5a03bbfb
docs: various doc nits
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:51:58 +01:00
Hidde Beydals d8966cd8de
docs/spec: refer to v2beta2 doc for design details
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:57 +01:00
Hidde Beydals 344bd829ca
docs/spec/v2beta2: address review comment
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:56 +01:00
Hidde Beydals 302978f1b2
docs/spec/v2beta2: add Ready characteristics
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:55 +01:00
Hidde Beydals 9eefbf7e1a
docs/spec/v2beta2: address review comments
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:53 +01:00
Hidde Beydals 2b80e30560
docs: add notes about drift detection support
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:52 +01:00
Hidde Beydals 015eba09ed
docs/spec/v2beta2: add README
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:51 +01:00
Hidde Beydals 0075f20efb
docs/spec/v2beta2: rewrite intro
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:51 +01:00
Hidde Beydals 8a9acd6ce7
docs/spec/v2beta2: document Status Conditions
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:50 +01:00
Hidde Beydals 875e605ea9
docs/spec/v2beta2: explain example
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:50 +01:00
Hidde Beydals 04600fe15a
docs/spec/v2beta2: document most Status fields
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:50 +01:00
Hidde Beydals 99303f3e19
docs/spec/v2beta2: document debugging section
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:49 +01:00
Hidde Beydals 1b0e5d71f8
docs/spec/v2beta2: make note of release triggers
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:49 +01:00
Hidde Beydals aeef72abbf
docs/spec/v2beta2: add uninstall warnings
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:48 +01:00
Hidde Beydals d741525b2f
docs/spec/v2beta2: document remote clusters
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:48 +01:00
Hidde Beydals 2c48cf280f
docs/spec/v2beta2: document failure handling
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:47 +01:00
Hidde Beydals eca86919be
doc/spec/v2beta2: document CRD lifecycle
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:47 +01:00
Hidde Beydals f26749231e
docs/spec/v2beta2: document RBAC
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:47 +01:00
Hidde Beydals 436860f061
docs/spec: start documenting v2beta2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 18:28:46 +01:00
Stefan Prodan 7d0aecfa41
Merge pull request #841 from fluxcd/fix-test-flake
controller: address test flake
2023-12-11 17:11:14 +01:00
Hidde Beydals f64246ba86
controller: address test flake
As the Kubernetes client used in tests is cache backed, it can take a
tiny bit of time for the client to actually notice the removal.

Wrapping in `Eventually` should address this.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 16:59:55 +01:00
Hidde Beydals f3e4789d4d
Merge pull request #840 from fluxcd/update-deps
Update source-controller to v1.2.2
2023-12-11 15:42:39 +01:00
Hidde Beydals c9423cc721
Update github.com/fluxcd/pkg/runtime to v0.43.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 15:28:02 +01:00
Hidde Beydals c1d3f90bf7
Update source-controller to v1.2.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 15:26:42 +01:00
Hidde Beydals cca1d3a2c0
Merge pull request #839 from fluxcd/update-deps
Update Kustomize to v5.3.0
2023-12-11 10:24:17 +01:00
Hidde Beydals c44d615335
Update dependencies
This includes an update of Kustomize to v5.3.0.

- github.com/fluxcd/cli-utils to v0.36.0-flux.2
- github.com/fluxcd/pkg/runtime to v0.43.1
- k8s.io/utils to v0.0.0-20231127182322-b307cd553661
- sigs.k8s.io/kustomize/api to v0.16.0
- sigs.k8s.io/kustomize/kyaml to v0.16.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 09:57:26 +01:00
Hidde Beydals 9322e73f93
api: update (indirect) dependencies
- github.com/go-logr/logr to v1.3.0
- golang.org/x/net to v0.19.0
- golang.org/x/text to v0.14.0
- k8s.io/klog/v2 to v2.110.1
- k8s.io/utils to v0.0.0-20231127182322-b307cd553661
- sigs.k8s.io/structured-merge-diff/v4 to v4.4.1

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 09:57:25 +01:00
Hidde Beydals 2586fdd907
Merge pull request #838 from fluxcd/alpine-319
build: update Alpine to 3.19
2023-12-11 09:24:26 +01:00
Hidde Beydals 74da69e7fb
build: update `tonistiigi/xx` to 1.3.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 09:12:04 +01:00
Hidde Beydals c2f1d8f660
build: update Alpine to 3.19
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 09:11:43 +01:00
Stefan Prodan 8848fb81e6
Merge pull request #837 from fluxcd/dependabot/github_actions/ci-bf6ecd85f3
build(deps): bump the ci group with 3 updates
2023-12-11 08:40:48 +01:00
dependabot[bot] 19d25347b1
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [actions/setup-go](https://github.com/actions/setup-go), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/setup-go` from 4.1.0 to 5.0.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](93397bea11...0c52d547c9)

Updates `anchore/sbom-action` from 0.15.0 to 0.15.1
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](fd74a6fb98...5ecf649a41)

Updates `github/codeql-action` from 2.22.8 to 2.22.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](407ffafae6...c0d1daa7f7)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 04:04:39 +00:00
Hidde Beydals 7d7f081610
Merge pull request #836 from fluxcd/address-test-flake 2023-12-08 20:05:35 +01:00
Hidde Beydals 8b19eb0aa2
ci: increase timeout delete-ns tests
This test has shown to be a flake on multiple ocassions.

After running it locally a dozen of times, my conclusion is that the
time it takes for Kubernetes to shutdown a Pod may sometimes be a tiny
bit longer than anticipated by the current timeout.

Therefore, increase it to 5 minutes and provide more context on the
state of the namespace in case a timeout occurs.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-08 18:17:24 +01:00
Hidde Beydals 56ceb305a5
Merge pull request #835 from fluxcd/update-sc
Update source-controller to v1.2.1
2023-12-08 14:56:16 +01:00
Hidde Beydals 17d4b726bd
Update source-controller to v1.2.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-08 14:13:48 +01:00
Sunny c4915d1154
Merge pull request #833 from fluxcd/stale-remediated-in-sync
Remove stale remediated condition when in-sync
2023-12-08 18:28:56 +05:30
Sunny 9eb596eb46 Remove stale remediated condition when in-sync
Remediation can roll back to a version that matches with the next good
config. In such situation, release will be in-sync and no action will be
performed. The status conditions will continue to show Remediated=True
and Released=False. Check and remove stale Remediated condition and add
a Released=True condition with message constructed from the latest
release.

Introduce replaceCondition() to replaces target condition with a
replacement condition, retaining the transition time. This helps ensure
that the last transition time of releases don't change when a release is
marked from remediated to released.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-08 18:14:52 +05:30
Hidde Beydals fe8569bae6
Merge pull request #834 from fluxcd/propagate-hc-msg
controller: enrich "HelmChart not ready" messages
2023-12-08 13:27:39 +01:00
Hidde Beydals 93d2118f71
controller: enrich "HelmChart not ready" messages
This propagates the reason a HelmChart is (likely) not ready to the
message of the Ready condition.

The goal of this is to make it easier for people to reason about a
potential failure that may be happening while retrieving the chart,
without having to inspect the HelmChart itself.

As at times, they may not have access (due to e.g. not being able to
access the namespace, while the controller is allowed to create the
object there), or are simply not aware of the fact that this object
is created by the controller for them.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-07 23:35:44 +01:00
Hidde Beydals ee8177e005
Merge pull request #832 from fluxcd/api-kus-deprecations
api: deprecate stragic merge and JSON 6902 patches
2023-12-07 17:59:24 +01:00
Hidde Beydals 35e914d159
api: deprecate stragic merge and JSON 6902 patches
They have been deprecated for a long time, and should be scheduled for
removal to ensure they can be removed in the final `v2` release.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-07 17:37:00 +01:00
Hidde Beydals b10947b269
Merge pull request #829 from fluxcd/remove-stale-testsuccess
reconcile: remove stale `TestSuccess` condition
2023-12-07 17:24:39 +01:00
Hidde Beydals 7ccfc93448
reconcile: remove stale `TestSuccess` condition
When a Helm install or upgrade is performed, to prevent confusion due to
reporting a stale test result.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-07 17:10:39 +01:00
Hidde Beydals 66ed0327be
Merge pull request #830 from fluxcd/tweak-chart-events
reconcile: do not emit HelmChartInSync event
2023-12-07 13:08:12 +01:00
Hidde Beydals 47fbb37f2a
reconcile: do not emit HelmChartInSync event
Due to the frequency, this would otherwise suppress other Kubernetes
Events which are more important. Especially when the `.spec.interval`
of the HelmRelease is set to a low value.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-07 12:53:13 +01:00
dependabot[bot] 842a9425fa
Merge pull request #827 from fluxcd/dependabot/github_actions/ci-22f61cdbb1 2023-12-04 13:01:30 +00:00
dependabot[bot] 2f9f39dd24
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [docker/metadata-action](https://github.com/docker/metadata-action).


Updates `korthout/backport-action` from 2.1.1 to 2.2.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](08bafb375e...b982d297e3)

Updates `docker/metadata-action` from 5.0.0 to 5.3.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](96383f4557...31cebacef4)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 12:50:23 +00:00
Hidde Beydals 0bde3275f0
Merge pull request #825 from fluxcd/various-minor-fixes
Various minor fixes
2023-12-04 13:47:18 +01:00
Hidde Beydals 67fd6fb724
reconcile: remove Remediated condition on release
This avoids having a confusing "stale" Remediated condition when a new
release has been attempted.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 18:49:06 +01:00
Hidde Beydals 05bc368de7
reconcile: add `ProgressingWithRetry` on retry
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 17:36:14 +01:00
Hidde Beydals 0919fb4c24
controller: remove deprecated metrics
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 17:23:52 +01:00
Hidde Beydals 51563d6012
reconcile: stall without rollback target
This ensures that if there is no target to roll back to due to all of
them being in a failed state, the controller stalls instead of ending up
in a loop of upgrade attempts.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 17:20:51 +01:00
Hidde Beydals 0a2041c338
controller: ensure object in cache before requeue
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 17:20:50 +01:00
Hidde Beydals 48cad68386
controller: unready dep should not bump obs gen
This ensures that any unfulfilled dependencies for which we requeue do
not prematurely bump the observed generation by introducing typed
errors.

These typed errors ensure that the logic to bump the observed generation
can continue to be the same, while ignoring them just in time before
returning the final error.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 14:14:40 +01:00
Hidde Beydals bc7fb25d27
api: limit maximum number of snapshots in history
This ensures that on repetitive failures, the number of snapshots does
not grow indefinitely due to there not being any in a superseded or
deployed state.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-01 11:38:56 +01:00
Hidde Beydals 7f9160c66c
Merge pull request #823 from fluxcd/reset-force-annotations
Introduce `forceAt` and `resetAt` annotations
2023-12-01 11:38:43 +01:00
Hidde Beydals 6b7789aadc
Implement `forceAt` and `resetAt` annotations
This makes the controller actually take the
`reconcile.fluxcd.io/forceAt` and `reconcile.fluxcd.io/resetAt` into
account.

For `reconcile.fluxcd.io/resetAt`, this means that the failure counts on
the `HelmRelease` object are reset when the token value of the
annotation equals `reconcile.fluxcd.io/requestedAt`. Allowing the
controller to start over with attempting to install or upgrade the
release until the retries count has been reached again.

For `reconcile.fluxcd.io/forceAt`, this means that a one-off Helm
install or upgrade is allowed to take place even if the object is out of
retries, in a failed state where it should be remediated, or in-sync.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-30 10:22:49 +01:00
Hidde Beydals 7a15000b4c
api: introduce `forceAt` and `resetAt` annotations
This introduces two new annotations:

- `reconcile.fluxcd.io/resetAt`: to reset the failure counts for a
  `HelmRelease` object.
- `reconcile.fluxcd.io/forceAt`: to allow a one-off Helm install or
  upgrade when the controller would otherwise do nothing (e.g. due to
  being out of retries, in-sync, in a failed state, etc.)

Both annotations require the `reconcile.fluxcd.io/requestedAt`
annotation to be set at the same time, with the same token value.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-30 10:22:48 +01:00
Hidde Beydals d310c8b2de
Merge pull request #822 from fluxcd/correct-drift-apply
Correct cluster drift using patches
2023-11-30 10:21:39 +01:00
Hidde Beydals 0131f2227b
action/diff: include Helm metadata in objects
This ensures that the metadata labels and annotations Helm adds during
the creation of resources are included while diffing them.

As they are not part of the manifest but should be restored in case
they are e.g. removed or modified.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-30 09:41:05 +01:00
Hidde Beydals ccd8f88282
Correct cluster drift using patches
This changes the cluster drift correction behavior from performing a
Helm upgrade to performing create and patch API requests based on the
JSON Patch data.

Doing this is much lighter than performing a full release cycle, and
deals with the issue of Helm being unable to restore state of Custom
Resources without the `--force` flag being set. Which has unwanted
side-effects like forcing objects through a deletion/creation cycle.

After a drift correction attempt a Kubernetes Event is emitted, which
contains a summary of the created and patched resources, and a
collection of any (potential) errors.

As the goal is to restore state as best as we can, the drift correction
will be re-attempted until all resources have been restored to the
desired state.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-29 20:34:45 +01:00
Stefan Prodan 113bf544d3
Merge pull request #821 from fluxcd/deprecate-v2beta1
Add deprecation warning to v2beta1 API
2023-11-27 16:53:35 +02:00
Stefan Prodan 92a535f6cd
Add deprecation warning to v2beta1 API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-11-27 16:41:50 +02:00
Hidde Beydals e0ecb05099
Merge pull request #820 from fluxcd/dependabot/github_actions/ci-9cf97fb57d
build(deps): bump the ci group with 3 updates
2023-11-27 09:52:36 +01:00
dependabot[bot] 4e59953180
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [anchore/sbom-action](https://github.com/anchore/sbom-action), [fossa-contrib/fossa-action](https://github.com/fossa-contrib/fossa-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `anchore/sbom-action` from 0.14.3 to 0.15.0
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](78fc58e266...fd74a6fb98)

Updates `fossa-contrib/fossa-action` from 2.0.0 to 3.0.0
- [Release notes](https://github.com/fossa-contrib/fossa-action/releases)
- [Changelog](https://github.com/fossa-contrib/fossa-action/blob/master/CHANGELOG.md)
- [Commits](6728dc6fe9...cdc5065bcd)

Updates `github/codeql-action` from 2.22.7 to 2.22.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](66b90a5db1...407ffafae6)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: fossa-contrib/fossa-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 03:28:56 +00:00
Hidde Beydals 6ec21aba4a
Merge pull request #818 from fluxcd/allow-digest-config
Allow configuration of snapshot digest algorithm
2023-11-24 18:33:00 +01:00
Hidde Beydals 7a70bd599f
Allow configuration of digest algorithm
This introduces a `--snapshot-digest-algo` flag to allow configuring a
different algorithm than SHA256.

This allows the user to for example configure `blake3`, which is
potentially faster (and less resource intensive) on modern hardware.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 18:19:53 +01:00
Hidde Beydals f7185d4c62
Merge pull request #819 from fluxcd/tidy-code
Remove obsolete code and tidy things
2023-11-24 18:19:42 +01:00
Hidde Beydals 841fca08fe
features: mark drift related flags as deprecated
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 18:01:07 +01:00
Hidde Beydals 2d927b9b9e
Miscellaneous tidying of minor things
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 17:59:45 +01:00
Hidde Beydals 0d30be93ec
Remove various verification functions
These functions are no longer in use by the actual code base, while the
same outcome can be achieved by using `LastRelease` in combination with
`VerifyReleaseObject`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 17:59:44 +01:00
Hidde Beydals 347cf24482
Remove obsolete `util` package
This code is now available in upstream controller-runtime.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 17:59:42 +01:00
Hidde Beydals be2c47e3b4
Remove obsolete `runner` sub-module
This used to drive the logic behind the `v2beta1` API, but has now
become obsolete with the `action` sub-module as its successor.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 17:59:39 +01:00
Hidde Beydals 85cac772eb
Merge pull request #815 from fluxcd/new-drift-detection
Allow configuration of drift detection on `HelmRelease`
2023-11-24 17:59:34 +01:00
Hidde Beydals 6b1effcd2f
diff: remove `Differ` code
In favor of the new `Diff` action.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 16:41:47 +01:00
Hidde Beydals bb6ad72654
reconcile: determine drift in cluster
This allows `DetermineReleaseState` to determine if the cluster state
has drifted from the manifest defined in the Helm storage. This allows
the atomic reconciler to determine if an upgrade should happen based
on the configuration of the `HelmRelease`.

If drift detection is `enabled` (or set to `warn`), it will report
drift via the controller logs and a Kubernetes Event. In addition, when
correction is enabled, it will instruct to perform a Helm upgrade to
correct the drift.

To summarize the detected drift in a compact message, summarize
utilities have been introduced to the `diff` package.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 16:41:45 +01:00
Hidde Beydals 98c4118818
action: introduce `Diff` action
The `Diff` action can be used to detect changes between the manifest
from a Helm release and the current cluster state.

Compared to the previous diff functionality, it allows for ignoring
specific fields in a resource using the newly introduced ignore rules
in the API.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 13:35:15 +01:00
Hidde Beydals a5db99a88c
api: allow configuration of drift detection
This adds the option to enable drift detection for a specific
`HelmRelease` instance using `.spec.driftDetection.mode`.

Supported configurations are `enabled` (detect and correct), `warn`
(detect) and `disabled`.

In addition to this, it allows defining a set of ignore rules using
`.spec.driftDetection.ignore`. Which can be used to ignore (portions
of) a resource using JSON pointers and target selectors.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 13:33:32 +01:00
Hidde Beydals c3f13a3844
Merge pull request #817 from fluxcd/update-k8s
Update to Kubernetes 1.28.x, Helm v3.13.2 and Kustomize v5.2.1
2023-11-24 13:32:33 +01:00
Hidde Beydals e441c251c3
api: change `yaml` field tag to `json`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 13:19:34 +01:00
Hidde Beydals 576c14e272
reconcile: slightly change "unmanaged" log message
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 12:52:17 +01:00
Hidde Beydals 6654b347fe
release: remove `Labels` field from `Observation`
Helm v3.13.x includes a change which causes labels to be magically
set during writes to the storage, without persisting them to the
release object which is passed to the interface.

Because of this, at the time of observing the initial write to the
storage we would not see them, but once we are verifying them we would.
Causing the calculated digest to always differ, and making the
controller think the storage item had changed.

While I am of opinion it would be better for Helm to set the labels on
the release object as soon as they are persisted to the storage, the
only solution now for us is to ignore them.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 12:47:24 +01:00
Hidde Beydals fb6221c4a3
yaml: adopt for `sigs.k8s.io/yaml` `v1.4.0`
Due to switch to a hard fork of goyaml.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 12:46:34 +01:00
Hidde Beydals eaa2a8c2fe
Update dependencies
- github.com/fluxcd/cli-utils to v0.36.0-flux.1
- github.com/fluxcd/pkg/apis/event to v0.6.0
- github.com/fluxcd/pkg/apis/kustomize to v1.2.0
- github.com/fluxcd/pkg/apis/meta to v1.2.0
- github.com/fluxcd/pkg/runtime to v0.43.0
- github.com/fluxcd/pkg/ssa to v0.34.0
- github.com/fluxcd/pkg/testserver to v0.5.0
- github.com/go-logr/logr to v1.3.0
- github.com/google/go-cmp to v0.6.0
- github.com/hashicorp/go-retryablehttp to v0.7.5
- github.com/onsi/gomega to v1.30.0
- github.com/opencontainers/go-digest to v1.0.1-0.20231025023718-d50d2fec9c98
- github.com/opencontainers/go-digest/blake3 to v0.0.0-20231025023718-d50d2fec9c98
- golang.org/x/text to v0.14.0
- helm.sh/helm/v3 to v3.13.2
- k8s.io/api to v0.28.4
- k8s.io/apiextensions-apiserver to v0.28.4
- k8s.io/apimachinery to v0.28.4
- k8s.io/cli-runtime to v0.28.4
- k8s.io/client-go to v0.28.4
- k8s.io/kubectl to v0.28.4
- k8s.io/utils to v0.0.0-20231121161247-cf03d44ff3cf
- sigs.k8s.io/controller-runtime to v0.16.3
- sigs.k8s.io/kustomize/api to v0.15.0
- sigs.k8s.io/kustomize/kyaml to v0.15.0
- sigs.k8s.io/yaml to v1.4.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 12:43:33 +01:00
Hidde Beydals a97a9ffa69
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v1.2.0
- github.com/fluxcd/pkg/apis/meta to v1.2.0
- k8s.io/apiextensions-apiserver to v0.28.4
- k8s.io/apimachinery to v0.28.4
- sigs.k8s.io/controller-runtime to v0.16.3
- sigs.k8s.io/yaml to v1.4.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 11:21:36 +01:00
Hidde Beydals 3f431e1cc8
Merge pull request #816 from fluxcd/test-suite-fixes
Address minor issues
2023-11-24 11:04:02 +01:00
Hidde Beydals e4d19b8e89
testdata: properly take tag value into account
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 10:47:02 +01:00
Hidde Beydals 4c439b721a
action/upgrade: use correct CRD policy
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 10:46:23 +01:00
Hidde Beydals 001e7da2f1
controller: repair fuzz test
We should actually add more of them now that the code base has grown (in
complexity). But this solves the issue for CI for now.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 10:11:33 +01:00
Hidde Beydals b8d65235f8
Merge pull request #738 from fluxcd/new-reconciler
Rework `HelmRelease` reconciliation logic
2023-11-24 09:39:01 +01:00
Hidde Beydals 4a8d2ff0f4
action: provide reason for failures count reset
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:17 +01:00
Hidde Beydals 3ce6e8d1b5
reconcile: improve wording `Stalled` condition
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:17 +01:00
Hidde Beydals 0535ae1114
predicates: notice source changing to `Ready=True`
This ensure that when a chart object has a temporary `Ready=False`
state, the predicate will notice the change to `Ready=True` and
cause an enqueue request.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:16 +01:00
Hidde Beydals 6ffdaddc06
action: omit logging on CRD apply no-op
As it does not offer real value, and creates noise when the logs are
included in an emitted event.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:15 +01:00
Hidde Beydals 7aad010664
controller: immediate requeue unfinished release
This improves continuity while the controller attempts to move the
release forward.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:14 +01:00
Hidde Beydals 5d1f34a029
controller: patch after setting `Reconciling=True`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:13 +01:00
Hidde Beydals 20c00fd47a
action: provide a reason on release target changes
This to allow better feedback to the user on why the controller decided
to uninstall the release.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-23 00:17:09 +01:00
Hidde Beydals 580c72cd09
controller: adopt release based on v2beta1 state
This allows the controller to be updated from `v2beta1` to `v2beta2`
without triggering a release to settle state.

It does this by looking at the previous successful release as recorded
for the `v2beta1` object, and if found, recording a snapshot for it in
the new `History` field of the status.

This feature can be disabled by setting the `AdoptLegacyReleases`
feature flag to `false`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-22 23:14:17 +01:00
Hidde Beydals eab8a50071
api: prepare `v2beta1` status for `v2beta2`
This allows users to delay updating their `apiVersion` declarations,
as the fields will be known in the previous version.

If we would not do this, the fields would get wiped when the `v2beta1`
resource is applied, potentially causing spurious upgrades.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-22 23:14:15 +01:00
Hidde Beydals 9bb8f02495
api: continue to record `LastAppliedRevision`
This ensures that certain UIs can continue to display information to
their users while they work on making better use of the new data
available in `v2beta2`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-21 15:31:30 +01:00
Hidde Beydals 6f05228e85
reconcile: remove logs from test failure event
During tests, Helm logs a mixture of debug and timeout errors which
(unlike during install or upgrade) do not provide much useful
information about the reason of failure.

Given this, remove the logs from the output to reduce noise.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:56 +01:00
Hidde Beydals 28a7800528
reconcile: mark `Ready=Unknown` when awaiting test
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:55 +01:00
Hidde Beydals 70485017d2
controller: requeue on fixed interval on chart 404
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:54 +01:00
Hidde Beydals eacd97532c
reconcile: remove reconciler type from messages
Not of much relevance to the user, while it can be confusing for
unlock.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:54 +01:00
Hidde Beydals 533589ce39
api: change `MaxHistory` default to `5`
As anything beyond ~3 releases has no real value to the controller
itself, while the time it takes to perform a release increases with
the number of releases kept in history.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:53 +01:00
Hidde Beydals c5a017cb76
api: record observed releases in `Status.History`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:53 +01:00
Hidde Beydals 517d42fe5d
build: incorporate condition changes in e2e
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:52 +01:00
Hidde Beydals 16da3ec66f
reconcile: allow unlock without current
As persisting to the API server before an unexpected termination is not
feasible, allow a release to be unlocked without it being observed.

This has the potential result of interfering with a user running `helm`
by hand, but the further process should be capable of dealing with any
unexpected failure resulting from this.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:51 +01:00
Hidde Beydals 2e0e22593f
reconcile: improve state determination
This decouples the state determination from deciding which action to
take, making it easier to reason about the different types of state
and what action should be taken to drive it forward.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:51 +01:00
Hidde Beydals 10277c7b26
api: add `LastAttemptedReleaseAction` to status
This can be used to reliable determine the active remediation strategy
which should be used. Including in edge cases where e.g. an uninstall
remediation is configured for upgrade failures.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:50 +01:00
Hidde Beydals 80d0878e96
controller: ignore `NotFound` API error on delete
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:50 +01:00
Hidde Beydals 2df90eb4cf
reconcile: improve observability between actions
- Change the log-level of "action determination" to "debug".
- Set `Ready=Unknown` while working on an install or upgrade.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:49 +01:00
Hidde Beydals 7c52fd255f
action: simplify chart diff logic
We actually only care about the chart name or version changing, as we
assume proper (immutable) versioning by the publisher of the chart
(either the user, or the source-controller).

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:49 +01:00
Hidde Beydals 096956fdfd
controller: properly record object metrics
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:48 +01:00
Hidde Beydals d0c4c14056
reconcile: improve uninstall w/o purging history
This improves the reconciliation of an uninstall when the release has
already been uninstalled while `KeepHistory` has been set, by detecting
the (sadly non-typed) error Helm produces as desired state.

Avoiding certain edge-cases where for example a deleted HelmRelease
would end up in an irrecoverable loop of uninstall attempts, after
being remediated (using an uninstall) before the deletion request.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:47 +01:00
Hidde Beydals 191bebfafd
reconcile: simplify `NextAction` logic
By looking at the type of the error, instead of doing a separate check
on `cur != nil`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:47 +01:00
Hidde Beydals f156c3550e
reconcile: allow cfg of manager in atomic action
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:46 +01:00
Hidde Beydals ac9c2c3142
reconcile: ensure object patch on context cancel
As we are working with secondary state which we need to keep track of,
persisting the last state even when the context is canceled (due to
e.g. a controller shutdown) is important to improve the chances of
successfully being able to recover from any abrupt terminations.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:46 +01:00
Hidde Beydals 19be1b24ac
api: change format of `Snapshot#FullReleaseName`
From `<namespace>/<name>.<version>` to `<namespace>/<name>.v<version>`,
to better resemble the internal name format of e.g. Helm storage
Secrets.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:45 +01:00
Hidde Beydals 272329d86a
action: add `:` separator between ts and msg logs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:45 +01:00
Hidde Beydals a6ae4c3fb9
reconcile: improve log levels of actions
This ensures the logs of the Kubernetes client used by Helm are
persisted to the log buffer, as they can contain important information
when an action times out.

In addition, move the logs from the Helm actions themselves to the
"debug" log level (while still including them in Kubernetes Events in
case of a failure), in favor of the logs produced by the `reconcile`
package itself. While moving the logs from the Helm storage to the
"trace" log level, as they only contain information about e.g. writes
to a Secret.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:44 +01:00
Hidde Beydals bc036c027f
reconcile: improve insights of progress in logs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:43 +01:00
Hidde Beydals 5510175ccb
reconcile: tweak event messages
This in an attempt to maintain compatability with earlier documented
inclusion and exclusion lists for Alerts, like the following:

```
  eventSources:
    - kind: HelmRelease
      name: demo
  inclusionList:
    - ".*.upgrade.*succeeded.*"
```

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:43 +01:00
Hidde Beydals 94064da340
controller: add reconcile release tests
Plus some minor improvements to the logic, based on writing tests.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:42 +01:00
Hidde Beydals 882da27a5d
api: move `Current` and `Previous` into `History`
The primary reason for this is the alphabetical ordering of `kubectl
describe`, which caused the fields to be listed in separate places
instead of a bundle.

From a programmatic perspective, it is also great because it is now much
easier to reset any previous state when e.g. uninstalling a release. As
we can simply write an empty struct to erase any memory of a previous
release, instead of having to deal with multiple fields.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:42 +01:00
Hidde Beydals 7dfce0c738
api: introduce `APIVersion` in `Snapshot`
This will allow the controller to pick the right method for digest
calculations when we for example add new data into the calculation.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:41 +01:00
Hidde Beydals 9df9b176d9
api: various naming improvements
- Rename `HelmReleaseInfo` to `Snapshot`.
- Rename `HelmReleaseTestHook` to `TestHookStatus`.
- Rename `ObservedRelease` to `Observation`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:41 +01:00
Hidde Beydals b2ba3d97ea
controller: improve deletion logic and add tests
This ensures certain edge-cases around the availability of the service
account and/or KubeConfig are handled.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:40 +01:00
Hidde Beydals fbd73ac399
controller: start w/ adding tests for HelmRelease
This adds base coverage for some of the simpler methods which do not
require extensive mocking.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:39 +01:00
Hidde Beydals 1dac82ad2c
reconcile: handle manually uninstalled release
This is a better way of dealing with this situation, as the previous
logic would result in an `ErrNoStorageUpdate`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:39 +01:00
Hidde Beydals 5e3ad5d21a
reconcile: add `HelmChartTemplate` sub-reconciler
"With hope comes the potential for both triumph and tribulation."

Due to difficulties beyond the time I have at hands at present[1], the
separate reconciler which took care of ensuring the HelmChart of the
HelmRelease was kept up-to-date has been transformed into a
sub-reconciler.

The behavior of the sub-reconciler remains largely unchanged, except the
required changes to deal with the lack of possibilities to requeue.
Effectively, this means that instead of e.g. deleting the HelmChart
object, requeue, and create it again. This is now handled in a single
operation, unless the deletion fails.

[1]: The core of the issue is that deregistration of finalizers becomes
difficult due to the behavior of the patch helper, and unavailability of
list merges for patch operations on Custom Resources within Kubernetes.

This means that when two reconcilers simultaneously work on the
deregistration of the finalizers, and one succeeds before the other. The
last finishing reconciler will attempt to add the finalizer of the other
reconciler back, as it did exist at the start of their reconciliation
run.

Attempts to work around this (for example, by using an optimistic lock
on the patch operation of the finalizers field) would cause new issues.
As Kubernetes will then delete the object as soon as the patch has
succeeded, and before the reconciliation process actually ends.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:38 +01:00
Hidde Beydals dab2578c07
acl: introduce package to enable global config
This introduces an `acl` package in `internal` which globally configures
the allowance to namespaced references, instead of having to pass on a
variable everywhere.

For the sake of security, the default behavior of the package itself is
to _not_ allow cross namespace references. However, the behavior of the
controller remains unchanged, and the configuration flag still enables
the allowance by default.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:38 +01:00
Hidde Beydals e32c1a0f4a
reconcile: trim space from Helm error messages
Sadly, Helm more than often ends error messages with `\n\n`. Trim this
space to ensure we produce pretty messages.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:37 +01:00
Hidde Beydals 68c273b701
controller: handle delete before adding finalizer
When an object is marked as under deletion, the API server will reject
any attempt to register new finalizers. Given this, handling the
deletion timestamp always has to come before an attempt to register
the finalizer.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:37 +01:00
Hidde Beydals 866f076d1f
reconcile: share PatchHelper with controller
This ensures they both have the same observation on the last
modifications made to the object. Preventing possible scenarios where
a condition would not be removed because it wasn't set at the start of
the reconcile run, then added, and then removed. Causing it to go
unnoticed during the diff calculation.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:36 +01:00
Hidde Beydals bbefbc4ded
reconcile: use failure count in Stalled condition
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:35 +01:00
Hidde Beydals d802ba6cc1
controllers: roughly rewire HelmRelease reconciler
This adds the base wiring to get the controller to work with the
v2beta2 API and the newly introduced packages in `internal/`.

In essence, this means that from now on the controller will utilize all
new code for the reconciliation of the HelmRelease resource.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:35 +01:00
Hidde Beydals eee91b06fa
Introduce new `yaml` package with `Encode` func
Comparison versus `sigs.k8s.io/yaml#Marshal`:

```
BenchmarkEncode/EncodeWithSort-12         	    475	  2419063 ns/op	2235305 B/op	   5398 allocs/op
BenchmarkEncode/EncodeWithSort-12         	    498	  2406794 ns/op	2235300 B/op	   5398 allocs/op
BenchmarkEncode/EncodeWithSort-12         	    492	  2376460 ns/op	2235312 B/op	   5398 allocs/op
BenchmarkEncode/EncodeWithSort-12         	    496	  2406756 ns/op	2235323 B/op	   5398 allocs/op
BenchmarkEncode/EncodeWithSort-12         	    488	  2402969 ns/op	2235336 B/op	   5398 allocs/op
BenchmarkEncode/SigYAMLMarshal-12         	    202	  5791549 ns/op	3124841 B/op	  19324 allocs/op
BenchmarkEncode/SigYAMLMarshal-12         	    205	  5780248 ns/op	3123193 B/op	  19320 allocs/op
BenchmarkEncode/SigYAMLMarshal-12         	    207	  5762621 ns/op	3124537 B/op	  19324 allocs/op
BenchmarkEncode/SigYAMLMarshal-12         	    214	  5748899 ns/op	3121183 B/op	  19324 allocs/op
BenchmarkEncode/SigYAMLMarshal-12         	    211	  5682105 ns/op	3120592 B/op	  19325 allocs/op
```

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:34 +01:00
Hidde Beydals bb4e9b7cee
Update YAMLs to `helm.toolkit.fluxcd.io/v2beta2`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:34 +01:00
Hidde Beydals deb0b14e43
api: make v2beta2 storage version
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:33 +01:00
Hidde Beydals 76f62ffc47
api: backport uninstall del propagation to v2beta2
Manual backport of the work done in #698, to keep things aligned.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:10 +01:00
Hidde Beydals 64b2d5455e
Address review comments
- Use `Unknown` status for the `TestSuccess` condition when tests
  have not been run yet.
- Update Ready summarization logic to incorportate conditions with an
  Unknown status. Within the context of readiness, this always caises
  Ready=False when the condition is included in the summarization.
- Variety of tiny fixes.
- Tiny nits in test mocks to prevent confusion.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:09 +01:00
Hidde Beydals 410ce3a00d
reconcile: include "token" in event metadata
This includes the "token" in the emitted events which is used to rate
limit events received by the notification-controller.

Either by using the already calculated config (values) digest, or by
calculating it for the current reconciliation request in scenarios
where it isn't available from made observations.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 12:06:09 +01:00
Hidde Beydals 64cc09ce5e
reconcile: test emitted events
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:08 +01:00
Hidde Beydals ea81c8e099
action: include TS in LogBuffer
This provides more context to individual log entries (and the duration
between individual log lines) while e.g. printing them in an event.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:08 +01:00
Hidde Beydals b975b3f999
reconcile: add atomic release reconciler
This commit adds an atomic release reconciler, capable of stepping
through a series of Helm actions. In addition, it adds the last bits
around eventing and summarizing the end state of the Condition types
into e.g. a Ready condition.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:07 +01:00
Hidde Beydals 479341461a
action: allow composed release name >=53 char
This solves the issue where a release name composed out of e.g.
the target namespace and name of the HelmRelease itself would exceed
the >=53 character length. By calculating the SHA256 checksum of the
release name, taking the first 12 characters of this checksum and
appending it to the release named trimmed to 40 characters separated
by a hyphen (`<long-release-name>-abcdef12345678`).

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:07 +01:00
Hidde Beydals 026fd45c2c
action: add name param to rollback and uninstall
This gives more fine-grain control over what release must be targeted,
as we do not always want to rely on the current spec but rather on e.g.
a release we have made ourselves with a previous configuration for
garbage collection purposes.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:06 +01:00
Hidde Beydals 9812286bb4
action: add `Len` method to `LogBuffer`
This allows for requesting the count of non-empty values in the ring
buffer, and thus the number of log lines.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:05 +01:00
Hidde Beydals 0b8692f61a
api: add service account name validation rule
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:05 +01:00
Hidde Beydals 9e1eedcfa4
api: various changes to support new logic
- Change the map with Helm release test hooks to a pointer map. This
  allows (in combination with the constrains around JSON serialization)
  to distinguish a release _without_ a test run from a release _with_
  test run but no tests (an empty map).
- Add `GetTestHooks` and `SetTestHooks` methods to help circumvent some
  of the common problems around working with a pointer map in Go (e.g.
  not being capable of iterating over it using range).
- Add `HasBeenTested` and `HasTestInPhase` methods to help make
  observations on captured release information.
- Add `StorageNamespace` to Status to allow for observations of
  configuration changes which are mutating compared to the spec.
- Add `GetActiveRemediation` helper method to get the active
  remediation strategy based on the presence of Current and/or Previous
  release observations in the Status of the object.
- Add `ReleaseTargetChanged` helper method to determine if an immutable
  release target changed has occurred, in which case e.g. garbage
  collection needs to happen before performing any other action.
- Add `GetCurrent`, `HasCurrent`, `GetPrevious` and `HasPrevious`
  helper methods to ease access to their values nested in the Status.
- Add `FullReleaseName` and `VersionedChartName` helper methods to e.g.
  allow printing full name references in Condition and Event messages
  which can be placed in a point in time based on metadata more
  familiar to a user than for example the observed generation.
- Change `GetFailureCount` and `RetriesExhausted` signatures of
  `Remediation` interface to take a pointer. This eases use of the API,
  as generally speaking a (Kubernetes) API object is a pointer.
- Move methods from `HelmReleaseSpec` to `HelmRelease`, this is easier
  to access and matches `GetConditions`, etc.
- Remove `DeploymentAction` interface and `GetDescription` from
  `Remediation` interface as this is no longer of value.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:04 +01:00
Jiri Tyr 8cefed19fd
Adding tests
Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
2023-11-20 12:06:04 +01:00
Jiri Tyr e1393542a7
Fixing typo
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: Jiri Tyr <jtyr@users.noreply.github.com>
2023-11-20 12:06:03 +01:00
Jiri Tyr 88a21fecbf
Moving stuff from runner; removing changes in v2beta1
Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
2023-11-20 12:06:03 +01:00
Jiri Tyr 6db62ed507
Adding test filters
Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
2023-11-20 12:06:02 +01:00
Hidde Beydals 5843cc2ef0
action: allow passing of config options
This to allow the Flux CLI to e.g. enable the dry-run flag on an action
outside of the HelmRelease spec, and inject other (user input based)
modifications.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:02 +01:00
Hidde Beydals 220e789481
Allow detection of next reconcile action
This provides a rough (but not flawless) outline for determining the
sub-reconciler which should run based on the state of the `HelmRelease`
API object, and the Helm storage.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:01 +01:00
Hidde Beydals d9055f81b8
Add reconcile logic for individual Helm actions
This adds a `reconcile` package with the reconciliation and (status)
observation logic for individual Helm actions, but no glue to loop
through them till desired state.

All actions have individual `ActionReconciler` implementations which
construct their `action.Configuration` out of a factory, so the Helm
client can be shared between sub-reconcilers. They all present a
`ReconcilerType`, allowing an iterator to e.g. stop after running
every type just once.

The observation model can be explained as follows, but may lack some
minor details:

- The observed release has to match the release target of the
  HelmRelease object
- ActionReconcilers of type "release" move Current to Previous
  when they see a higher release revision. They then write the
  new release to Current, and continue to observe writes to
  revisions that match either version
- Remediation only updates Current
- Test updates Current and Current.TestHooks
- Unlock updates Current

After running the action, the reconcilers observe both the action
result and the state of the object. This allows them to distinguish
certain types of errors which are otherwise hard to detect.
For example, errors which do not cause drift to the Helm storage, or a
change of release version compared to Current for actions which do not
provide a version target flag.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:01 +01:00
Hidde Beydals dfebba2783
Add `ObservedRelease` and other release utils
This adds a `release` package which allows to create (minified)
`ObservedRelease` copy of a Helm release object. This
`ObservedRelease` contains sufficient data to detect changes
to the storage object made by Helm actions run manually, and a variety
of malicious changes (but not all, at present).

The data in an `ObservedRelease` can be filtered using a `DataFilter`,
this allows for example to filter out test hooks to prevent the
controller from taking action on a manually run `helm test`.

The consumer can combine the `ObservedRelease` with a Helm storage
observer to take snapshots of the release object as written to the
storage by a Helm action. To record this on a `HelmRelease` v2beta2 API
object, the `ObservedRelease` can be transformed into a
`HelmReleaseInfo` API object which can be recorded as either the
Current or Previous release in the status.

During the transformation, the digests of both the `ObservedRelease`
object and release config are calculated using the canonical algorithm.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:00 +01:00
Hidde Beydals 89a6f497e5
Run individual Helm actions using HelmRelease
This commit introduces an `action` package which allows the consumer to
run Helm actions using the instructions from a `HelmRelease` v2beta2
API object.

The actions do not determine if there is a desire be run, nor do they
record state on the object. This can however be injected by the caller
using the simplified observing Helm storage driver, which now iterates
over a list of callback functions after persisting an object instead
of keeping state.

This separation of concerns would allow e.g. the Flux CLI later on
to run actions (but with a dry-run flag or different storage
configuration) using the object in the same manner as the controller.

Some minor changes have been made to the `postrender` and `runner`
package to allow the code to co-exist while we are inbetween API
versions.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:05:57 +01:00
Hidde Beydals 14e08f791f
api: introduce v2beta2 API
This is an initial introduction, and still subject to changes. The
storage version is still configured to v2beta1. This allows low
level packages to already work with the new object data, but keeps
it away from the reconciler for now.

The changes mainly focus around removing the helper methods from the
API, and to enrich the status object with more data about the current
and previous revision. With the goal to deprecate all `LastAttempted*`
and `LastApplied*` fields, as this data is now available in `Current`
and `Previous`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:02:42 +01:00
Hidde Beydals 730ccec91f
Move post renderers into separate package
Plus change the tests a tiny bit to work with Gomega, and break the
further API free from direct attachment to our Helm API objects.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:02:41 +01:00
Hidde Beydals c99b00d885
Move predicates into package and add tests
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:02:41 +01:00
Hidde Beydals 0140eeeea9
Factor various bits out of reconciler
This commit moves various generic bits out of the reconciler into
separate modules, while adding more test coverage.

Some of the logic around merging chart values from references has been
improved to work with `client.Object`, instead of two separate maps.

In addition, the option to override the hostname of an Artifact has
been removed. It was undocumented and for testing purposes only, which
these days can be better achieved by e.g. configuring the
`--storage-adv-addr`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:02:40 +01:00
Hidde Beydals fe661df9d7
Move HelmChart handling to separate reconciler
This moves the HelmChart template handling to a separate reconciler,
with predicates detecing relevant changes. The idea is that this would
both facilitate working _without_ chart templates but with references
in the future, and to reduce cognitive load while working with
reconciler logic.

The predicate uses `DeepEqual` from `k8s.io/apimachinery/pkg/api/equality`
to inspect the Chart template objects of the old and new HelmRelease
object in the update event.

The reconciler uses server-side apply to create or update the HelmChart
on the cluster, and emits an event based on the change set of the
action. It does not produce any diff yet, as the server-side apply
library at present does not provide a way to gain access to an "old"
versus "new" objects after performing an apply. The `diff` package
has however been prepared to allow diffing Unstructured objects.

As this reconciler has a separate life-cycle, a new
`chart.finalizers.fluxcd.io` finalizer has been introduced to ensure
a HelmChart is properly garbage collected before the HelmRelease is
allowed to be deleted.

The implementation on the release reconciler's end is a rough sketch,
but in working shape. The foresight is that much of the reconciler will
change when the release logic will be adjusted to work with the earlier
introduced storage observer.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:02:40 +01:00
Hidde Beydals e82d389107
helm/storage: add observator and implementation
This adds an observer which wraps around a Helm storage driver, to keep
track of the release metadata as written to the storage. This enables
you to work with, and compare release data as persisted by Helm.
Without having to rely on the result as returned by the Helm SDK. Which
at times of an error, may differ from last written state.

The observer does at present expect to be watching a single namespace,
and was designed without working with multiple releases simultianiously
into account, although this should theoretically still work.

The releases are at stored in a simple map by index storage key, which
are unique to the namespace. The `ObservedRelease` objects the keys hold are
overwritten on sequential writes to the same release object, and
returned by getter methods as deep copies.

This could theoretically be changed to observing e.g. all writes, I have
left this as a refinement TODO while actually implementing it in the
reconciler. The same goes for the included metadata, which might be not
all relevant.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:02:39 +01:00
Hidde Beydals d068542f80
Merge pull request #812 from fluxcd/update-docker
Update github.com/docker/docker to 24.0.7
2023-11-20 10:31:36 +01:00
Hidde Beydals 67b0500e8c
Update github.com/docker/docker to 24.0.7
This includes an update of `oras.land/oras-go` to `v1.2.4` due to
otherwise incompatible signature changes.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-20 10:07:45 +01:00
Stefan Prodan fc5562bd84
Merge pull request #811 from fluxcd/dependabot/github_actions/ci-4c0557044b
build(deps): bump the ci group with 2 updates
2023-11-20 08:57:38 +02:00
dependabot[bot] 64d70b1ded
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [docker/build-push-action](https://github.com/docker/build-push-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/build-push-action` from 5.0.0 to 5.1.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](0565240e2d...4a13e500e5)

Updates `github/codeql-action` from 2.22.5 to 2.22.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](74483a38d3...66b90a5db1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 03:25:15 +00:00
Stefan Prodan d7cb41bf92
Merge pull request #808 from fluxcd/dependabot/github_actions/ci-da8bbba46e
build(deps): bump the ci group with 2 updates
2023-11-16 10:39:12 +02:00
dependabot[bot] a96d1e0bb3
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer).


Updates `korthout/backport-action` from 2.1.0 to 2.1.1
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](cb79e4e5f4...08bafb375e)

Updates `sigstore/cosign-installer` from 3.1.2 to 3.2.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](11086d2504...1fc5bd396d)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 04:01:40 +00:00
Max Jonas Werner 472244bced
Merge pull request #802 from fluxcd/dependabot/github_actions/ci-18c09be9f8
build(deps): bump the ci group with 1 update
2023-11-06 07:37:46 +01:00
dependabot[bot] 3ad60071c1
build(deps): bump the ci group with 1 update
Bumps the ci group with 1 update: [korthout/backport-action](https://github.com/korthout/backport-action).

- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](408fae11ed...cb79e4e5f4)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 03:47:44 +00:00
Stefan Prodan 3c02fb7877
Merge pull request #800 from fluxcd/dependabot/github_actions/ci-266d728e8a
build(deps): bump the ci group with 2 updates
2023-10-30 08:30:45 +02:00
dependabot[bot] 61790bfed0
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `korthout/backport-action` from 1.4.0 to 2.0.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](bd68141f07...408fae11ed)

Updates `github/codeql-action` from 2.22.4 to 2.22.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](49abf0ba24...74483a38d3)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 03:38:09 +00:00
Hidde Beydals a6b0da79d4
Merge pull request #799 from fluxcd/dependabot/go_modules/google.golang.org/grpc-1.56.3
build(deps): bump google.golang.org/grpc from 1.53.0 to 1.56.3
2023-10-27 23:07:45 +02:00
dependabot[bot] 019b463628
build(deps): bump google.golang.org/grpc from 1.53.0 to 1.56.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 22:27:58 +00:00
Max Jonas Werner 3de410111d
Merge pull request #797 from fluxcd/dependabot/github_actions/ci-ff180a8d58
build(deps): bump the ci group with 2 updates
2023-10-23 08:51:52 +02:00
dependabot[bot] ef1662e822
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.0 to 4.1.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8ade135a41...b4ffde65f4)

Updates `github/codeql-action` from 2.22.3 to 2.22.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0116bc2df5...49abf0ba24)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 03:52:12 +00:00
Hidde Beydals 69ab175e0b
Merge pull request #795 from fluxcd/dependabot/github_actions/ci-24b5ea99f0
build(deps): bump the ci group with 1 update
2023-10-16 13:39:08 +02:00
dependabot[bot] 8fb5973b20
build(deps): bump the ci group with 1 update
Bumps the ci group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2cb752a87e...0116bc2df5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 03:09:36 +00:00
Hidde Beydals 93f8191252
Merge pull request #793 from fluxcd/update-source-controller-yamls
Update source-controller to v1.1.2
2023-10-13 11:04:46 +02:00
souleb 25654ca290
Update kustomization.yaml
Signed-off-by: souleb <bah.soule@gmail.com>
2023-10-13 09:50:54 +02:00
Hidde Beydals 87c3ccc6cf
Merge pull request #791 from fluxcd/dependabot/go_modules/api/golang.org/x/net-0.17.0
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /api
2023-10-12 09:12:34 +02:00
dependabot[bot] b74ca9758e
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /api
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-12 06:48:32 +00:00
Hidde Beydals 7258f967bb
Merge pull request #792 from fluxcd/dependabot/go_modules/golang.org/x/net-0.17.0
build(deps): bump golang.org/x/net from 0.13.0 to 0.17.0
2023-10-12 08:47:38 +02:00
dependabot[bot] 522afcb14a
build(deps): bump golang.org/x/net from 0.13.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.13.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.13.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 23:03:36 +00:00
Hidde Beydals 7f3d5141f9
Merge pull request #790 from fluxcd/release-v0.36.2
Release v0.36.2
2023-10-11 14:42:57 +02:00
Hidde Beydals a3f636ad38
Release v0.36.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-11 13:34:56 +02:00
Hidde Beydals d5777188e2
Merge pull request #788 from fluxcd/tidy-nits 2023-10-11 12:35:28 +02:00
Hidde Beydals 9739e60625
misc: handle unhandled errors
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:43:13 +02:00
Hidde Beydals f054ff5853
misc: fix hypothetical implicit memory aliasing
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:43:13 +02:00
Hidde Beydals 6575eff5cc
misc: `.../kustomize/api/filesys` deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:43:09 +02:00
Hidde Beydals 58afcba1b7
misc: remove unused code
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:05:40 +02:00
Hidde Beydals aa2f6dd3be
misc: remove redundant use of `fmt.Sprintf`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:03:28 +02:00
Hidde Beydals 08d3674e5a
misc: use `time.Since` instead of `time.Now().Sub`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:02:42 +02:00
Hidde Beydals 5854286c82
misc: properly use `fmt.Errorf` and wrap errs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 10:01:39 +02:00
Hidde Beydals 58d3608c9a
misc: remove redundant returns
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 09:59:26 +02:00
Hidde Beydals 61bf78379d
misc: `fake.NewFakeClientWithScheme` deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-10 09:58:26 +02:00
Hidde Beydals ca17176cd3
Merge pull request #786 from fluxcd/dependabot/github_actions/ci-438070d785
build(deps): bump the ci group with 1 update
2023-10-09 08:52:28 +02:00
dependabot[bot] 26b6d504b2
build(deps): bump the ci group with 1 update
Bumps the ci group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ddccb87388...2cb752a87e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 03:53:56 +00:00
Stefan Prodan 0c31fd395c
Merge pull request #785 from fluxcd/speed-up-recovery
fix: Retry failed releases when charts are available in storage
2023-10-04 14:00:17 +03:00
Stefan Prodan bd3ec35697
Retry failed releases when charts are available in storage
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-10-04 11:03:07 +03:00
Hidde Beydals 0a0cfc1479
Merge pull request #783 from fluxcd/dependabot/github_actions/ci-6df34c0ca7
build(deps): bump the ci group with 2 updates
2023-10-02 10:30:07 +02:00
dependabot[bot] 8ae42b5a9c
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](3df4ab11eb...8ade135a41)

Updates `github/codeql-action` from 2.21.7 to 2.21.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](04daf014b5...ddccb87388)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 03:44:43 +00:00
Hidde Beydals ff03616814
Merge pull request #781 from fluxcd/fix-crd-trace-labels 2023-09-29 18:37:52 +02:00
Hidde Beydals 2fc506d47c
runner: ensure CRDs are properly labeled
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-29 16:03:39 +02:00
Hidde Beydals 39fd287f73
Merge pull request #777 from yiannistri/patch-1
fix: Typo
2023-09-20 10:54:49 +02:00
Yiannis Triantafyllopoulos c41062d888
fix: Typo
Signed-off-by: Yiannis Triantafyllopoulos <8741709+yiannistri@users.noreply.github.com>
2023-09-20 09:39:09 +01:00
Hidde Beydals 9059faff35
Merge pull request #776 from fluxcd/release-v0.36.1
Release v0.36.1
2023-09-18 16:59:09 +02:00
Hidde Beydals 79384d29b7
Release v0.36.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-18 16:35:30 +02:00
Hidde Beydals a5e912e573
Merge pull request #775 from fluxcd/update-sc
Update source-controller to v1.1.1
2023-09-18 16:21:44 +02:00
Hidde Beydals 6c7e1f1d61
Update source-controller to v1.1.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-18 16:06:17 +02:00
Hidde Beydals b1d3ad38f8
Merge pull request #774 from fluxcd/fix-differ-sa
controller: use `DefaultServiceAccount` in differ
2023-09-18 13:20:46 +02:00
Hidde Beydals 2465cb43bd
controller: use `DefaultServiceAccount` in differ
This addresses an issue in which the defunct `DefaultServiceAccount`
from the `HelmReleaseReconciler` was being used to construct the
impersonator used by the differ.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-18 12:54:08 +02:00
Stefan Prodan 6240012e89
Merge pull request #773 from fluxcd/dependabot/github_actions/ci-c0c365b2b0
build(deps): bump the ci group with 7 updates
2023-09-18 09:29:10 +03:00
dependabot[bot] a330425ce1
build(deps): bump the ci group with 7 updates
Bumps the ci group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `2.2.0` | `3.0.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `2.10.0` | `3.0.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `4.2.1` | `5.0.0` |
| [docker/login-action](https://github.com/docker/login-action) | `2.2.0` | `3.0.0` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `4.6.0` | `5.0.0` |
| [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | `4.6.0` | `5.0.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `2.21.5` | `2.21.7` |


Updates `docker/setup-qemu-action` from 2.2.0 to 3.0.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](2b82ce82d5...68827325e0)

Updates `docker/setup-buildx-action` from 2.10.0 to 3.0.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](885d1462b8...f95db51fdd)

Updates `docker/build-push-action` from 4.2.1 to 5.0.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](0a97817b6a...0565240e2d)

Updates `docker/login-action` from 2.2.0 to 3.0.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](465a07811f...343f7c4344)

Updates `docker/metadata-action` from 4.6.0 to 5.0.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](818d4b7b91...96383f4557)

Updates `goreleaser/goreleaser-action` from 4.6.0 to 5.0.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](5fdedb94ab...7ec5c2b0c6)

Updates `github/codeql-action` from 2.21.5 to 2.21.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](00e563ead9...04daf014b5)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 03:23:46 +00:00
Hidde Beydals c94ee3b545
Merge pull request #767 from fluxcd/fix-captured-logs-regression
runner: address regression in captured Helm logs
2023-09-11 17:13:00 +02:00
Hidde Beydals 1aa739028d
controller: strip newlines from Helm error message
To prevent spurious newlines between the error message and the captured
logs, as at times Helm ends error with one or multiple newlines.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-11 16:57:54 +02:00
Hidde Beydals eb3a4b84cd
runner: address regression in captured Helm logs
This addresses a regression in the Helm log capturing introduced in
3b25041385, which prevented valuable
information from the Kube client logs (e.g. the specific reason for a
timeout) to be added to the event emitted in case of a failure.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-11 16:57:45 +02:00
Hidde Beydals 394ab5a1e2
Merge pull request #768 from somtochiama/nil-artifac
Check source for nil artifact before loading chart
2023-09-11 16:16:12 +02:00
Somtochi Onyekwere c1d77ad952 check for nil artifact before loading chart
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-09-11 14:59:24 +01:00
Hidde Beydals 9fa5cf7b31
Merge pull request #766 from fluxcd/dependabot/github_actions/ci-dbfd6c86b4
build(deps): bump the ci group with 4 updates
2023-09-11 12:48:26 +02:00
dependabot[bot] c62827e5f8
build(deps): bump the ci group with 4 updates
Bumps the ci group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [actions/cache](https://github.com/actions/cache), [docker/build-push-action](https://github.com/docker/build-push-action) and [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action).


Updates `actions/checkout` from 3.6.0 to 4.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](f43a0e5ff2...3df4ab11eb)

Updates `actions/cache` from 3.3.1 to 3.3.2
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](88522ab9f3...704facf57e)

Updates `docker/build-push-action` from 4.1.1 to 4.2.1
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](2eb1c1961a...0a97817b6a)

Updates `goreleaser/goreleaser-action` from 4.4.0 to 4.6.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](3fa32b8bb5...5fdedb94ab)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 03:24:14 +00:00
Stefan Prodan 4d6a191251
Merge pull request #764 from fluxcd/dependabot/go_modules/github.com/cyphar/filepath-securejoin-0.2.4
build(deps): bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4
2023-09-08 20:15:26 +03:00
dependabot[bot] 5cd24b8616
build(deps): bump github.com/cyphar/filepath-securejoin
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 13:01:05 +00:00
Max Jonas Werner dcec6902c8
Merge pull request #762 from fluxcd/dependabot/github_actions/ci-83603f3c9b
build(deps): bump the ci group with 3 updates
2023-09-04 09:23:07 +02:00
dependabot[bot] b454b2065a
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/setup-buildx-action` from 2.9.1 to 2.10.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](4c0219f9ac...885d1462b8)

Updates `sigstore/cosign-installer` from 3.1.1 to 3.1.2
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](6e04d228eb...11086d2504)

Updates `github/codeql-action` from 2.21.4 to 2.21.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](a09933a12a...00e563ead9)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 03:39:55 +00:00
Max Jonas Werner 61cd88bf96
Merge pull request #761 from fluxcd/dependabot/github_actions/ci-17ac1b16d8
build(deps): bump the ci group with 2 updates
2023-08-28 07:36:51 +02:00
dependabot[bot] eeaf441863
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator).


Updates `actions/checkout` from 3.5.3 to 3.6.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](c85c95e3d7...f43a0e5ff2)

Updates `slsa-framework/slsa-github-generator` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 03:28:23 +00:00
Hidde Beydals a3ad78491b
Merge pull request #759 from fluxcd/release-v0.36.0
Release v0.36.0
2023-08-23 14:22:53 +02:00
Hidde Beydals 855222689e
Release v0.36.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-23 13:56:51 +02:00
Stefan Prodan 5d7f20a28b
Merge pull request #758 from fluxcd/sc-1.1.0
Update Source API to v1.1.0
2023-08-23 14:38:13 +03:00
Stefan Prodan 4c60760b61
Update Source API to v1.1.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-23 14:21:46 +03:00
Max Jonas Werner cc354a375a
Merge pull request #757 from fluxcd/dependabot/github_actions/ci-71339bc865
build(deps): bump the ci group with 2 updates
2023-08-21 06:32:07 +02:00
dependabot[bot] 820c03f83f
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `korthout/backport-action` from 1.3.1 to 1.4.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](bf5fdd624b...bd68141f07)

Updates `github/codeql-action` from 2.21.3 to 2.21.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5b6282e01c...a09933a12a)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 03:55:58 +00:00
Stefan Prodan a8c15d3700
Merge pull request #753 from fluxcd/stale-metrics
Delete stale metrics on object delete
2023-08-15 11:45:14 +03:00
Sunny 74e33a70c4 Delete stale metrics on object delete
Use the metrics helper to record all the metrics. Metrics helpers
ensures that the metrics for deleted objects are deleted as well.

Move all the metrics recording to be performed at the very end of the
reconciliation. Realtime metrics for readiness is no longer recorded as
it will be removed in a future version for CRD metrics collected using
kube-state-metrics. Updating the object status with realtime readiness
should provide the readiness to CRD metrics watchers.

`HelmReleaseReconciler.reconcileDelete()` is modified to receive a
pointer HelmRelease object so that any modifications on the object is
reflected on the object instance that's passed to the metrics recorder.
This is not needed for `HelmReleaseReconciler.reconcile()` as it returns
a new copy of the object that's saved in the same object variable,
overwriting the object instance with the updates.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-08-15 02:42:09 +05:30
Max Jonas Werner 0fac91289b
Merge pull request #755 from fluxcd/dependabot/github_actions/ci-d093c87be1
build(deps): bump the ci group with 3 updates
2023-08-14 08:59:00 +02:00
dependabot[bot] 089cf60b7a
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [actions/setup-go](https://github.com/actions/setup-go), [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/setup-go` from 4.0.1 to 4.1.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](fac708d667...93397bea11)

Updates `goreleaser/goreleaser-action` from 4.3.0 to 4.4.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](336e29918d...3fa32b8bb5)

Updates `github/codeql-action` from 2.21.2 to 2.21.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0ba4244466...5b6282e01c)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 04:04:45 +00:00
Hidde Beydals 98a5a518a1
Merge pull request #754 from fluxcd/update-helm
Update Helm to v3.12.3
2023-08-11 16:12:18 +02:00
Hidde Beydals e5755398d2
Update Helm to v3.12.3
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-11 15:50:16 +02:00
Hidde Beydals d2e8641a58
Merge pull request #751 from fluxcd/jitter 2023-08-09 21:31:36 +02:00
Hidde Beydals d76f3a355b
controller: jitter requeue interval
This adds a `--interval-jitter-percentage` flag to the controller to
add a +/- percentage jitter to the interval defined in a HelmRelease
(defaults to 5%).

Effectively, this results in a reconciliation every 9.5 - 10.5 minutes
for a resource with an interval of 10 minutes.

Main reason to add this change is to mitigate spikes in memory and
CPU usage caused by many resources being configured with the same
interval.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-09 17:50:43 +02:00
Hidde Beydals 3a98126200
Merge pull request #750 from fluxcd/dependabot/go_modules/github.com/docker/docker-23.0.3incompatible
build(deps): bump github.com/docker/docker from 23.0.1+incompatible to 23.0.3+incompatible
2023-08-09 14:28:58 +02:00
dependabot[bot] 7919b79eb8
build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.1+incompatible to 23.0.3+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v23.0.1...v23.0.3)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 11:53:42 +00:00
Hidde Beydals b494e01256
Merge pull request #748 from fluxcd/update-deps
Update dependencies
2023-08-09 13:52:42 +02:00
Hidde Beydals 376ae96ede
Update dependencies
- github.com/fluxcd/pkg/apis/event to v0.5.2
- github.com/fluxcd/pkg/apis/meta to v1.1.2
- github.com/fluxcd/pkg/runtime to v0.41.0
- github.com/fluxcd/pkg/ssa to v0.30.0
- github.com/fluxcd/source-controller/api to v1.0.1
- github.com/onsi/gomega to v1.27.10
- github.com/opencontainers/go-digest/blake3 to v0.0.0-20230801144141-122dc6384261
- helm.sh/helm/v3 to v3.12.2
- k8s.io/api to v0.27.4
- k8s.io/apiextensions-apiserver to v0.27.4
- k8s.io/apimachinery to v0.27.4
- k8s.io/cli-runtime to v0.27.4
- k8s.io/client-go to v0.27.4
- sigs.k8s.io/cli-utils to v0.35.0
- sigs.k8s.io/controller-runtime to v0.15.1

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-09 13:30:52 +02:00
Hidde Beydals c339f55ec3
api: update dependencies
- github.com/fluxcd/pkg/apis/meta to v1.1.2
- k8s.io/apiextensions-apiserver to v0.27.4
- k8s.io/apimachinery to v0.27.4
- sigs.k8s.io/controller-runtime to v0.15.1

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-09 13:30:52 +02:00
Hidde Beydals adc9963dbd
Merge pull request #749 from fluxcd/enable-codeql-quality
ci: enable security-and-quality CodeQL query
2023-08-09 13:30:34 +02:00
Hidde Beydals f3af7cf9b5
ci: enable security-and-quality CodeQL query
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-09 13:06:12 +02:00
Max Jonas Werner 6cb0d99ec3
Merge pull request #747 from fluxcd/dependabot/github_actions/ci-94766044f6
build(deps): bump the ci group with 2 updates
2023-08-07 12:18:02 +02:00
dependabot[bot] 9990de19b1
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `slsa-framework/slsa-github-generator` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.7.0...v1.8.0)

Updates `github/codeql-action` from 2.20.4 to 2.21.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](489225d82a...0ba4244466)

---
updated-dependencies:
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 03:16:10 +00:00
Max Jonas Werner 70eba092a5
Merge pull request #741 from fluxcd/align-docs-layout
Align docs structure with other controllers
2023-07-29 16:39:23 +02:00
Max Jonas Werner 726edec9a6
Align docs structure with other controllers
In some controller we already support multiple API versions at the
same time. In order to streamline the docs structure, the necessary
changes to do the same in this repo are applied here as well.

refs fluxcd/website#1577

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-07-21 17:04:33 +02:00
Stefan Prodan dbc98e9509
Merge pull request #737 from fluxcd/dependabot/github_actions/ci-ebccb0496f
build(deps): bump the ci group with 3 updates
2023-07-17 16:36:24 +03:00
dependabot[bot] 0e0e1d9a5c
build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [helm/kind-action](https://github.com/helm/kind-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/setup-buildx-action` from 2.9.0 to 2.9.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](2a1a44ac4a...4c0219f9ac)

Updates `helm/kind-action` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](fa81e57adf...dda0770415)

Updates `github/codeql-action` from 2.20.3 to 2.20.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](46ed16ded9...489225d82a)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 13:20:16 +00:00
Stefan Prodan f9a20634be
Merge pull request #736 from carlossg/patch-1
chore: fix typo reconcilation
2023-07-17 16:15:48 +03:00
Carlos Sanchez ee3f232fd8
chore: fix typo reconcilation
Signed-off-by: Carlos Sanchez <carlos@apache.org>
2023-07-14 19:22:25 +02:00
Max Jonas Werner 04c6980e89
Merge pull request #735 from fluxcd/dependabot/github_actions/ci-00c9c485c6
build(deps): bump the ci group with 2 updates
2023-07-10 08:46:21 +02:00
dependabot[bot] d15ac509ed
build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/setup-buildx-action` from 2.8.0 to 2.9.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](16c0bc4a6e...2a1a44ac4a)

Updates `github/codeql-action` from 2.20.1 to 2.20.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f6e388ebf0...46ed16ded9)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 03:20:34 +00:00
Stefan Prodan a63ff82a9d
Merge pull request #734 from fluxcd/gha-backport-workflow-perms
Fix GHA backport.yaml workflow job perms
2023-07-06 11:52:53 +03:00
Aurel Canciu 7362278013
Explicitly echo -E in GHA release.yml
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2023-07-06 09:48:20 +02:00
Aurel Canciu cdc8e290e8
Fix GHA backport.yaml workflow job perms
Fixing backport workflow permissions.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2023-07-06 09:26:05 +02:00
Hidde Beydals 630ae514c3
Merge pull request #732 from fluxcd/group-dependabot-updates
ci: group Dependabot GitHub Action updates
2023-07-04 12:54:42 +02:00
Hidde Beydals 85adb5b672
ci: group Dependabot GitHub Action updates
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 12:39:54 +02:00
Hidde Beydals fde7958ad1
Merge pull request #731 from fluxcd/ci-backport-bot-token
ci: use bot token for backport
2023-07-04 12:39:47 +02:00
Hidde Beydals 2c6fb56117
ci: use bot token for backport
This allows GitHub Action workflows to be triggered for the PR created
by the bot.

As things are now triggered by the bot, elevated permissions of the
workflow itself are no longer required.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 12:29:48 +02:00
Hidde Beydals 56e36da8c1
Merge pull request #728 from fluxcd/release-v0.35.0
Release v0.35.0
2023-07-04 10:54:14 +02:00
Hidde Beydals 818c7a0b28
Release v0.35.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 10:36:07 +02:00
Hidde Beydals 558de2adfe
Merge pull request #730 from fluxcd/ci-update-k8s
ci: update Kubernetes to v1.27.3
2023-07-04 10:35:58 +02:00
Hidde Beydals 4a46bc5306
ci: update Kubernetes to v1.27.3
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 10:21:36 +02:00
Hidde Beydals 46d9fccdca
Merge pull request #729 from fluxcd/update-sc
Update source-controller to v1.0.0
2023-07-04 10:21:27 +02:00
Hidde Beydals 21f2ff7b28
Update source-controller to v1.0.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 10:03:36 +02:00
Hidde Beydals f7c7023fb4
Merge pull request #727 from fluxcd/ci-release-workflows
ci: various workflow changes
2023-07-04 09:41:58 +02:00
Hidde Beydals eae26eedcc
ci: enable workflows for `release/**` branches
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 09:31:11 +02:00
Hidde Beydals fad5a0a143
ci: change release workflow dispatch tag
From "rc" (reserved for tag releases) to "preview".

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 09:31:10 +02:00
Hidde Beydals e8387dfe63
Merge pull request #726 from fluxcd/update-go-deps
Update Go dependencies
2023-07-03 15:21:17 +02:00
Hidde Beydals 46839c347c
Update Go dependencies
- github.com/fluxcd/pkg/apis/event v0.5.0 -> v0.5.1
- github.com/fluxcd/pkg/runtime v0.38.1 -> v0.40.0
- github.com/fluxcd/pkg/ssa v0.28.1 -> v0.28.2
- github.com/hashicorp/go-retryablehttp v0.7.2 -> v0.7.4
- github.com/onsi/gomega v1.27.7 -> v1.27.8
- github.com/opencontainers/go-digest/blake3 v0.0.0-20230329235805-65fac7b55eb7 -> v0.0.0-20230529151907-63939eb433f7
- helm.sh/helm/v3 v3.12.0 -> v3.12.1
- k8s.io/api v0.27.2 -> v0.27.3
- k8s.io/apiextensions-apiserver v0.27.2 -> v0.27.3
- k8s.io/apimachinery v0.27.2 -> v0.27.3
- k8s.io/cli-runtime v0.27.2 -> v0.27.3
- k8s.io/client-go v0.27.2 -> v0.27.3

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 14:43:42 +02:00
Hidde Beydals 6073640d9d
api: update Go dependencies
- github.com/fluxcd/pkg/apis/kustomize v1.1.0 -> v1.1.1
- github.com/fluxcd/pkg/apis/meta v1.1.0 -> v1.1.1
- k8s.io/apiextensions-apiserver v0.27.2 -> v0.27.3
- k8s.io/apimachinery v0.27.2 -> v0.27.3

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 14:41:57 +02:00
Hidde Beydals cf6245a1e9
Merge pull request #725 from fluxcd/ci-bump-kind
ci: update kind to v0.19.0
2023-07-03 14:41:53 +02:00
Hidde Beydals f58c94bc64
ci: update kind to v0.19.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 14:30:43 +02:00
Hidde Beydals 9c2090dd2a
Merge pull request #698 from hoffimar/deletionPropagation
Set deletion propagation for helm uninstall
2023-06-30 22:34:36 +02:00
Martin Hoffmann d656cb3994 Update helmreleases.md
Signed-off-by: Martin Hoffmann <hoffimar@gmail.com>
2023-06-30 19:30:57 +02:00
Martin Hoffmann 79e4b9a099 Set deletion propagation for helm uninstall
Signed-off-by: Martin Hoffmann <martin.hoffmann01@sap.com>
Signed-off-by: Martin Hoffmann <hoffimar@gmail.com>
2023-06-30 19:30:57 +02:00
Hidde Beydals be3868edcb
Merge pull request #723 from fluxcd/dependabot/github_actions/docker/setup-qemu-action-2.2.0 2023-06-30 18:55:30 +02:00
dependabot[bot] ca70ea0c19
build(deps): bump docker/setup-qemu-action from 2.1.0 to 2.2.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2.1.0...2b82ce82d56a2a04d2637cd93a637ae1b359c0a7)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 15:59:07 +00:00
Hidde Beydals ad06794b57
Merge pull request #722 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-3.1.1 2023-06-30 17:58:29 +02:00
dependabot[bot] af0c00f52d
build(deps): bump sigstore/cosign-installer from 3.0.5 to 3.1.1
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.0.5 to 3.1.1.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](dd6b2e2b61...6e04d228eb)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 15:31:10 +00:00
Stefan Prodan ada601390a
Merge pull request #721 from fluxcd/dependabot/github_actions/anchore/sbom-action-0.14.3
build(deps): bump anchore/sbom-action from 0.14.2 to 0.14.3
2023-06-30 18:30:32 +03:00
dependabot[bot] 4bcc6617c6
build(deps): bump anchore/sbom-action from 0.14.2 to 0.14.3
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.14.2 to 0.14.3.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](4d571ad103...78fc58e266)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 14:36:21 +00:00
Hidde Beydals eb604a6f0f
Merge pull request #724 from fluxcd/fix-label-descriptions
Change label descriptions to be uniform
2023-06-30 16:10:38 +02:00
Hidde Beydals de15997d19
Change label descriptions to be inform
Signed-off-by: Hidde Beydals <hiddeco@users.noreply.github.com>
2023-06-30 16:01:59 +02:00
Hidde Beydals c0d550646e
Merge pull request #720 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.8.0
build(deps): bump docker/setup-buildx-action from 2.7.0 to 2.8.0
2023-06-30 15:57:05 +02:00
dependabot[bot] 1fffbb87fc
build(deps): bump docker/setup-buildx-action from 2.7.0 to 2.8.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](ecf95283f0...16c0bc4a6e)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 13:42:12 +00:00
Hidde Beydals 2578f10bee
Merge pull request #719 from fluxcd/dependabot/github_actions/helm/kind-action-1.7.0
build(deps): bump helm/kind-action from 1.5.0 to 1.7.0
2023-06-30 15:41:29 +02:00
dependabot[bot] 2302c05469
build(deps): bump helm/kind-action from 1.5.0 to 1.7.0
Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.5.0 to 1.7.0.
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](d8ccf8fb62...fa81e57adf)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 13:17:29 +00:00
Hidde Beydals 356eb05575
Merge pull request #718 from fluxcd/backport-automation
Add backport GitHub Action workflow
2023-06-30 15:16:52 +02:00
Hidde Beydals 915db7a4a2
Declaratively define (and sync) labels
This adds a GitHub Action workflow to sync the labels from a YAML file
in `.github/labels.yaml`, in combination with fetching the standard
labels from `fluxcd/community`.

In terms of colors, I am still trying to figure out what looks best.
But this should be a good start to at least kick things off.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-06-30 15:05:56 +02:00
Hidde Beydals 2dba8cf617
Add backport GitHub Action workflow
This workflow automatically backports pull requests labeled with
`backport:<release series branch>`.

For example, `backport:release/v1.0.x` to backport the pull request
to a `release/v1.0.x` branch.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-06-30 15:05:56 +02:00
Stefan Prodan c23b145114
Merge pull request #715 from fluxcd/go.mod-1.20
Align `go.mod` version with Kubernetes (Go 1.20)
2023-06-27 10:51:11 +03:00
Stefan Prodan baf3150a6c
Align go.mod version with Kubernetes (Go 1.20)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-27 10:18:25 +03:00
Hidde Beydals 60090cc288
Merge pull request #712 from fluxcd/dependabot/github_actions/actions/setup-go-4.0.1
build(deps): bump actions/setup-go from 4.0.0 to 4.0.1
2023-06-26 13:04:58 +02:00
dependabot[bot] c1671e5703
build(deps): bump actions/setup-go from 4.0.0 to 4.0.1
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](4d34df0c23...fac708d667)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 10:40:01 +00:00
Hidde Beydals 02caed94bd
Merge pull request #711 from fluxcd/dependabot/github_actions/github/codeql-action-2.20.1
build(deps): bump github/codeql-action from 2.2.7 to 2.20.1
2023-06-26 12:39:25 +02:00
dependabot[bot] 7c60e07955
build(deps): bump github/codeql-action from 2.2.7 to 2.20.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.7 to 2.20.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](168b99b3c2...f6e388ebf0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 10:20:53 +00:00
Max Jonas Werner 23c774fc1d
Merge pull request #709 from fluxcd/dependabot/github_actions/actions/checkout-3.5.3
build(deps): bump actions/checkout from 3.4.0 to 3.5.3
2023-06-26 12:20:16 +02:00
dependabot[bot] 24847670f6
build(deps): bump actions/checkout from 3.4.0 to 3.5.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.4.0...c85c95e3d7251135ab7dc9ce3241c5835cc595a9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 10:06:14 +00:00
Max Jonas Werner 4a479bda9b
Merge pull request #710 from fluxcd/dependabot/github_actions/docker/build-push-action-4.1.1
build(deps): bump docker/build-push-action from 4.0.0 to 4.1.1
2023-06-26 12:02:27 +02:00
dependabot[bot] 91ccc172fb
build(deps): bump docker/build-push-action from 4.0.0 to 4.1.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...2eb1c1961a95fc15694676618e422e8ba1d63825)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 09:53:03 +00:00
Hidde Beydals 889eb2089b
Merge pull request #708 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.7.0
build(deps): bump docker/setup-buildx-action from 2.5.0 to 2.7.0
2023-06-26 11:52:22 +02:00
dependabot[bot] 4cee62a405
build(deps): bump docker/setup-buildx-action from 2.5.0 to 2.7.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.5.0 to 2.7.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.5.0...ecf95283f03858871ff00b787d79c419715afc34)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 09:38:52 +00:00
Hidde Beydals 153b92bf8e
Merge pull request #714 from fluxcd/scan-disable-snyk
scan: disable Snyk
2023-06-26 11:38:18 +02:00
Hidde Beydals d32864ceba
scan: disable Snyk
To align with other controller projects.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-06-26 11:21:20 +02:00
Stefan Prodan 5866b8a239
Merge pull request #707 from fluxcd/dependabot
Enable Dependabot for GH Actions
2023-06-22 15:13:02 +03:00
Stefan Prodan c182695280
Disable goreleaser changelog
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-22 14:59:51 +03:00
Stefan Prodan e752ea5a2e
Enable Dependabot for GH Actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-22 14:58:48 +03:00
Stefan Prodan 06979867d5
Merge pull request #706 from fluxcd/release-v0.34.2
Release v0.34.2
2023-06-22 14:05:44 +03:00
Stefan Prodan 75d1f8e7c0
Release v0.34.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-22 13:50:31 +03:00
Stefan Prodan c09a1cf234
Merge pull request #705 from fluxcd/slsa3
Add SLSA3 generators to release workflow
2023-06-22 13:40:52 +03:00
Stefan Prodan eb4e63e815
Add SLSA3 generators to release workflow
Generate SLSA level 3 provenance attestations for the controller release assets and for the multi-arch container images.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-22 13:14:01 +03:00
Aurel Canciu 053a20f32c
Merge pull request #703 from fluxcd/fix-hr-reconcile-loop
Fix HelmRelease reconciliation loop
2023-06-20 14:14:11 +02:00
Aurel Canciu 7c75fc4d3d
Fix HelmRelease reconciliation loop
Likely after the upgrade to controller-runtime v0.15.0 a regression
surfaced for long-running reconciliations of HelmRelease resources (e.g.
for charts having pre-upgrade hooks taking a few minutes to complete).
This regression would cause the controller to immediately re-run the
upgrade after a successful upgrade, thus entering an almost-endless
loop.

Apparently, the only fix to this issue is to ensure
`.Status.LastReleaseRevision` is updated as soon as possible in the
reconiliation cycle rather than wait for the update at the end of the
cycle.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2023-06-20 14:52:50 +03:00
Hidde Beydals d267907aab
Merge pull request #697 from fluxcd/release-0.34.1
Release v0.34.1
2023-06-01 11:41:44 +02:00
Hidde Beydals 8d6af3e809
Release v0.34.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-06-01 11:24:57 +02:00
Hidde Beydals 6417e181d6
Merge pull request #696 from fluxcd/bump-sc
Bump source-controller to v1.0.0-rc.5
2023-06-01 11:06:25 +02:00
Max Jonas Werner f66845ea3c
bump source-controller
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-01 10:46:43 +02:00
Hidde Beydals c61a0983a5
Merge pull request #695 from fluxcd/event-meta-token
Include revision and token in event metadata
2023-05-31 13:31:06 +02:00
Hidde Beydals 2ea7393629
Include revision and token in event metadata
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-31 13:01:50 +02:00
Stefan Prodan ea11c68303
Merge pull request #694 from fluxcd/release-v0.34.0
Release v0.34.0
2023-05-29 11:41:44 +03:00
Sanskar Jaiswal 17b03891f7
Release v0.34.0
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-05-29 13:51:19 +05:30
Hidde Beydals 560bb55573
Merge pull request #693 from fluxcd/update-source-controller
Update source-controller to v1.0.0-rc.4
2023-05-26 15:48:23 +02:00
Hidde Beydals 564a188a7f
Update source-controller to v1.0.0-rc.4
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-26 14:59:28 +02:00
Hidde Beydals cb4da0f2a7
Merge pull request #692 from fluxcd/event-meta-token
Use last attempted values checksum as event metadata token
2023-05-24 15:32:16 +02:00
Hidde Beydals 4df753a1f1
Use last attempted values checksum as event metadata token
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 14:23:11 +02:00
Hidde Beydals 9250364430
Merge pull request #691 from fluxcd/no-tini
Remove the tini supervisor, and other nits
2023-05-24 11:21:09 +02:00
Hidde Beydals c29360a5e1
Update controller-gen to v0.12.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 11:05:53 +02:00
Hidde Beydals d345af0e73
Rename controllers to controller
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 11:05:53 +02:00
Hidde Beydals ba7edbdfe9
Remove the tini supervisor
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 11:05:53 +02:00
Hidde Beydals e546364a5b
Merge pull request #690 from fluxcd/update-ctrl-runtime-kus
Update Kubernetes, controller-runtime and Helm
2023-05-24 10:55:46 +02:00
Hidde Beydals 2ba28c6d9e
Update Kubernetes, controller-runtime and Helm
This commit updates Kubernetes to v1.27, controller-runtime to
v0.15, and Helm to v3.12.

It deals with various breaking changes in controller-runtime, as
documented in the release notes:
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0

In short:

- `Watches` now use a `client.Object` instead of a `source.Kind`.
- `handler.MapFunc` signature accepts a Go context, which is used to
  log any errors, instead of silently ignoring them and/or panicking.
- Max concurrent reconciles is configured on the manager, instead of
  configuring them per reconciler instance.
- Various manager configuration options have been moved to new
  structures and/or fields.

In addition to this, all other dependencies which had updates
available are updated to their latest versions as well.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 10:39:51 +02:00
Hidde Beydals e8e2d41461
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v1.1.0
- github.com/fluxcd/pkg/apis/meta to v1.1.0
- k8s.io/apiextensions-apiserver to v0.27.2
- k8s.io/apimachinery to v0.27.2
- sigs.k8s.io/controller-runtime to v0.15.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 09:44:30 +02:00
Hidde Beydals 74bc32e840
Merge pull request #688 from fluxcd/release-0.33.0
Release v0.33.0
2023-05-12 13:31:43 +02:00
Hidde Beydals c692d0cf36
Release v0.33.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-12 13:10:33 +02:00
Hidde Beydals dc4a9d0a5e
Merge pull request #687 from fluxcd/update-deps
Update dependencies
2023-05-12 13:04:21 +02:00
Hidde Beydals 2c686b7c23
Update indirect dependencies
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-12 12:47:39 +02:00
Hidde Beydals 618a7b1837
Update source-controller to v1.0.0-rc.3
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-12 12:31:16 +02:00
Stefan Prodan 795fdab997
Merge pull request #686 from fluxcd/dependabot/go_modules/github.com/docker/distribution-2.8.2incompatible
build(deps): bump github.com/docker/distribution from 2.8.1+incompatible to 2.8.2+incompatible
2023-05-12 08:59:09 +03:00
dependabot[bot] 2a750eda0d
build(deps): bump github.com/docker/distribution
Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](https://github.com/docker/distribution/compare/v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-11 20:47:51 +00:00
Hidde Beydals 3f2a1252a2
Merge pull request #684 from longquan0104/bugfix/checksum-chart-values-order-on-key-value
Stable sort release values by key
2023-05-11 12:52:19 +02:00
longquan0104 30b131ab1c
Stable sort release values by key
This commit changes the way the checksum is calculated for the release
values, by stable sorting the keys. By doing this, an upgrade will not
be triggered when a key/value pair has just been moved, instead of
containing a real change of value.

To make it backwards compatible (and without triggering an upgrade due
to new ordering), the checksum without ordering is continued to be
calculated and compared against until removal in a future controller
release. However, only the checksum of the ordered values is taken note
of in the Status of the HelmRelease.

Co-authored-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: longquan0104 <longquan0104@gmail.com>
2023-05-11 10:17:52 +02:00
Hidde Beydals 2d1dbc1111
Merge pull request #685 from onedr0p/patch-1
Update Alpine to 3.18
2023-05-10 17:10:10 +02:00
Devin Buhl 8a9a892f0d
Update Alpine to 3.18
This change would be nice to get in because MUSL finally implemented TCP fallback in their DNS resolver.

alpinelinux.org/posts/Alpine-3.18.0-released.html

Signed-off-by: Devin Buhl <onedr0p@users.noreply.github.com>
2023-05-10 09:26:50 -04:00
Hidde Beydals d1cc2fea6e
Merge pull request #674 from fluxcd/release-0.32.2
Release v0.32.2
2023-04-13 10:51:32 +02:00
Hidde Beydals 5c02db72bf
Release v0.32.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-04-13 10:32:14 +02:00
Hidde Beydals 53c461f478
Merge pull request #673 from fluxcd/update-helm
Update Helm to v3.11.3
2023-04-12 22:51:50 +02:00
Hidde Beydals d1c9e7c3ce
Update Helm to v3.11.3
This includes multiple (two) fixes for Go routine leaks.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-04-12 21:41:10 +02:00
Hidde Beydals 464a084bd0
Merge pull request #668 from fluxcd/dependabot/go_modules/github.com/docker/docker-20.10.24incompatible
build(deps): bump github.com/docker/docker from 20.10.21+incompatible to 20.10.24+incompatible
2023-04-12 12:24:43 +02:00
dependabot[bot] 724090517e
build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.21+incompatible to 20.10.24+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v20.10.21...v20.10.24)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-12 10:09:07 +00:00
Hidde Beydals 96a17efdef
Merge pull request #672 from fluxcd/fix-drift-nil-deref
Fix nil pointer deref during diff attempt
2023-04-12 12:04:32 +02:00
Hidde Beydals 32b5d7ec1b
Fix nil pointer deref during diff attempt
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-04-12 11:41:12 +02:00
Sunny 8448b1dec1
Merge pull request #666 from fluxcd/release-0.32.1
Release v0.32.1
2023-04-03 20:51:16 +05:30
Sunny 692a6f545b
Release v0.32.1
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-04-03 20:23:12 +05:30
Sunny 527ab97156
Merge pull request #665 from fluxcd/fix-chart-meta
Fix chart metadata by making it truly optional
2023-04-03 20:09:34 +05:30
Stefan Prodan 18ed296944
Fix chart metadata by making it truly optional
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-03 17:22:50 +03:00
Hidde Beydals ce30d393ff
Merge pull request #663 from fluxcd/release-0.32.0
Release v0.32.0
2023-03-31 16:05:16 +02:00
Hidde Beydals a9ba5975a6
Release v0.32.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-31 15:51:51 +02:00
Hidde Beydals d471d7dae2
Merge pull request #662 from fluxcd/misc-nit-picks
config/*: update API versions and file names
2023-03-31 14:30:49 +02:00
Hidde Beydals 2f7c18653a
config/*: update podinfo to 6.x.x
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-31 14:15:58 +02:00
Hidde Beydals 799c542390
config/testdata: update Source API versions
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-31 14:06:27 +02:00
Hidde Beydals 3f0c283a86
config/samples: update API versions and file names
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-31 14:05:01 +02:00
Hidde Beydals 336c5c6c37
Merge pull request #661 from fluxcd/update-deps 2023-03-31 10:07:39 +02:00
Hidde Beydals 2de972cb8f
Update to source-controller v1.0.0-rc.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-31 09:37:28 +02:00
Hidde Beydals bba569c1f9
Update dependencies
- github.com/fluxcd/pkg/ssa to v0.27.0
- github.com/go-logr/logr to v1.2.4
- github.com/onsi/gomega to v1.27.6

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-30 16:32:00 +02:00
Hidde Beydals 4009fb6484
Merge pull request #659 from fluxcd/flag-persistent-client 2023-03-30 16:30:55 +02:00
Hidde Beydals c93b3afe16
controllers: propagate `PersistentClient` value
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-30 16:14:15 +02:00
Hidde Beydals 6f85ca58d7
kube: make persistent client opt-in configuration
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-30 16:14:15 +02:00
Hidde Beydals 3f65b45e4a
api: add `PersistentClient` flag to allow control
This adds a `PersistentClient` flag which should be consumed by the
controller while initializing the Kubernetes client used by Helm
actions.

This to allow the controller to work with certain charts which do
require a client which does not persist, as they create Custom Resource
Definitions on demand during e.g. install, which then later aren't
observed by Helm as it does not reset the REST mapper between successive
action steps.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-30 16:14:15 +02:00
Hidde Beydals 6f0fd5f97e
Merge pull request #660 from fluxcd/update-patch-logic
controllers: update status patch logic
2023-03-30 16:12:06 +02:00
Hidde Beydals ad21e7e3c8
controllers: update status patch logic
Hotfix to deal with the issue, as we will soon be moving to the patch
logic used by already rewritten controllers. This is however a pain for
many users, so worth solving now.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-30 15:42:39 +02:00
Hidde Beydals acf0cda03d
Merge pull request #658 from fluxcd/watch-label-selector 2023-03-29 15:55:08 +02:00
Hidde Beydals 08925bc282
Add reconciler sharding capability based on label
With this enhancement, the controller can be configured with
`--watch-label-selector`, after which only objects with this label will
be reconciled by the controller.

This allows for horizontal scaling of the helm-controller, where each
controller can be deployed multiple times with a unique label selector
which is used as the sharding key.

Note that if you want to ensure a `HelmChart` gets created for a
specific source-controller instance, you have to provide the labels for
this controller in `.spec.chart.metadata.labels` of the `HelmRelease`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-29 15:37:53 +02:00
Hidde Beydals 5a1c5138de
Merge pull request #631 from raffis/feat-chart-metadata
feat: manage label and annotations for a helmchart
2023-03-29 15:18:50 +02:00
Hidde Beydals a72a2fc6ca
misc: tidy HelmChart annotation and labels feat
- Assing `ObjectMeta` field in Helm chart template.
- Ensure things are at least lightly mentioned in spec documentation.
- Add two simple test cases.
- Fix broken links to Kubernetes documentation.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-29 14:32:13 +02:00
Raffael Sahli 2cc2fee410 feat: manage label and annotations for a helmchart
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-03-29 14:18:40 +02:00
Hidde Beydals af59329782
Merge pull request #654 from fluxcd/update-deps
Update dependencies
2023-03-27 18:54:28 +02:00
Hidde Beydals fed54db7e8
Update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v1.0.0
- github.com/fluxcd/pkg/apis/meta to v1.0.0
- github.com/fluxcd/pkg/runtime to v0.33.0
- github.com/fluxcd/pkg/ssa to v0.26.0
- github.com/onsi/gomega to v1.27.5
- helm.sh/helm/v3 to v3.11.2
- k8s.io/api to v0.26.3
- k8s.io/apiextensions-apiserver to v0.26.3
- k8s.io/apimachinery to v0.26.3
- k8s.io/cli-runtime to v0.26.3
- k8s.io/client-go to v0.26.3

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-27 18:37:15 +02:00
Hidde Beydals a12fd2aa93
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v1.0.0
- github.com/fluxcd/pkg/apis/meta to v1.0.0
- k8s.io/apiextensions-apiserver to v0.26.3
- k8s.io/apimachinery to v0.26.3

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-27 18:36:30 +02:00
Hidde Beydals 0d47c9cf1d
Merge pull request #653 from fluxcd/internal-controllers
Move `controllers` to `internal/controllers`
2023-03-27 17:36:25 +02:00
Hidde Beydals 3615feef2a
Move `controllers` to `internal/controllers`
There is no good reason for it to be exposed and available through a
public API, and this follows the new kubebuilder defaults.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-27 17:25:31 +02:00
Hidde Beydals 4ad3b21b08
Merge pull request #651 from fluxcd/artifact-verify-digest
Verify Digest of Artifact
2023-03-27 16:21:47 +02:00
Hidde Beydals 6cd6980669
controllers: Verify Digest of Artifact
This commit changes the verification to the `Digest` field of the
Artifact, which was introduced in source-controller v0.35.0. As the
`Checksum` is expected to be removed in the next release of the
source-controller.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-27 10:06:09 +02:00
Hidde Beydals 88a3beabd8
Merge pull request #650 from fluxcd/release-0.31.2
Release v0.31.2
2023-03-20 17:19:57 +01:00
Hidde Beydals 7da5454a4f
Release v0.31.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 17:02:18 +01:00
Hidde Beydals 204d6145b3
Merge pull request #649 from fluxcd/update-deps
Update dependencies
2023-03-20 16:56:03 +01:00
Hidde Beydals bf33e89ae8
Update dependencies
- github.com/fluxcd/pkg/runtime to v0.32.0
- github.com/fluxcd/pkg/ssa to v0.25.0
- github.com/fluxcd/source-controller/api to v0.36.1
- github.com/onsi/gomega to v1.27.4

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 16:42:15 +01:00
Hidde Beydals 6d588967f3
Merge pull request #647 from fluxcd/allow-drift-diff-only
Allow opt-out of drift correction
2023-03-20 13:24:54 +01:00
Hidde Beydals 46add221d5
spec: document `CorrectDrift` feature gate
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 13:07:08 +01:00
Hidde Beydals 0b8b92ba64
Allow opt-out of drift correction
This enhances the drift detection to allow detection without acting on
it by adding a `CorrectDrift` feature gate. When set to `false` (i.e.
`--feature-gates=DetectDrift=true,CorrectDrift=false`), the controller
will only log the difference it detected without acting on it.

This allows for a smoother transition to drift detection, as issues
with a number of existing releases can be solved before the feature
is enabled in full.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 13:07:08 +01:00
Hidde Beydals ad9a3f90ca
Merge pull request #648 from fluxcd/update-workflows
Update workflows
2023-03-20 12:25:39 +01:00
Hidde Beydals 18602b8325
build: update scan workflow
- Update actions to their latest versions.
- Use SHA to (potentially) allow enabling Dependabot.
- Add Go Modules caching using  `actions/setup-go` (supported since
  >=v3).
- Add `--all-projects` flag to `snyk`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 10:59:34 +01:00
Hidde Beydals 52dd8a0124
build: update release workflow
- Update actions to their latest versions.
- Use SHA to (potentially) allow enabling Dependabot.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 10:50:47 +01:00
Hidde Beydals 00a67711ca
build: update nightly action
- Update actions to their latest versions.
- Use SHA to (potentially) allow enabling Dependabot.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 10:47:23 +01:00
Hidde Beydals 5de7973242
build: update e2e workflow
- Update actions to their latest versions.
- Use SHA to (potentially) allow enabling Dependabot.
- Move Go Modules caching responsibility to `actions/setup-go`
  (supported since >=v3).

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 10:46:03 +01:00
Hidde Beydals b4d647afd6
build: update cifuzz workflow
- Update actions to their latest versions.
- Use SHA to (potentially) allow enabling Dependabot.
- Move caching responsibility to `actions/setup-go` (supported since
  >=v3).

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 10:42:00 +01:00
Hidde Beydals b807af38b6
Merge pull request #642 from fluxcd/release-0.31.1
Release v0.31.1
2023-03-10 15:46:50 +01:00
Hidde Beydals 2290e274df
Release v0.31.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-10 15:31:51 +01:00
Hidde Beydals 99f6339f07
Merge pull request #641 from fluxcd/improve-cgroup-discovery
oomwatch: auto detect well known cgroup paths
2023-03-10 15:27:04 +01:00
Hidde Beydals b732420f26
oomwatch: auto detect well known cgroup paths
This commit adds support for recognizing cgroup v1 paths, and allows for
the configuration of alternative absolute path locations using
`--oom-watch-max-memory-path` and `--oom-watch-current-memory-path`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-10 15:08:17 +01:00
Hidde Beydals 629cd0682d
Merge pull request #639 from fluxcd/drift-detection-heading
spec: change drift detection heading
2023-03-09 18:41:57 +01:00
Hidde Beydals 7973dea5bb
spec: change drift detection heading
Signed-off-by: Hidde Beydals <hiddeco@users.noreply.github.com>
2023-03-09 18:28:54 +01:00
Hidde Beydals 45a712a6db
Merge pull request #637 from fluxcd/fix-changelog-heading
Fix sub-header of v0.31.0 changelog
2023-03-08 17:26:37 +01:00
Hidde Beydals c7de861635
Fix sub-header of v0.31.0 changelog
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 17:04:02 +01:00
Hidde Beydals 3e310a8a3c
Merge pull request #636 from fluxcd/release-0.31.0
Release v0.31.0
2023-03-08 17:00:35 +01:00
Hidde Beydals 4c7c04c78d
Release v0.31.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 16:46:43 +01:00
Hidde Beydals 732df6154b
Merge pull request #635 from fluxcd/fix-release-update-sc-deps
Update source-controller to v0.36.0
2023-03-08 15:35:08 +01:00
Hidde Beydals ef569c3e17
Update source-controller to v0.36.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 15:15:08 +01:00
Hidde Beydals 13eeb6429b
release: pass `--yes` to cosign in signs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 13:48:41 +01:00
Hidde Beydals a26a041dd7
Merge pull request #633 from fluxcd/runtime-logger-klog 2023-03-08 01:21:01 +01:00
Hidde Beydals 3cb5b5c934
Use `logger.SetLogger` to also configure `klog`
This uses the newly introduced helper from runtime, which also
configures the logger for `klog`.

Resulting in all logs now being properly formatted, even when logged by
internal Kubernetes elements like the leader election or a dynamic
client.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 00:26:27 +01:00
Hidde Beydals 834b9286de
Merge pull request #634 from fluxcd/update-release-workflow
build: update release workflow
2023-03-08 00:25:47 +01:00
Hidde Beydals 2a75c33205
build: update scan workflow
- fossa-contrib/fossa-action to v2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 18:45:59 +01:00
Hidde Beydals 75fbb909c9
build: update nightly workflow
- docker/build-push-action to v4
- Drop `platforms` from `docker/setup-qemu-action` step, as this is
  the default.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 18:42:57 +01:00
Hidde Beydals 12dcf4a513
build: update release workflow
- docker/build-push-action to v4
- sigstore/cosign-installer to v3
- goreleaser/goreleaser-action to v4

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 18:42:20 +01:00
Hidde Beydals 352b7f2c2c
Merge pull request #628 from fluxcd/oom-watcher
Introduce OOM watcher to allow graceful shutdown
2023-03-07 10:57:11 +01:00
Hidde Beydals c4566a5459
oomwatch: small tweaks
- Change memory usage percent threshold to `uint8` to no longer allow
  fractions.
- Validate interval to prevent configurations `<50ms`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 10:39:31 +01:00
Hidde Beydals cceb71d56e
oomwatch: add test coverage
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 10:39:31 +01:00
Hidde Beydals 62456c94ff
Add OOM watcher to allow graceful shutdown
This commit introduces an OOM watcher, which can be enabled using
`--feature-gates=OOMWatch=true`. The OOM watcher watches the current
memory usage as reported by cgroups via `memory.current` and cancels
the context when it reaches a certain threshold compared to
`memory.max` (default `95`%, configurable using
`--oom-watch-memory-threshold`).

This allows ongoing Helm processes to gracefully exit with a failure
before the controller is forcefully OOM killed, preventing a deadlock
of releases in a pending state.

The OOM watcher polls the `memory.current` file on an interval (default
`500ms`, configurable using `--oom-watch-interval`), as subscribing to
file updates using inotify is not possible for cgroups (v2) except for
`*.events` files. Which does provide signals using `memory.events`, but
these will generally be too late for our use case. As for example `high`
equals `max` in most containers, buying us little time to gracefully
stop our processes.

In addition, because we simply watch current usage compared to max
usage in bytes. This approach should work for cgroups v1 as well, given
this has (most of the time) files for these values available, albeit
at times at different locations. For which this commit does not
introduce a flag yet, but the library takes into account that it could
be configured at some point.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 10:39:19 +01:00
Hidde Beydals 154000e583
Merge pull request #630 from fluxcd/kube-improvements 2023-03-07 10:09:21 +01:00
Hidde Beydals b68592c4cb
runner: reset RESTMapper after CRD change
As otherwise with a persistent discovery client and/or REST mapper
configuration, newly installed CRDs will not be recognized and cause a
`resource mapping not found for name` error.

In addition, remove the `ServerGroups` and `Invalidate` calls. As this
is later done (again) by Helm when gathering server capabilities.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-06 16:54:48 +01:00
Hidde Beydals 34d87ccc24
kube: unify clients into single RESTClientGetter
This drops the twofold implementation in favor of a single
`MemoryRESTClientGetter` which can work with an arbitrary `rest.Config`.

The new `MemoryRESTClientGetter` lazy-loads and caches the objects it
initializes, thereby creating at most one instance of each object for
the duration of the reconcile of a single `HelmRelease` object.

Based on some initial tests, this seems to reduce the overal memory
footprint of the controller.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-06 11:21:18 +01:00
Hidde Beydals 90a03d05f6
Merge pull request #627 from fluxcd/update-xx
Update tonistiigi/xx to 1.2.1
2023-03-02 17:48:22 +01:00
Hidde Beydals 043dad959c
Update tonistiigi/xx to 1.2.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 17:00:55 +01:00
Hidde Beydals 7d3904f035
Merge pull request #626 from fluxcd/update-deps
Update dependencies
2023-03-02 16:00:59 +01:00
Hidde Beydals f803e222bf
e2e: increase timeout on delete-ns test
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 15:45:28 +01:00
Hidde Beydals 344717a292
Update dependencies
- github.com/fluxcd/pkg/apis/event to v0.4.1
- github.com/fluxcd/pkg/apis/kustomize to v0.8.1
- github.com/fluxcd/pkg/apis/meta to v0.19.1
- github.com/fluxcd/pkg/runtime to v0.30.0
- sigs.k8s.io/controller-runtime to v0.14.5
- github.com/containerd/containerd to v1.6.18

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 14:42:54 +01:00
Hidde Beydals 8becd60cbd
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v0.8.1
- github.com/fluxcd/pkg/apis/meta to v0.19.1
- sigs.k8s.io/controller-runtime to v0.14.5

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 14:41:32 +01:00
Hidde Beydals 1f5c565123
Merge pull request #623 from aryan9600/sa-check
check if service account exists before uninstalling release
2023-03-02 14:41:10 +01:00
Sanskar Jaiswal 5dbdbd1299 check if service account exists before uninstalling release
Check if the service account to be impersonated actually exists
and proceed with uninstalling the Helm release only if it does.
Otherwise, skip uninstalling the release and carry on with finalization.
Add an e2e test to check if deleting a namespace with the RBAC and
HelmRelease succeeds with the namespace being fully deleted.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-03-02 18:13:26 +05:30
Hidde Beydals 8d7b650a22
Merge pull request #625 from fluxcd/helm-log-levels
runner: configure Helm action cfg log levels
2023-03-02 10:22:41 +01:00
Hidde Beydals c277c4b800
runner: simplify DebugLog wrapper
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 10:01:09 +01:00
Hidde Beydals 3b25041385
runner: configure Helm action cfg log levels
This reduces the amount of log lines pushed to `debug` by configuring the kube
client and storage loggers to only log to `trace`.

In addition, the log buffer used in events will now just contain the
most relevant information about a failure as reported by the Helm action
itself, and not the in-depth information from the underlying client
and/or storage.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 09:58:35 +01:00
Hidde Beydals 877c4c7d39
Merge pull request #624 from fluxcd/build-go-1.20
build: update to Go 1.20
2023-03-01 16:05:04 +01:00
Hidde Beydals f1a270aefb
build: update to Go 1.20
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 15:52:08 +01:00
Hidde Beydals 78117fccc1
Merge pull request #621 from fluxcd/allow-dns-lookups
helm: enable DNS with AllowDNSLookups feature gate
2023-03-01 15:51:41 +01:00
Hidde Beydals f24cf9dc83
helm: enable DNS with AllowDNSLookups feature gate
This allows install and upgrade actions to use DNS lookups while
rendering Helm templates after it got disabled in Helm due to possible
security risks.

It is enabled (globally) on the controller by configuring
`--feature-gates=AllowDNSLookups=true`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:55:13 +01:00
Hidde Beydals 9abcdd6a41
Merge pull request #622 from fluxcd/update-deps
Update dependencies
2023-03-01 13:54:24 +01:00
Hidde Beydals 9d3fd3d83b
Update dependencies
- github.com/fluxcd/source-controller/api to v0.35.2
- github.com/onsi/gomega to v1.27.2
- k8s.io/api to v0.26.2
- k8s.io/apiextensions-apiserver to v0.26.2
- k8s.io/apimachinery to v0.26.2
- k8s.io/cli-runtime to v0.26.2
- k8s.io/client-go to v0.26.2
- k8s.io/utils to v0.0.0-20230220204549-a5ecb0141aa5
- Unpin github.com/emicklei/go-restful as it is no longer an (indirect)
  dependency.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:38:03 +01:00
Hidde Beydals 87044ba4a0
api: update dependencies
- k8s.io/apiextensions-apiserver v0.26.2
- k8s.io/apimachinery v0.26.2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:30:37 +01:00
Hidde Beydals 788115965a
Merge pull request #617 from fluxcd/detect-drift
Experimental support of drift detection
2023-03-01 13:17:33 +01:00
Hidde Beydals 38ea587370
Change to `helm.toolkit.fluxcd.io/driftDetection`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:04:13 +01:00
Hidde Beydals ff07f52dee
docs: enrich drift detection docs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:04:12 +01:00
Hidde Beydals 8389593288
diff: prettify premature diff log
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 10:27:46 +01:00
Hidde Beydals 9153649f23
diff: add premature diff debug log
As there are currently no other utilities to properly see what change
the controller detected, this allows people to have an insight into
the observed changes by configuring the controller with
`--log-level=debug`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 10:25:07 +01:00
Hidde Beydals 8c4b2885b2
docs: document experimental drift detection
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Hidde Beydals c93e5e1908
diff: additional test cases
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Hidde Beydals b7d8244496
diff: allow exclusion of specific objects
This allows a specific object from a release manifest to be excluded
from drift detection by labeling or annotating it with:
`helm.toolkit.fluxcd.io/diff: disabled`.

Using a Kustomize post renderer definition in a HelmRelease, this can
be used to ignore any object from an arbitrary chart.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Hidde Beydals 1240f20183
Enable experimental drift detection
This enables experimental drift detection of cluster state compared to
the current manifest data from the Helm storage's manifest blob.

Drift detection works based on the already proven approach of the
kustomize-controller's SSA package, and utilizes the managed field
configured by the controller since `v0.12.2`.

This feature is planned to go out of experimental once the further
controller rewrite has been finished, and the state of the Helm storage
itself is more fault tolerant.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Hidde Beydals 16ce900b20
api: switch to `meta.KubeConfigReference`
This is backwards compatible, as it only changes the type without the
further requirements around the YAML declaration.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Hidde Beydals d5dd5a91c8
Merge pull request #620 from fluxcd/helm-action-ctx
helm: propagate context to install and upgrade
2023-02-27 15:13:19 +01:00
Hidde Beydals 8a9ba1c12c
helm: propagate context to install and upgrade
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-02-27 10:32:44 +01:00
Hidde Beydals 5f465cf7d8
Merge pull request #614 from fluxcd/fix-snyk
ci: Fix Snyk code scanning
2023-02-17 13:10:29 +01:00
Stefan Prodan 4c58aa8da2
ci: Fix Snyk code scanning
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-17 12:56:03 +02:00
Hidde Beydals 41f530928c
Merge pull request #613 from fluxcd/release-0.30.0
Release v0.30.0
2023-02-17 10:49:14 +01:00
Hidde Beydals 2e52949426 Release v0.30.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 10:34:53 +01:00
Hidde Beydals f8ea4505d7
Merge pull request #612 from fluxcd/update-deps
Update source-controller to v0.35.1
2023-02-17 10:05:13 +01:00
Hidde Beydals 43e7fbef7b Update source-controller to v0.35.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 09:41:47 +01:00
Hidde Beydals 67a096d5f4
Merge pull request #610 from fluxcd/update-deps
Update dependencies
2023-02-16 18:47:33 +01:00
Hidde Beydals db7ce7e695 Update controller API build tooling
- Update both to their latest versions
- Introduce version variables

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 17:54:51 +01:00
Hidde Beydals db286fe8c7 Update dependencies
- github.com/fluxcd/pkg/apis/event to v0.4.0
- github.com/fluxcd/pkg/runtime to v0.29.0
- helm.sh/helm/v3 to v3.11.1
- k8s.io/utils to v0.0.0-20230209194617-a36077c30491
- github.com/containerd/containerd to v1.6.18

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 17:54:51 +01:00
Hidde Beydals 8aedb5de24 api: update dependencies
- sigs.k8s.io/controller-runtime to v0.14.4
- Unpin golang.org/x/text from v0.4.0 to allow update to v0.5.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 17:49:08 +01:00
Hidde Beydals 2d2c9aaed8
Merge pull request #606 from fluxcd/digest-revision-fmt
Support RFC-0005 revision format
2023-02-16 17:47:02 +01:00
Hidde Beydals 8b3edfd7b9 Support RFC-0005 revision format
This updates all the comparisons to make use of `HasRevision` which
supports the RFC-0005 and legacy revision formats.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 17:10:08 +01:00
Hidde Beydals 16fd8f9420
Merge pull request #598 from fluxcd/release-0.29.0
Release v0.29.0
2023-02-01 15:14:35 +00:00
Hidde Beydals fff787d60b Release v0.29.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-01 15:02:45 +00:00
Hidde Beydals b0a9e77ace
Merge pull request #597 from fluxcd/update-deps
Update source-controller to v0.34.0
2023-02-01 14:45:10 +00:00
Hidde Beydals 6a7949951e Update source-controller to v0.34.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-01 14:28:11 +00:00
Hidde Beydals 60a6b5390e
Merge pull request #596 from fluxcd/label-crds
Patch CRDs with origin labels
2023-02-01 09:26:05 +00:00
Hidde Beydals 362a27173e Patch CRDs with origin labels
This allows the applied CRDs to be traced using the same labels as
currently applied to resources using a Kustomize post-render.

Kustomize is not used here as the apply logic for CRDs is different
from the approach used during releasing, where we inject the labels
in such a way that they are written back to the Helm storage in the
rendered manifest. This to match Helm's logic from which our present
code is already derived (buth with support for policies).

This also moves the full responsibility of dealing with the install
of CRDs to ourselves, as we no longer fall back to Helm's logic when
`Create` is configured as a policy during a Helm install. As this
would not allow us to add the labels.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-01-31 15:09:21 +00:00
Hidde Beydals e47b08e039
Merge pull request #595 from fluxcd/kube-1.26
Update dependencies
2023-01-31 15:09:06 +00:00
Stefan Prodan 7b19e37eb8
Update dependencies
- helm.sh/helm/v3 v3.11.0
- k8s.io/* v0.26.1
- sigs.k8s.io/controller-runtime v0.14.2
- github.com/fluxcd/pkg/runtime v0.27.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-31 16:51:15 +02:00
Stefan Prodan 1e49ba6ee7
Merge pull request #594 from fluxcd/docker-sbom
build: Enable SBOM and SLSA Provenance
2023-01-30 16:09:45 +02:00
Stefan Prodan 8f1592aab5
build: Enable SBOM and SLSA Provenance
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-30 15:57:30 +02:00
Stefan Prodan d4e1033dfc
Update Alpine to v3.17
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-30 15:53:25 +02:00
Stefan Prodan 6f0b7cdc76
Merge pull request #585 from fluxcd/release-v0.28.1
Release v0.28.1
2022-12-22 15:23:51 +02:00
Aurel Canciu 57d715f5ef
Release v0.28.1
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-12-22 14:12:33 +01:00
Aurel Canciu b3185d4c17
Merge pull request #584 from fluxcd/adjust-graceful-shutdown-default-timeout
Align graceful-shutdown-timeout with terminationGracePeriodSeconds
2022-12-22 13:49:25 +01:00
Aurel Canciu 9875909496
e2e: Update Kubernetes to v1.23.13
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-12-22 09:06:23 +01:00
Aurel Canciu d2b52dece8
Align graceful-shutdown-timeout with terminationGracePeriodSeconds
Setting the default value for the graceful-shutdown-timeout flag to
match the default terminationGracePeriodSeconds value we set for the
controller pod container.
It seems the controller-runtime does not support passing -1 as a value
to skip the timeout as documented here:
https://github.com/kubernetes-sigs/controller-runtime/blob/v0.13.1/pkg/manager/manager.go#L286

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-12-21 19:11:27 +01:00
Hidde Beydals 6f0773d131
Merge pull request #583 from fluxcd/release-0.28.0
Release v0.28.0
2022-12-20 15:57:34 +00:00
Hidde Beydals ef3a0b45b2 Release v0.28.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-20 15:41:59 +00:00
Hidde Beydals 39412cdf7b
Merge pull request #582 from fluxcd/default-shutdown-value
Set `--graceful-shutdown-timeout` default to `-1`
2022-12-20 15:20:47 +00:00
Hidde Beydals 2e96c92918 Set `--graceful-shutdown-timeout` default to `-1`
This is the correct default value as intended in #570.

xref: 92234b3c49/pkg/manager/manager.go (L292-L293)

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-20 15:07:42 +00:00
Hidde Beydals 25f86bfa97
Merge pull request #581 from fluxcd/update-sc
Update source-controller and dependencies
2022-12-20 15:01:06 +00:00
Hidde Beydals e139ca63ec Update dependencies
- github.com/onsi/gomega to v1.24.2

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-20 14:39:56 +00:00
Hidde Beydals 261b5acbf3 Update source-controller to v0.33.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-20 14:39:56 +00:00
Hidde Beydals 2b49090c05
Merge pull request #564 from stoetti/main
assign the value of 'DisableOpenApiValidation' from the HelmRelease
2022-12-20 14:39:43 +00:00
stoetti 5ea57b72ee assign the value of 'DisableOpenApiValidation' from the HelmRelease-resource to the helm-command 2022-12-20 14:22:27 +00:00
Hidde Beydals 19b00a3759
Merge pull request #513 from mac-chaffee/no-cache-secrets
Disable caching of secrets and configmaps
2022-12-20 10:11:43 +00:00
Mac Chaffee 9bcf125e2c
Disable caching of secrets and configmaps by default.
You can re-enabled caching of secrets by starting the
controller with the argument '--feature-gates=CacheSecretsAndConfigMaps=true'

Signed-off-by: Mac Chaffee <machaffe@renci.org>
2022-12-19 09:53:01 -05:00
Hidde Beydals cb7b8967e3
Merge pull request #580 from rollandf/typo
Minor typo in doc
2022-12-15 12:25:20 +00:00
Fred Rolland 060d5262a2 Minor typo in doc
Signed-off-by: Fred Rolland <frolland@nvidia.com>
2022-12-15 11:59:17 +00:00
Hidde Beydals 0102a23c61
Merge pull request #577 from fluxcd/update-helm
helm: Update SDK to v3.10.3
2022-12-15 11:58:25 +00:00
Hidde Beydals 1099c1b6a2 helm: Update SDK to v3.10.3
This patches a number of security related issues. Refer to
https://github.com/helm/helm/releases/tag/v3.10.3 for precise information.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-15 11:22:26 +00:00
Paulo Gomes 9a17ee1c94
Merge pull request #578 from pjbgf/improv-fuzz
fuzz: Use build script from upstream and fix fuzzers
2022-12-15 11:21:33 +00:00
Paulo Gomes e259d12de6
fuzz: bump github.com/sirupsen/logrus
A dependency added at fuzzing time upgrades logrus to 1.9.0
which cases the building process to break. By bumping the
dependency Go's MVS won't make further changes later.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-12-14 22:05:13 +00:00
Paulo Gomes 0f1784a08e
fuzz: Use build script from upstream
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-12-14 21:45:45 +00:00
Hidde Beydals 3340022849
Merge pull request #570 from fluxcd/fix-graceful-shutdown
Allow overriding ctrl manager graceful shutdown timeout
2022-12-09 10:25:13 +00:00
Aurel Canciu e242bb0e8e
Allow overriding ctrl manager graceful shutdown timeout
Overriding the default GracefulShutdownTimeout option given to the
controller manager with a default of 0 (no timeout) since the helm
operations are sensitive to interruption and can lead to leaving the
HelmRelease in a bad state.

This will also allow users to override the option via a cli flag
`-graceful-shutdown-timeout` how much time to wait before forcibly
exiting.

Related to #569

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-11-25 12:29:53 +01:00
Paulo Gomes 8d1afa6994
Merge pull request #565 from pjbgf/fix-broken-fuzz
build: Fix cifuzz and improve fuzz tests' reliability
2022-11-24 10:08:19 +00:00
Paulo Gomes 9f3150756d
build: Improve fuzz tests' reliability
Establish conventions which aligns with what is supported upstream
today, whilst expanding on documentation to ensure folks have
pointers on how to debug/check for issues going forwards.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-11-23 14:57:23 +00:00
Paulo Gomes 3a13ca2da0
Merge pull request #562 from pjbgf/release-0.27.0
Release v0.27.0
2022-11-22 12:18:25 +00:00
Paulo Gomes b3ce60ddc3
Release v0.27.0
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-11-22 12:03:48 +00:00
231 changed files with 49489 additions and 5772 deletions

39
.github/dependabot.yaml vendored Normal file
View File

@ -0,0 +1,39 @@
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"

27
.github/labels.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
# 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'

34
.github/workflows/backport.yaml vendored Normal file
View File

@ -0,0 +1,34 @@
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}.

View File

@ -2,7 +2,8 @@ name: fuzz
on:
pull_request:
branches:
- main
- "main"
- "release/**"
permissions:
contents: read # for actions/checkout to fetch code
@ -12,17 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: 1.19.x
- name: Restore Go cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
go-version: 1.24.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Smoke test Fuzzers
run: make fuzz-smoketest

View File

@ -4,8 +4,8 @@ on:
pull_request:
push:
branches:
- main
- "feature/**"
- "main"
- "release/**"
permissions:
contents: read # for actions/checkout to fetch code
@ -15,25 +15,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
buildkitd-flags: "--debug"
- name: Restore Go cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: cache
with:
path: /tmp/.buildx-cache
@ -41,26 +32,24 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-ghcache-
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: 1.19.x
go-version: 1.24.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Setup Kubernetes
uses: engineerd/setup-kind@v0.5.0
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
with:
version: v0.11.1
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
version: v0.20.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
uses: fluxcd/pkg/actions/kustomize@main
- name: Setup Kubebuilder
uses: fluxcd/pkg/actions/kubebuilder@main
- name: Setup Kubectl
uses: fluxcd/pkg/actions/kubectl@main
- name: Run tests
run: make test
env:
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
- name: Check if working tree is dirty
run: |
if [[ $(git diff --stat) != '' ]]; then
@ -102,6 +91,14 @@ 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
@ -149,6 +146,16 @@ 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
@ -180,7 +187,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=="False" 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=="True" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -224,7 +231,7 @@ jobs:
fi
kubectl -n helm-system delete -f config/testdata/$test_name
- name: Run install fail with remedition test
- name: Run install fail with remediation test
run: |
test_name=install-fail-remediate
kubectl -n helm-system apply -f config/testdata/$test_name
@ -241,21 +248,22 @@ jobs:
done
echo ' done'
# 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"
# 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"
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" )' )" ]; 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" and .Stalled=="True" )' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -301,7 +309,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"' )" ]; 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" and .Stalled=="True"' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -347,7 +355,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 .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=="True" and .TestSuccess=="False" and .Ready=="False" and .Stalled=="True"' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -468,6 +476,45 @@ 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
@ -542,6 +589,19 @@ jobs:
fi
done
echo ' done'
- name: Run delete-ns tests
run: |
kubectl apply -f config/testdata/delete-ns
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
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
run: |
kubectl -n helm-system apply -f config/testdata/post-renderer-kustomize
@ -557,7 +617,7 @@ jobs:
exit 1
fi
kubectl -n helm-system delete -f config/testdata/post-renderer-kustomize
- name: Boostrap CRDs Upgrade Tests
- name: Bootstrap CRDs Upgrade Tests
if: ${{ startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/') }}
run: |
REF=${{ github.ref }}
@ -594,9 +654,6 @@ jobs:
- name: Debug failure
if: failure()
run: |
which kubectl
kubectl version
helm version
kubectl -n helm-system get helmrepositories -oyaml || true
kubectl -n helm-system get helmcharts -oyaml || true
kubectl -n helm-system get helmreleases -oyaml || true

View File

@ -14,18 +14,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
buildkitd-flags: "--debug"
- name: Build multi-arch container image
uses: docker/build-push-action@v3
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
push: false
builder: ${{ steps.buildx.outputs.name }}

View File

@ -7,22 +7,29 @@ on:
inputs:
tag:
description: 'image tag prefix'
default: 'rc'
default: 'preview'
required: true
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
contents: read
env:
CONTROLLER: ${{ github.event.repository.name }}
jobs:
build-push:
release:
outputs:
hashes: ${{ steps.slsa.outputs.hashes }}
image_url: ${{ steps.slsa.outputs.image_url }}
image_digest: ${{ steps.slsa.outputs.image_digest }}
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:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Prepare
@ -32,27 +39,27 @@ jobs:
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
fi
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=VERSION::${VERSION}
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@v2
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: fluxcdbot
password: ${{ secrets.GHCR_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: fluxcdbot
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
- name: Generate images meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: |
fluxcd/${{ env.CONTROLLER }}
@ -60,8 +67,11 @@ jobs:
tags: |
type=raw,value=${{ steps.prep.outputs.VERSION }}
- name: Publish images
uses: docker/build-push-action@v3
id: build-push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
sbom: true
provenance: true
push: true
builder: ${{ steps.buildx.outputs.name }}
context: .
@ -69,32 +79,82 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- 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@main
- uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
- name: Sign images
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
cosign sign ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
cosign sign --yes fluxcd/${{ env.CONTROLLER }}@${{ steps.build-push.outputs.digest }}
cosign sign --yes ghcr.io/fluxcd/${{ env.CONTROLLER }}@${{ steps.build-push.outputs.digest }}
- 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
echo '[CHANGELOG](https://github.com/fluxcd/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md
- uses: anchore/sbom-action/download-syft@v0
- uses: anchore/sbom-action/download-syft@cee1b8e05ae5b2593a75e197229729eabaa9f8ec # v0.20.2
- name: Create release and SBOM
id: run-goreleaser
if: startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
with:
version: latest
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate
args: release --clean --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 }}

View File

@ -1,9 +1,9 @@
name: scan
on:
push:
branches: [ main ]
branches: [ "main", "release/**" ]
pull_request:
branches: [ main ]
branches: [ "main", "release/**" ]
schedule:
- cron: '18 10 * * 3'
@ -16,47 +16,36 @@ jobs:
name: FOSSA
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run FOSSA scan and upload build data
uses: fossa-contrib/fossa-action@v1
uses: fossa-contrib/fossa-action@3d2ef181b1820d6dcd1972f86a767d18167fa19b # v3.0.1
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:
- uses: actions/checkout@v3
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --sarif-file-output=snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif
codeql:
name: CodeQL
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: 1.19.x
go-version: 1.24.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
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@v2
uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2

28
.github/workflows/sync-labels.yaml vendored Normal file
View File

@ -0,0 +1,28 @@
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

View File

@ -4,9 +4,26 @@ 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:
@ -32,6 +49,7 @@ signs:
certificate: "${artifact}.pem"
args:
- sign-blob
- "--yes"
- "--output-certificate=${certificate}"
- "--output-signature=${signature}"
- "${artifact}"

File diff suppressed because it is too large Load Diff

View File

@ -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.18
* Go >= 1.24
You can run the test suite by simply doing

View File

@ -1,10 +1,10 @@
ARG GO_VERSION=1.19
ARG XX_VERSION=1.1.0
ARG GO_VERSION=1.24
ARG XX_VERSION=1.6.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 / /
@ -25,22 +25,19 @@ RUN go mod download
# copy source code
COPY main.go main.go
COPY controllers/ controllers/
COPY internal/ internal/
# build without specifing the arch
ENV CGO_ENABLED=0
RUN xx-go build -trimpath -a -o helm-controller main.go
FROM alpine:3.16
FROM alpine:3.21
# link repo to the GitHub Container Registry image
LABEL org.opencontainers.image.source="https://github.com/fluxcd/helm-controller"
RUN apk add --no-cache ca-certificates tini
RUN apk add --no-cache ca-certificates \
&& update-ca-certificates
COPY --from=builder /workspace/helm-controller /usr/local/bin/
USER 65534:65534
ENTRYPOINT [ "/sbin/tini", "--", "helm-controller" ]
ENTRYPOINT [ "helm-controller" ]

View File

@ -27,11 +27,26 @@ 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
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
test: tidy generate fmt vet manifests api-docs install-envtest download-crd-deps
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) go test ./... -coverprofile cover.out
cd api; go test ./... -coverprofile cover.out
@ -77,12 +92,12 @@ manifests: controller-gen
# Generate API reference documentation
api-docs: gen-crd-api-reference-docs
$(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
$(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
# Run go mod tidy
tidy:
cd api; rm -f go.sum; go mod tidy -compat=1.19
rm -f go.sum; go mod tidy -compat=1.19
cd api; rm -f go.sum; go mod tidy -compat=1.23
rm -f go.sum; go mod tidy -compat=1.23
# Run go fmt against code
fmt:
@ -109,17 +124,35 @@ 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
controller-gen: ## Download controller-gen locally if necessary.
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0)
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION))
# Find or download gen-crd-api-reference-docs
GEN_CRD_API_REFERENCE_DOCS = $(GOBIN)/gen-crd-api-reference-docs
.PHONY: gen-crd-api-reference-docs
gen-crd-api-reference-docs:
$(call go-install-tool,$(GEN_CRD_API_REFERENCE_DOCS),github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0)
gen-crd-api-reference-docs: ## Download gen-crd-api-reference-docs locally if necessary
$(call go-install-tool,$(GEN_CRD_API_REFERENCE_DOCS),github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_API_REF_DOCS_VERSION))
ENVTEST_ASSETS_DIR=$(BUILD_DIR)/testbin
ENVTEST_KUBERNETES_VERSION?=latest

View File

@ -4,4 +4,11 @@ resources:
- group: helm
kind: HelmRelease
version: v2beta1
- group: helm
kind: HelmRelease
version: v2beta2
- group: helm
kind: HelmRelease
version: v2
storageVersion: v2
version: "2"

View File

@ -24,7 +24,7 @@ operator.
* Supports `HelmChart` artifacts produced from `HelmRepository`,
`GitRepository` and `Bucket` sources
* Fetches artifacts produced by [source-controller][] from `HelmChart`
objects
and `OCIRepository` 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,16 +38,18 @@ 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 GitOps Toolkit](https://fluxcd.io/flux/get-started/)
* [Get started with Flux](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/v2beta1/README.md)
* [API](docs/spec/v2/README.md)
* [Controller](docs/spec/README.md)
[source-controller]: https://github.com/fluxcd/source-controller

View File

@ -1,32 +1,33 @@
module github.com/fluxcd/helm-controller/api
go 1.18
go 1.24.0
require (
github.com/fluxcd/pkg/apis/kustomize v0.7.0
github.com/fluxcd/pkg/apis/meta v0.18.0
k8s.io/apiextensions-apiserver v0.25.4
k8s.io/apimachinery v0.25.4
sigs.k8s.io/controller-runtime v0.13.1
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
)
// Fix CVE-2022-32149
replace golang.org/x/text => golang.org/x/text v0.4.0
require (
github.com/go-logr/logr v1.2.3 // indirect
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
github.com/go-logr/logr v1.4.2 // 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
golang.org/x/net v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // 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
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // 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
)

View File

@ -1,81 +1,91 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
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 v0.7.0 h1:X2htBmJ91nGYv4d93gin665MFWKNGiNwUiZ08/Zz0hY=
github.com/fluxcd/pkg/apis/kustomize v0.7.0/go.mod h1:Mu+KdktsEKWA4l/33CZdY5lB4hz51mqfcLzBZSwAqVg=
github.com/fluxcd/pkg/apis/meta v0.18.0 h1:s0LeulWcQ4DxVX6805vgDTxlA6bAYk+Lq1QHSnNdqLM=
github.com/fluxcd/pkg/apis/meta v0.18.0/go.mod h1:pYvXRFi1UKNNrGR34jw3uqOnMXw9X6dTkML8j5Z7tis=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
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/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.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
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-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
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 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
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/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
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=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
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/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q=
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/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/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
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/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.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
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=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
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.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
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/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/sync v0.0.0-20220722155255-886fb9371eb4/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.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
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/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.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
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=
@ -85,24 +95,27 @@ 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/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
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=
k8s.io/api v0.25.4 h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs=
k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U=
k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ=
k8s.io/apimachinery v0.25.4 h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc=
k8s.io/apimachinery v0.25.4/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo=
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg=
sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/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=
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=

57
api/v2/annotations.go Normal file
View File

@ -0,0 +1,57 @@
/*
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)
}

View File

@ -0,0 +1,50 @@
/*
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")
}
}

82
api/v2/condition_types.go Normal file
View File

@ -0,0 +1,82 @@
/*
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"
)

20
api/v2/doc.go Normal file
View File

@ -0,0 +1,20 @@
/*
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

View File

@ -0,0 +1,33 @@
/*
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
)

1330
api/v2/helmrelease_types.go Normal file

File diff suppressed because it is too large Load Diff

90
api/v2/reference_types.go Normal file
View File

@ -0,0 +1,90 @@
/*
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"`
}

239
api/v2/snapshot_types.go Normal file
View File

@ -0,0 +1,239 @@
/*
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"`
}

View File

@ -0,0 +1,298 @@
/*
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)
}
})
}
}

View File

@ -0,0 +1,774 @@
//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
}

View File

@ -15,6 +15,9 @@ 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

View File

@ -28,6 +28,9 @@ 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"
@ -67,9 +70,19 @@ type HelmReleaseSpec struct {
// Chart defines the template of the v1beta2.HelmChart that should be created
// for this HelmRelease.
// +required
Chart HelmChartTemplate `json:"chart"`
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"`
// 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
@ -83,7 +96,7 @@ type HelmReleaseSpec struct {
// a controller level fallback for when HelmReleaseSpec.ServiceAccountName
// is empty.
// +optional
KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`
KubeConfig *meta.KubeConfigReference `json:"kubeConfig,omitempty"`
// Suspend tells the controller to suspend reconciliation for this HelmRelease,
// it does not apply to already started reconciliations. Defaults to false.
@ -137,6 +150,30 @@ type HelmReleaseSpec struct {
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// PersistentClient tells the controller to use a persistent Kubernetes
// client for this release. When enabled, the client will be reused for the
// duration of the reconciliation, instead of being created and destroyed
// for each (step of a) Helm action.
//
// This can improve performance, but may cause issues with some Helm charts
// that for example do create Custom Resource Definitions during installation
// outside Helm's CRD lifecycle hooks, which are then not observed to be
// available by e.g. post-install hooks.
//
// If not set, it defaults to true.
//
// +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"`
@ -215,30 +252,36 @@ func (in HelmReleaseSpec) GetUninstall() Uninstall {
return *in.Uninstall
}
// KubeConfig references a Kubernetes secret that contains a kubeconfig file.
type KubeConfig struct {
// SecretRef holds the name to a secret that contains a key with
// the kubeconfig file as the value. If no key is specified the key will
// default to 'value'. The secret must be in the same namespace as
// the HelmRelease.
// It is recommended that the kubeconfig is self-contained, and the secret
// is regularly updated if credentials such as a cloud-access-token expire.
// Cloud specific `cmd-path` auth helpers will not function without adding
// binaries and credentials to the Pod that is responsible for reconciling
// the HelmRelease.
// +required
SecretRef meta.SecretKeyReference `json:"secretRef,omitempty"`
}
// HelmChartTemplate defines the template from which the controller will
// generate a v1beta2.HelmChart object in the same namespace as the referenced
// v1beta2.Source.
type HelmChartTemplate struct {
// ObjectMeta holds the template for metadata like labels and annotations.
// +optional
ObjectMeta *HelmChartTemplateObjectMeta `json:"metadata,omitempty"`
// Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
// +required
Spec HelmChartTemplateSpec `json:"spec"`
}
// HelmChartTemplateObjectMeta defines the template for the ObjectMeta of a
// v1beta2.HelmChart.
type HelmChartTemplateObjectMeta struct {
// Map of string keys and values that can be used to organize and categorize
// (scope and select) objects.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
// HelmChartTemplateSpec defines the template from which the controller will
// generate a v1beta2.HelmChartSpec object.
type HelmChartTemplateSpec struct {
@ -807,6 +850,13 @@ 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
@ -818,12 +868,26 @@ 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.
@ -866,6 +930,62 @@ 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.
@ -924,6 +1044,8 @@ func HelmReleaseReady(hr HelmRelease) HelmRelease {
// HelmReleaseAttempted registers an attempt of the given HelmRelease with the given state.
// and returns the modified HelmRelease and a boolean indicating a state change.
//
// Deprecated: in favor of HelmReleaseChanged and HelmReleaseRecordAttempt.
func HelmReleaseAttempted(hr HelmRelease, revision string, releaseRevision int, valuesChecksum string) (HelmRelease, bool) {
changed := hr.Status.LastAttemptedRevision != revision ||
hr.Status.LastReleaseRevision != releaseRevision ||
@ -935,6 +1057,31 @@ func HelmReleaseAttempted(hr HelmRelease, revision string, releaseRevision int,
return hr, changed
}
// HelmReleaseChanged returns if the HelmRelease has changed compared to the
// provided values.
func HelmReleaseChanged(hr HelmRelease, revision string, releaseRevision int, valuesChecksums ...string) bool {
return hr.Status.LastAttemptedRevision != revision ||
hr.Status.LastReleaseRevision != releaseRevision ||
!inStringSlice(hr.Status.LastAttemptedValuesChecksum, valuesChecksums)
}
// HelmReleaseRecordAttempt returns an attempt of the given HelmRelease with the
// given state in the Status of the provided object.
func HelmReleaseRecordAttempt(hr *HelmRelease, revision string, releaseRevision int, valuesChecksum string) {
hr.Status.LastAttemptedRevision = revision
hr.Status.LastReleaseRevision = releaseRevision
hr.Status.LastAttemptedValuesChecksum = valuesChecksum
}
func inStringSlice(str string, s []string) bool {
for _, v := range s {
if str == v {
return true
}
}
return false
}
func resetFailureCounts(hr *HelmRelease) {
hr.Status.Failures = 0
hr.Status.InstallFailures = 0
@ -948,13 +1095,9 @@ const (
)
// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName=hr
// +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=""
// +kubebuilder:skipversion
// HelmRelease is the Schema for the helmreleases API
type HelmRelease struct {
@ -1033,6 +1176,15 @@ func (in HelmRelease) GetMaxHistory() int {
return *in.Spec.MaxHistory
}
// UsePersistentClient returns the configured PersistentClient, or the default
// of true.
func (in HelmRelease) UsePersistentClient() bool {
if in.Spec.PersistentClient == nil {
return true
}
return *in.Spec.PersistentClient
}
// GetDependsOn returns the list of dependencies across-namespaces.
func (in HelmRelease) GetDependsOn() []meta.NamespacedObjectReference {
return in.Spec.DependsOn
@ -1049,6 +1201,7 @@ 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

View File

@ -1,8 +1,7 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The Flux authors
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.
@ -22,6 +21,8 @@ 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"
@ -47,6 +48,11 @@ func (in *CrossNamespaceObjectReference) DeepCopy() *CrossNamespaceObjectReferen
// 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)
}
@ -60,6 +66,35 @@ func (in *HelmChartTemplate) DeepCopy() *HelmChartTemplate {
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
@ -173,12 +208,21 @@ 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
in.Chart.DeepCopyInto(&out.Chart)
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
}
out.Interval = in.Interval
if in.KubeConfig != nil {
in, out := &in.KubeConfig, &out.KubeConfig
*out = new(KubeConfig)
**out = **in
*out = new(meta.KubeConfigReference)
(*in).DeepCopyInto(*out)
}
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
@ -195,6 +239,16 @@ func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) {
*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(v2beta2.DriftDetection)
(*in).DeepCopyInto(*out)
}
if in.Install != nil {
in, out := &in.Install, &out.Install
*out = new(Install)
@ -260,6 +314,17 @@ 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.
@ -322,29 +387,15 @@ func (in *InstallRemediation) DeepCopy() *InstallRemediation {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeConfig) DeepCopyInto(out *KubeConfig) {
*out = *in
out.SecretRef = in.SecretRef
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeConfig.
func (in *KubeConfig) DeepCopy() *KubeConfig {
if in == nil {
return nil
}
out := new(KubeConfig)
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))
copy(*out, *in)
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PatchesStrategicMerge != nil {
in, out := &in.PatchesStrategicMerge, &out.PatchesStrategicMerge
@ -445,6 +496,11 @@ 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.

View File

@ -0,0 +1,84 @@
/*
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
}

View File

@ -0,0 +1,165 @@
/*
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)
}
})
}
}

View File

@ -0,0 +1,98 @@
/*
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"
)

20
api/v2beta2/doc.go Normal file
View File

@ -0,0 +1,20 @@
/*
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

View File

@ -0,0 +1,33 @@
/*
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

View File

@ -0,0 +1,115 @@
/*
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
}

View File

@ -0,0 +1,236 @@
/*
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"`
}

View File

@ -0,0 +1,298 @@
/*
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)
}
})
}
}

View File

@ -0,0 +1,749 @@
//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

View File

@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: helm-system
resources:
- https://github.com/fluxcd/source-controller/releases/download/v0.31.0/source-controller.crds.yaml
- https://github.com/fluxcd/source-controller/releases/download/v0.31.0/source-controller.deployment.yaml
- 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
- ../crd
- ../rbac
- ../manager

View File

@ -5,4 +5,4 @@ resources:
images:
- name: fluxcd/helm-controller
newName: fluxcd/helm-controller
newTag: v0.26.0
newTag: v1.3.0

View File

@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
@ -46,6 +45,7 @@ rules:
- source.toolkit.fluxcd.io
resources:
- helmcharts
- ocirepositories
verbs:
- get
- list
@ -54,5 +54,6 @@ rules:
- source.toolkit.fluxcd.io
resources:
- helmcharts/status
- ocirepositories/status
verbs:
- get

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: podinfo-gitrepository
@ -10,9 +10,3 @@ spec:
sourceRef:
kind: GitRepository
name: podinfo
interval: 1m
upgrade:
remediation:
remediateLastFailure: true
test:
enable: true

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: podinfo-helmrepository
@ -7,13 +7,8 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
upgrade:
remediation:
remediateLastFailure: true
test:
enable: true
interval: 10m

View File

@ -0,0 +1,13 @@
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

View File

@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: podinfo

View File

@ -0,0 +1,9 @@
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

View File

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: this
@ -11,6 +11,6 @@ spec:
{{- if .Values.branch }}
branch: "{{ .Values.branch }}"
{{- end}}
{{- if .Values.branch }}
{{- if .Values.tag }}
tag: "{{ .Values.tag }}"
{{- end}}

View File

@ -1,5 +1,5 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: crds-upgrade-test

View File

@ -1,5 +1,5 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: crds-upgrade-test

View File

@ -1,5 +1,5 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: crds-upgrade-test

68
config/testdata/delete-ns/test.yaml vendored Normal file
View File

@ -0,0 +1,68 @@
apiVersion: v1
kind: Namespace
metadata:
name: delete-ns
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gotk-reconciler
namespace: delete-ns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gotk-reconciler
namespace: delete-ns
rules:
- apiGroups:
- ""
resources:
- '*'
verbs:
- '*'
- apiGroups:
- apps
resources:
- '*'
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gotk-reconciler
namespace: delete-ns
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: gotk-reconciler
subjects:
- kind: ServiceAccount
name: gotk-reconciler
namespace: delete-ns
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: podinfo
namespace: delete-ns
spec:
interval: 1m
url: https://stefanprodan.github.io/podinfo
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: podinfo
namespace: delete-ns
spec:
serviceAccountName: gotk-reconciler
interval: 5m
chart:
spec:
chart: podinfo
version: 6.3.5
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: backend
@ -7,7 +7,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: frontend
@ -7,7 +7,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -42,7 +42,7 @@ subjects:
name: gotk-reconciler
namespace: impersonation
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: podinfo
@ -51,7 +51,7 @@ spec:
interval: 1m
url: https://stefanprodan.github.io/podinfo
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: podinfo
@ -62,12 +62,12 @@ spec:
chart:
spec:
chart: podinfo
version: 5.0.3
version: 6.3.5
sourceRef:
kind: HelmRepository
name: podinfo
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: podinfo-fail
@ -78,7 +78,7 @@ spec:
chart:
spec:
chart: podinfo
version: 5.0.3
version: 6.3.5
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: install-create-target-ns
@ -9,7 +9,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,20 +1,22 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: install-fail-remediate
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
install:
remediation:
remediateLastFailure: true
uninstall:
keepHistory: true
values:
resources:
requests:

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: install-fail-retry
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
install:
remediation:
retries: 1

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: install-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -0,0 +1,29 @@
---
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

View File

@ -0,0 +1,25 @@
---
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

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: install-test-fail-ignore
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
test:
enable: true
ignoreFailures: true

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: install-test-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
test:
enable: true
values:

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: podinfo-git

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: podinfo-oci

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: podinfo
@ -7,7 +7,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: post-renderer-kustomize
@ -7,7 +7,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <6.9.0'
sourceRef:
kind: HelmRepository
name: podinfo
@ -16,20 +16,20 @@ spec:
fullnameOverride: mypodinfo
postRenderers:
- kustomize:
patchesStrategicMerge:
- kind: Deployment
apiVersion: apps/v1
metadata:
name: mypodinfo
labels:
xxxx: yyyy
patchesJson6902:
patches:
- patch: |
kind: Deployment
apiVersion: apps/v1
metadata:
name: mypodinfo
labels:
xxxx: yyyy
- 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

View File

@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: status-defaults
@ -7,7 +7,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: targetnamespace
@ -7,7 +7,7 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail-remediate-uninstall
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail-remediate-uninstall
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
upgrade:
remediation:
remediateLastFailure: true

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail-remediate
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail-remediate
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
upgrade:
remediation:
remediateLastFailure: true

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail-retry
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail-retry
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
upgrade:
remediation:
retries: 1

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -0,0 +1,25 @@
---
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

View File

@ -0,0 +1,10 @@
---
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"

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-test-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -1,17 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: upgrade-test-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
test:
enable: true
values:

View File

@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: valuesfrom
@ -7,11 +7,11 @@ spec:
chart:
spec:
chart: podinfo
version: '>=4.0.0 <5.0.0'
version: '>=6.0.0 <7.0.0'
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
valuesFrom:
- kind: ConfigMap
name: valuesfrom-config

View File

@ -1,774 +0,0 @@
/*
Copyright 2020 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 controllers
import (
"context"
"errors"
"fmt"
"strings"
"time"
"github.com/hashicorp/go-retryablehttp"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/storage/driver"
"helm.sh/helm/v3/pkg/strvals"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/rest"
kuberecorder "k8s.io/client-go/tools/record"
"k8s.io/client-go/tools/reference"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/ratelimiter"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
apiacl "github.com/fluxcd/pkg/apis/acl"
eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/runtime/acl"
fluxClient "github.com/fluxcd/pkg/runtime/client"
"github.com/fluxcd/pkg/runtime/metrics"
"github.com/fluxcd/pkg/runtime/predicates"
"github.com/fluxcd/pkg/runtime/transform"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
"github.com/fluxcd/helm-controller/internal/kube"
"github.com/fluxcd/helm-controller/internal/runner"
"github.com/fluxcd/helm-controller/internal/util"
)
// +kubebuilder:rbac:groups=helm.toolkit.fluxcd.io,resources=helmreleases,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=helm.toolkit.fluxcd.io,resources=helmreleases/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=helm.toolkit.fluxcd.io,resources=helmreleases/finalizers,verbs=get;create;update;patch;delete
// +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=helmcharts,verbs=get;list;watch
// +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=helmcharts/status,verbs=get
// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch
// HelmReleaseReconciler reconciles a HelmRelease object
type HelmReleaseReconciler struct {
client.Client
httpClient *retryablehttp.Client
Config *rest.Config
Scheme *runtime.Scheme
requeueDependency time.Duration
EventRecorder kuberecorder.EventRecorder
MetricsRecorder *metrics.Recorder
DefaultServiceAccount string
NoCrossNamespaceRef bool
ClientOpts fluxClient.Options
KubeConfigOpts fluxClient.KubeConfigOptions
}
func (r *HelmReleaseReconciler) SetupWithManager(mgr ctrl.Manager, opts HelmReleaseReconcilerOptions) error {
// Index the HelmRelease by the HelmChart references they point at
if err := mgr.GetFieldIndexer().IndexField(context.TODO(), &v2.HelmRelease{}, v2.SourceIndexKey,
func(o client.Object) []string {
hr := o.(*v2.HelmRelease)
return []string{
fmt.Sprintf("%s/%s", hr.Spec.Chart.GetNamespace(hr.GetNamespace()), hr.GetHelmChartName()),
}
},
); err != nil {
return err
}
r.requeueDependency = opts.DependencyRequeueInterval
// Configure the retryable http client used for fetching artifacts.
// By default it retries 10 times within a 3.5 minutes window.
httpClient := retryablehttp.NewClient()
httpClient.RetryWaitMin = 5 * time.Second
httpClient.RetryWaitMax = 30 * time.Second
httpClient.RetryMax = opts.HTTPRetry
httpClient.Logger = nil
r.httpClient = httpClient
return ctrl.NewControllerManagedBy(mgr).
For(&v2.HelmRelease{}, builder.WithPredicates(
predicate.Or(predicate.GenerationChangedPredicate{}, predicates.ReconcileRequestedPredicate{}),
)).
Watches(
&source.Kind{Type: &sourcev1.HelmChart{}},
handler.EnqueueRequestsFromMapFunc(r.requestsForHelmChartChange),
builder.WithPredicates(SourceRevisionChangePredicate{}),
).
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
// ConditionError represents an error with a status condition reason attached.
type ConditionError struct {
Reason string
Err error
}
func (c ConditionError) Error() string {
return c.Err.Error()
}
func (r *HelmReleaseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
start := time.Now()
log := ctrl.LoggerFrom(ctx)
var hr v2.HelmRelease
if err := r.Get(ctx, req.NamespacedName, &hr); err != nil {
return ctrl.Result{}, client.IgnoreNotFound(err)
}
// record suspension metrics
defer r.recordSuspension(ctx, hr)
// Add our finalizer if it does not exist
if !controllerutil.ContainsFinalizer(&hr, v2.HelmReleaseFinalizer) {
patch := client.MergeFrom(hr.DeepCopy())
controllerutil.AddFinalizer(&hr, v2.HelmReleaseFinalizer)
if err := r.Patch(ctx, &hr, patch); err != nil {
log.Error(err, "unable to register finalizer")
return ctrl.Result{}, err
}
}
// Examine if the object is under deletion
if !hr.ObjectMeta.DeletionTimestamp.IsZero() {
return r.reconcileDelete(ctx, hr)
}
// Return early if the HelmRelease is suspended.
if hr.Spec.Suspend {
log.Info("Reconciliation is suspended for this object")
return ctrl.Result{}, nil
}
hr, result, err := r.reconcile(ctx, hr)
// Update status after reconciliation.
if updateStatusErr := r.patchStatus(ctx, &hr); updateStatusErr != nil {
log.Error(updateStatusErr, "unable to update status after reconciliation")
return ctrl.Result{Requeue: true}, updateStatusErr
}
// Record ready status
r.recordReadiness(ctx, hr)
// Log reconciliation duration
durationMsg := fmt.Sprintf("reconcilation finished in %s", time.Now().Sub(start).String())
if result.RequeueAfter > 0 {
durationMsg = fmt.Sprintf("%s, next run in %s", durationMsg, result.RequeueAfter.String())
}
log.Info(durationMsg)
return result, err
}
func (r *HelmReleaseReconciler) reconcile(ctx context.Context, hr v2.HelmRelease) (v2.HelmRelease, ctrl.Result, error) {
reconcileStart := time.Now()
log := ctrl.LoggerFrom(ctx)
// Record the value of the reconciliation request, if any
if v, ok := meta.ReconcileAnnotationValue(hr.GetAnnotations()); ok {
hr.Status.SetLastHandledReconcileRequest(v)
}
// Observe HelmRelease generation.
if hr.Status.ObservedGeneration != hr.Generation {
hr.Status.ObservedGeneration = hr.Generation
hr = v2.HelmReleaseProgressing(hr)
if updateStatusErr := r.patchStatus(ctx, &hr); updateStatusErr != nil {
log.Error(updateStatusErr, "unable to update status after generation update")
return hr, ctrl.Result{Requeue: true}, updateStatusErr
}
// Record progressing status
r.recordReadiness(ctx, hr)
}
// Record reconciliation duration
if r.MetricsRecorder != nil {
objRef, err := reference.GetReference(r.Scheme, &hr)
if err != nil {
return hr, ctrl.Result{Requeue: true}, err
}
defer r.MetricsRecorder.RecordDuration(*objRef, reconcileStart)
}
// Reconcile chart based on the HelmChartTemplate
hc, reconcileErr := r.reconcileChart(ctx, &hr)
if reconcileErr != nil {
if acl.IsAccessDenied(reconcileErr) {
log.Error(reconcileErr, "access denied to cross-namespace source")
r.event(ctx, hr, hr.Status.LastAttemptedRevision, eventv1.EventSeverityError, reconcileErr.Error())
return v2.HelmReleaseNotReady(hr, apiacl.AccessDeniedReason, reconcileErr.Error()),
ctrl.Result{RequeueAfter: hr.Spec.Interval.Duration}, nil
}
msg := fmt.Sprintf("chart reconciliation failed: %s", reconcileErr.Error())
r.event(ctx, hr, hr.Status.LastAttemptedRevision, eventv1.EventSeverityError, msg)
return v2.HelmReleaseNotReady(hr, v2.ArtifactFailedReason, msg), ctrl.Result{Requeue: true}, reconcileErr
}
// Check chart readiness
if hc.Generation != hc.Status.ObservedGeneration || !apimeta.IsStatusConditionTrue(hc.Status.Conditions, meta.ReadyCondition) {
msg := fmt.Sprintf("HelmChart '%s/%s' is not ready", hc.GetNamespace(), hc.GetName())
r.event(ctx, hr, hr.Status.LastAttemptedRevision, eventv1.EventSeverityInfo, msg)
log.Info(msg)
// Do not requeue immediately, when the artifact is created
// the watcher should trigger a reconciliation.
return v2.HelmReleaseNotReady(hr, v2.ArtifactFailedReason, msg), ctrl.Result{RequeueAfter: hc.Spec.Interval.Duration}, nil
}
// Check dependencies
if len(hr.Spec.DependsOn) > 0 {
if err := r.checkDependencies(hr); err != nil {
msg := fmt.Sprintf("dependencies do not meet ready condition (%s), retrying in %s",
err.Error(), r.requeueDependency.String())
r.event(ctx, hr, hc.GetArtifact().Revision, eventv1.EventSeverityInfo, msg)
log.Info(msg)
// Exponential backoff would cause execution to be prolonged too much,
// instead we requeue on a fixed interval.
return v2.HelmReleaseNotReady(hr,
v2.DependencyNotReadyReason, err.Error()), ctrl.Result{RequeueAfter: r.requeueDependency}, nil
}
log.Info("all dependencies are ready, proceeding with release")
}
// Compose values
values, err := r.composeValues(ctx, hr)
if err != nil {
r.event(ctx, hr, hr.Status.LastAttemptedRevision, eventv1.EventSeverityError, err.Error())
return v2.HelmReleaseNotReady(hr, v2.InitFailedReason, err.Error()), ctrl.Result{Requeue: true}, nil
}
// Load chart from artifact
chart, err := r.loadHelmChart(hc)
if err != nil {
r.event(ctx, hr, hr.Status.LastAttemptedRevision, eventv1.EventSeverityError, err.Error())
return v2.HelmReleaseNotReady(hr, v2.ArtifactFailedReason, err.Error()), ctrl.Result{Requeue: true}, nil
}
// Reconcile Helm release
reconciledHr, reconcileErr := r.reconcileRelease(ctx, *hr.DeepCopy(), chart, values)
if reconcileErr != nil {
r.event(ctx, hr, hc.GetArtifact().Revision, eventv1.EventSeverityError,
fmt.Sprintf("reconciliation failed: %s", reconcileErr.Error()))
}
return reconciledHr, ctrl.Result{RequeueAfter: hr.Spec.Interval.Duration}, reconcileErr
}
type HelmReleaseReconcilerOptions struct {
MaxConcurrentReconciles int
HTTPRetry int
DependencyRequeueInterval time.Duration
RateLimiter ratelimiter.RateLimiter
}
func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context,
hr v2.HelmRelease, chart *chart.Chart, values chartutil.Values) (v2.HelmRelease, error) {
log := ctrl.LoggerFrom(ctx)
// Initialize Helm action runner
getter, err := r.buildRESTClientGetter(ctx, hr)
if err != nil {
return v2.HelmReleaseNotReady(hr, v2.InitFailedReason, err.Error()), err
}
run, err := runner.NewRunner(getter, hr.GetStorageNamespace(), log)
if err != nil {
return v2.HelmReleaseNotReady(hr, v2.InitFailedReason, "failed to initialize Helm action runner"), err
}
// Determine last release revision.
rel, observeLastReleaseErr := run.ObserveLastRelease(hr)
if observeLastReleaseErr != nil {
err = fmt.Errorf("failed to get last release revision: %w", observeLastReleaseErr)
return v2.HelmReleaseNotReady(hr, v2.GetLastReleaseFailedReason, "failed to get last release revision"), err
}
// Register the current release attempt.
revision := chart.Metadata.Version
releaseRevision := util.ReleaseRevision(rel)
valuesChecksum := util.ValuesChecksum(values)
hr, hasNewState := v2.HelmReleaseAttempted(hr, revision, releaseRevision, valuesChecksum)
if hasNewState {
hr = v2.HelmReleaseProgressing(hr)
if updateStatusErr := r.patchStatus(ctx, &hr); updateStatusErr != nil {
log.Error(updateStatusErr, "unable to update status after state update")
return hr, updateStatusErr
}
// Record progressing status
r.recordReadiness(ctx, hr)
}
// Check status of any previous release attempt.
released := apimeta.FindStatusCondition(hr.Status.Conditions, v2.ReleasedCondition)
if released != nil {
switch released.Status {
// Succeed if the previous release attempt succeeded.
case metav1.ConditionTrue:
return v2.HelmReleaseReady(hr), nil
case metav1.ConditionFalse:
// Fail if the previous release attempt remediation failed.
remediated := apimeta.FindStatusCondition(hr.Status.Conditions, v2.RemediatedCondition)
if remediated != nil && remediated.Status == metav1.ConditionFalse {
err = fmt.Errorf("previous release attempt remediation failed")
return v2.HelmReleaseNotReady(hr, remediated.Reason, remediated.Message), err
}
}
// Fail if install retries are exhausted.
if hr.Spec.GetInstall().GetRemediation().RetriesExhausted(hr) {
err = fmt.Errorf("install retries exhausted")
return v2.HelmReleaseNotReady(hr, released.Reason, err.Error()), err
}
// Fail if there is a release and upgrade retries are exhausted.
// This avoids failing after an upgrade uninstall remediation strategy.
if rel != nil && hr.Spec.GetUpgrade().GetRemediation().RetriesExhausted(hr) {
err = fmt.Errorf("upgrade retries exhausted")
return v2.HelmReleaseNotReady(hr, released.Reason, err.Error()), err
}
}
// Deploy the release.
var deployAction v2.DeploymentAction
if rel == nil {
r.event(ctx, hr, revision, eventv1.EventSeverityInfo, "Helm install has started")
deployAction = hr.Spec.GetInstall()
rel, err = run.Install(hr, chart, values)
err = r.handleHelmActionResult(ctx, &hr, revision, err, deployAction.GetDescription(),
v2.ReleasedCondition, v2.InstallSucceededReason, v2.InstallFailedReason)
} else {
r.event(ctx, hr, revision, eventv1.EventSeverityInfo, "Helm upgrade has started")
deployAction = hr.Spec.GetUpgrade()
rel, err = run.Upgrade(hr, chart, values)
err = r.handleHelmActionResult(ctx, &hr, revision, err, deployAction.GetDescription(),
v2.ReleasedCondition, v2.UpgradeSucceededReason, v2.UpgradeFailedReason)
}
remediation := deployAction.GetRemediation()
// If there is a new release revision...
if util.ReleaseRevision(rel) > releaseRevision {
// Ensure release is not marked remediated.
apimeta.RemoveStatusCondition(&hr.Status.Conditions, v2.RemediatedCondition)
// If new release revision is successful and tests are enabled, run them.
if err == nil && hr.Spec.GetTest().Enable {
_, testErr := run.Test(hr)
testErr = r.handleHelmActionResult(ctx, &hr, revision, testErr, "test",
v2.TestSuccessCondition, v2.TestSucceededReason, v2.TestFailedReason)
// Propagate any test error if not marked ignored.
if testErr != nil && !remediation.MustIgnoreTestFailures(hr.Spec.GetTest().IgnoreFailures) {
testsPassing := apimeta.FindStatusCondition(hr.Status.Conditions, v2.TestSuccessCondition)
newCondition := metav1.Condition{
Type: v2.ReleasedCondition,
Status: metav1.ConditionFalse,
Reason: testsPassing.Reason,
Message: testsPassing.Message,
}
apimeta.SetStatusCondition(hr.GetStatusConditions(), newCondition)
err = testErr
}
}
}
if err != nil {
// Increment failure count for deployment action.
remediation.IncrementFailureCount(&hr)
// Remediate deployment failure if necessary.
if !remediation.RetriesExhausted(hr) || remediation.MustRemediateLastFailure() {
if util.ReleaseRevision(rel) <= releaseRevision {
log.Info(fmt.Sprintf("skipping remediation, no new release revision created"))
} else {
var remediationErr error
switch remediation.GetStrategy() {
case v2.RollbackRemediationStrategy:
rollbackErr := run.Rollback(hr)
remediationErr = r.handleHelmActionResult(ctx, &hr, revision, rollbackErr, "rollback",
v2.RemediatedCondition, v2.RollbackSucceededReason, v2.RollbackFailedReason)
case v2.UninstallRemediationStrategy:
uninstallErr := run.Uninstall(hr)
remediationErr = r.handleHelmActionResult(ctx, &hr, revision, uninstallErr, "uninstall",
v2.RemediatedCondition, v2.UninstallSucceededReason, v2.UninstallFailedReason)
}
if remediationErr != nil {
err = remediationErr
}
}
// Determine release after remediation.
rel, observeLastReleaseErr = run.ObserveLastRelease(hr)
if observeLastReleaseErr != nil {
err = &ConditionError{
Reason: v2.GetLastReleaseFailedReason,
Err: errors.New("failed to get last release revision after remediation"),
}
}
}
}
hr.Status.LastReleaseRevision = util.ReleaseRevision(rel)
if err != nil {
reason := v2.ReconciliationFailedReason
if condErr := (*ConditionError)(nil); errors.As(err, &condErr) {
reason = condErr.Reason
}
return v2.HelmReleaseNotReady(hr, reason, err.Error()), err
}
return v2.HelmReleaseReady(hr), nil
}
func (r *HelmReleaseReconciler) checkDependencies(hr v2.HelmRelease) error {
for _, d := range hr.Spec.DependsOn {
if d.Namespace == "" {
d.Namespace = hr.GetNamespace()
}
dName := types.NamespacedName{
Namespace: d.Namespace,
Name: d.Name,
}
var dHr v2.HelmRelease
err := r.Get(context.Background(), dName, &dHr)
if err != nil {
return fmt.Errorf("unable to get '%s' dependency: %w", dName, err)
}
if len(dHr.Status.Conditions) == 0 || dHr.Generation != dHr.Status.ObservedGeneration {
return fmt.Errorf("dependency '%s' is not ready", dName)
}
if !apimeta.IsStatusConditionTrue(dHr.Status.Conditions, meta.ReadyCondition) {
return fmt.Errorf("dependency '%s' is not ready", dName)
}
}
return nil
}
func (r *HelmReleaseReconciler) buildRESTClientGetter(ctx context.Context, hr v2.HelmRelease) (genericclioptions.RESTClientGetter, error) {
opts := []kube.ClientGetterOption{
kube.WithClientOptions(r.ClientOpts),
// When ServiceAccountName is empty, it will fall back to the configured default.
// If this is not configured either, this option will result in a no-op.
kube.WithImpersonate(hr.Spec.ServiceAccountName, hr.GetNamespace()),
}
if hr.Spec.KubeConfig != nil {
secretName := types.NamespacedName{
Namespace: hr.GetNamespace(),
Name: hr.Spec.KubeConfig.SecretRef.Name,
}
var secret corev1.Secret
if err := r.Get(ctx, secretName, &secret); err != nil {
return nil, fmt.Errorf("could not find KubeConfig secret '%s': %w", secretName, err)
}
kubeConfig, err := kube.ConfigFromSecret(&secret, hr.Spec.KubeConfig.SecretRef.Key)
if err != nil {
return nil, err
}
opts = append(opts, kube.WithKubeConfig(kubeConfig, r.KubeConfigOpts))
}
return kube.BuildClientGetter(hr.GetReleaseNamespace(), opts...)
}
// composeValues attempts to resolve all v2beta1.ValuesReference resources
// and merges them as defined. Referenced resources are only retrieved once
// to ensure a single version is taken into account during the merge.
func (r *HelmReleaseReconciler) composeValues(ctx context.Context, hr v2.HelmRelease) (chartutil.Values, error) {
result := chartutil.Values{}
configMaps := make(map[string]*corev1.ConfigMap)
secrets := make(map[string]*corev1.Secret)
for _, v := range hr.Spec.ValuesFrom {
namespacedName := types.NamespacedName{Namespace: hr.Namespace, Name: v.Name}
var valuesData []byte
switch v.Kind {
case "ConfigMap":
resource, ok := configMaps[namespacedName.String()]
if !ok {
// The resource may not exist, but we want to act on a single version
// of the resource in case the values reference is marked as optional.
configMaps[namespacedName.String()] = nil
resource = &corev1.ConfigMap{}
if err := r.Get(ctx, namespacedName, resource); err != nil {
if apierrors.IsNotFound(err) {
if v.Optional {
(ctrl.LoggerFrom(ctx)).
Info(fmt.Sprintf("could not find optional %s '%s'", v.Kind, namespacedName))
continue
}
return nil, fmt.Errorf("could not find %s '%s'", v.Kind, namespacedName)
}
return nil, err
}
configMaps[namespacedName.String()] = resource
}
if resource == nil {
if v.Optional {
(ctrl.LoggerFrom(ctx)).Info(fmt.Sprintf("could not find optional %s '%s'", v.Kind, namespacedName))
continue
}
return nil, fmt.Errorf("could not find %s '%s'", v.Kind, namespacedName)
}
if data, ok := resource.Data[v.GetValuesKey()]; !ok {
return nil, fmt.Errorf("missing key '%s' in %s '%s'", v.GetValuesKey(), v.Kind, namespacedName)
} else {
valuesData = []byte(data)
}
case "Secret":
resource, ok := secrets[namespacedName.String()]
if !ok {
// The resource may not exist, but we want to act on a single version
// of the resource in case the values reference is marked as optional.
secrets[namespacedName.String()] = nil
resource = &corev1.Secret{}
if err := r.Get(ctx, namespacedName, resource); err != nil {
if apierrors.IsNotFound(err) {
if v.Optional {
(ctrl.LoggerFrom(ctx)).
Info(fmt.Sprintf("could not find optional %s '%s'", v.Kind, namespacedName))
continue
}
return nil, fmt.Errorf("could not find %s '%s'", v.Kind, namespacedName)
}
return nil, err
}
secrets[namespacedName.String()] = resource
}
if resource == nil {
if v.Optional {
(ctrl.LoggerFrom(ctx)).Info(fmt.Sprintf("could not find optional %s '%s'", v.Kind, namespacedName))
continue
}
return nil, fmt.Errorf("could not find %s '%s'", v.Kind, namespacedName)
}
if data, ok := resource.Data[v.GetValuesKey()]; !ok {
return nil, fmt.Errorf("missing key '%s' in %s '%s'", v.GetValuesKey(), v.Kind, namespacedName)
} else {
valuesData = data
}
default:
return nil, fmt.Errorf("unsupported ValuesReference kind '%s'", v.Kind)
}
switch v.TargetPath {
case "":
values, err := chartutil.ReadValues(valuesData)
if err != nil {
return nil, fmt.Errorf("unable to read values from key '%s' in %s '%s': %w", v.GetValuesKey(), v.Kind, namespacedName, err)
}
result = transform.MergeMaps(result, values)
default:
// TODO(hidde): this is a bit of hack, as it mimics the way the option string is passed
// to Helm from a CLI perspective. Given the parser is however not publicly accessible
// while it contains all logic around parsing the target path, it is a fair trade-off.
stringValuesData := string(valuesData)
const singleQuote = "'"
const doubleQuote = "\""
var err error
if (strings.HasPrefix(stringValuesData, singleQuote) && strings.HasSuffix(stringValuesData, singleQuote)) || (strings.HasPrefix(stringValuesData, doubleQuote) && strings.HasSuffix(stringValuesData, doubleQuote)) {
stringValuesData = strings.Trim(stringValuesData, singleQuote+doubleQuote)
singleValue := v.TargetPath + "=" + stringValuesData
err = strvals.ParseIntoString(singleValue, result)
} else {
singleValue := v.TargetPath + "=" + stringValuesData
err = strvals.ParseInto(singleValue, result)
}
if err != nil {
return nil, fmt.Errorf("unable to merge value from key '%s' in %s '%s' into target path '%s': %w", v.GetValuesKey(), v.Kind, namespacedName, v.TargetPath, err)
}
}
}
return transform.MergeMaps(result, hr.GetValues()), nil
}
// reconcileDelete deletes the v1beta2.HelmChart of the v2beta1.HelmRelease,
// and uninstalls the Helm release if the resource has not been suspended.
func (r *HelmReleaseReconciler) reconcileDelete(ctx context.Context, hr v2.HelmRelease) (ctrl.Result, error) {
r.recordReadiness(ctx, hr)
// Delete the HelmChart that belongs to this resource.
if err := r.deleteHelmChart(ctx, &hr); err != nil {
return ctrl.Result{}, err
}
// Only uninstall the Helm Release if the resource is not suspended.
if !hr.Spec.Suspend {
getter, err := r.buildRESTClientGetter(ctx, hr)
if err != nil {
return ctrl.Result{}, err
}
run, err := runner.NewRunner(getter, hr.GetStorageNamespace(), ctrl.LoggerFrom(ctx))
if err != nil {
return ctrl.Result{}, err
}
if err := run.Uninstall(hr); err != nil && !errors.Is(err, driver.ErrReleaseNotFound) {
return ctrl.Result{}, err
}
ctrl.LoggerFrom(ctx).Info("uninstalled Helm release for deleted resource")
} else {
ctrl.LoggerFrom(ctx).Info("skipping Helm uninstall for suspended resource")
}
// Remove our finalizer from the list and update it.
controllerutil.RemoveFinalizer(&hr, v2.HelmReleaseFinalizer)
if err := r.Update(ctx, &hr); err != nil {
return ctrl.Result{}, err
}
return ctrl.Result{}, nil
}
func (r *HelmReleaseReconciler) handleHelmActionResult(ctx context.Context,
hr *v2.HelmRelease, revision string, err error, action string, condition string, succeededReason string, failedReason string) error {
if err != nil {
err = fmt.Errorf("Helm %s failed: %w", action, err)
msg := err.Error()
if actionErr := (*runner.ActionError)(nil); errors.As(err, &actionErr) {
msg = msg + "\n\nLast Helm logs:\n\n" + actionErr.CapturedLogs
}
newCondition := metav1.Condition{
Type: condition,
Status: metav1.ConditionFalse,
Reason: failedReason,
Message: msg,
}
apimeta.SetStatusCondition(hr.GetStatusConditions(), newCondition)
r.event(ctx, *hr, revision, eventv1.EventSeverityError, msg)
return &ConditionError{Reason: failedReason, Err: err}
} else {
msg := fmt.Sprintf("Helm %s succeeded", action)
newCondition := metav1.Condition{
Type: condition,
Status: metav1.ConditionTrue,
Reason: succeededReason,
Message: msg,
}
apimeta.SetStatusCondition(hr.GetStatusConditions(), newCondition)
r.event(ctx, *hr, revision, eventv1.EventSeverityInfo, msg)
return nil
}
}
func (r *HelmReleaseReconciler) patchStatus(ctx context.Context, hr *v2.HelmRelease) error {
key := client.ObjectKeyFromObject(hr)
latest := &v2.HelmRelease{}
if err := r.Client.Get(ctx, key, latest); err != nil {
return err
}
return r.Client.Status().Patch(ctx, hr, client.MergeFrom(latest))
}
func (r *HelmReleaseReconciler) requestsForHelmChartChange(o client.Object) []reconcile.Request {
hc, ok := o.(*sourcev1.HelmChart)
if !ok {
panic(fmt.Sprintf("Expected a HelmChart, got %T", o))
}
// If we do not have an artifact, we have no requests to make
if hc.GetArtifact() == nil {
return nil
}
ctx := context.Background()
var list v2.HelmReleaseList
if err := r.List(ctx, &list, client.MatchingFields{
v2.SourceIndexKey: client.ObjectKeyFromObject(hc).String(),
}); err != nil {
return nil
}
var reqs []reconcile.Request
for _, i := range list.Items {
// If the revision of the artifact equals to the last attempted revision,
// we should not make a request for this HelmRelease
if hc.GetArtifact().Revision == i.Status.LastAttemptedRevision {
continue
}
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)})
}
return reqs
}
// event emits a Kubernetes event and forwards the event to notification controller if configured.
func (r *HelmReleaseReconciler) event(_ context.Context, hr v2.HelmRelease, revision, severity, msg string) {
var meta map[string]string
if revision != "" {
meta = map[string]string{v2.GroupVersion.Group + "/revision": revision}
}
eventtype := "Normal"
if severity == eventv1.EventSeverityError {
eventtype = "Warning"
}
r.EventRecorder.AnnotatedEventf(&hr, meta, eventtype, severity, msg)
}
func (r *HelmReleaseReconciler) recordSuspension(ctx context.Context, hr v2.HelmRelease) {
if r.MetricsRecorder == nil {
return
}
log := ctrl.LoggerFrom(ctx)
objRef, err := reference.GetReference(r.Scheme, &hr)
if err != nil {
log.Error(err, "unable to record suspended metric")
return
}
if !hr.DeletionTimestamp.IsZero() {
r.MetricsRecorder.RecordSuspend(*objRef, false)
} else {
r.MetricsRecorder.RecordSuspend(*objRef, hr.Spec.Suspend)
}
}
func (r *HelmReleaseReconciler) recordReadiness(ctx context.Context, hr v2.HelmRelease) {
if r.MetricsRecorder == nil {
return
}
objRef, err := reference.GetReference(r.Scheme, &hr)
if err != nil {
ctrl.LoggerFrom(ctx).Error(err, "unable to record readiness metric")
return
}
if rc := apimeta.FindStatusCondition(hr.Status.Conditions, meta.ReadyCondition); rc != nil {
r.MetricsRecorder.RecordCondition(*objRef, *rc, !hr.DeletionTimestamp.IsZero())
} else {
r.MetricsRecorder.RecordCondition(*objRef, metav1.Condition{
Type: meta.ReadyCondition,
Status: metav1.ConditionUnknown,
}, !hr.DeletionTimestamp.IsZero())
}
}

View File

@ -1,260 +0,0 @@
/*
Copyright 2020 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 controllers
import (
"context"
"crypto/sha1"
"crypto/sha256"
"fmt"
"io"
"net/http"
"net/url"
"os"
"reflect"
"strings"
"github.com/fluxcd/pkg/runtime/acl"
"github.com/hashicorp/go-retryablehttp"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chart/loader"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
)
func (r *HelmReleaseReconciler) reconcileChart(ctx context.Context, hr *v2.HelmRelease) (*sourcev1.HelmChart, error) {
chartName := types.NamespacedName{
Namespace: hr.Spec.Chart.GetNamespace(hr.Namespace),
Name: hr.GetHelmChartName(),
}
if r.NoCrossNamespaceRef && chartName.Namespace != hr.Namespace {
return nil, acl.AccessDeniedError(fmt.Sprintf("can't access '%s/%s', cross-namespace references have been blocked",
hr.Spec.Chart.Spec.SourceRef.Kind, types.NamespacedName{
Namespace: hr.Spec.Chart.Spec.SourceRef.Namespace,
Name: hr.Spec.Chart.Spec.SourceRef.Name,
}))
}
// Garbage collect the previous HelmChart if the namespace named changed.
if hr.Status.HelmChart != "" && hr.Status.HelmChart != chartName.String() {
if err := r.deleteHelmChart(ctx, hr); err != nil {
return nil, err
}
}
// Continue with the reconciliation of the current template.
var helmChart sourcev1.HelmChart
err := r.Client.Get(ctx, chartName, &helmChart)
if err != nil && !apierrors.IsNotFound(err) {
return nil, err
}
hc := buildHelmChartFromTemplate(hr)
switch {
case apierrors.IsNotFound(err):
if err = r.Client.Create(ctx, hc); err != nil {
return nil, err
}
hr.Status.HelmChart = chartName.String()
return hc, nil
case helmChartRequiresUpdate(hr, &helmChart):
ctrl.LoggerFrom(ctx).Info("chart diverged from template", strings.ToLower(sourcev1.HelmChartKind), chartName.String())
helmChart.Spec = hc.Spec
if err = r.Client.Update(ctx, &helmChart); err != nil {
return nil, err
}
hr.Status.HelmChart = chartName.String()
}
return &helmChart, nil
}
// getHelmChart retrieves the v1beta2.HelmChart for the given
// v2beta1.HelmRelease using the name that is advertised in the status
// object. It returns the v1beta2.HelmChart, or an error.
func (r *HelmReleaseReconciler) getHelmChart(ctx context.Context, hr *v2.HelmRelease) (*sourcev1.HelmChart, error) {
namespace, name := hr.Status.GetHelmChart()
hc := &sourcev1.HelmChart{}
if err := r.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, hc); err != nil {
return nil, err
}
return hc, nil
}
// loadHelmChart attempts to download the artifact from the provided source,
// loads it into a chart.Chart, and removes the downloaded artifact.
// It returns the loaded chart.Chart on success, or an error.
func (r *HelmReleaseReconciler) loadHelmChart(source *sourcev1.HelmChart) (*chart.Chart, error) {
f, err := os.CreateTemp("", fmt.Sprintf("%s-%s-*.tgz", source.GetNamespace(), source.GetName()))
if err != nil {
return nil, err
}
defer f.Close()
defer os.Remove(f.Name())
artifactURL := source.GetArtifact().URL
if hostname := os.Getenv("SOURCE_CONTROLLER_LOCALHOST"); hostname != "" {
u, err := url.Parse(artifactURL)
if err != nil {
return nil, err
}
u.Host = hostname
artifactURL = u.String()
}
req, err := retryablehttp.NewRequest(http.MethodGet, artifactURL, nil)
if err != nil {
return nil, fmt.Errorf("failed to create a new request: %w", err)
}
resp, err := r.httpClient.Do(req)
if err != nil {
return nil, fmt.Errorf("failed to download artifact, error: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("artifact '%s' download failed (status code: %s)", source.GetArtifact().URL, resp.Status)
}
// verify checksum matches origin
if err := r.copyAndVerifyArtifact(source.GetArtifact(), resp.Body, f); err != nil {
return nil, err
}
return loader.Load(f.Name())
}
func (r *HelmReleaseReconciler) copyAndVerifyArtifact(artifact *sourcev1.Artifact, reader io.Reader, writer io.Writer) error {
hasher := sha256.New()
// for backwards compatibility with source-controller v0.17.2 and older
if len(artifact.Checksum) == 40 {
hasher = sha1.New()
}
// compute checksum
mw := io.MultiWriter(hasher, writer)
if _, err := io.Copy(mw, reader); err != nil {
return err
}
if checksum := fmt.Sprintf("%x", hasher.Sum(nil)); checksum != artifact.Checksum {
return fmt.Errorf("failed to verify artifact: computed checksum '%s' doesn't match advertised '%s'",
checksum, artifact.Checksum)
}
return nil
}
// deleteHelmChart deletes the v1beta2.HelmChart of the v2beta1.HelmRelease.
func (r *HelmReleaseReconciler) deleteHelmChart(ctx context.Context, hr *v2.HelmRelease) error {
if hr.Status.HelmChart == "" {
return nil
}
var hc sourcev1.HelmChart
chartNS, chartName := hr.Status.GetHelmChart()
err := r.Client.Get(ctx, types.NamespacedName{Namespace: chartNS, Name: chartName}, &hc)
if err != nil {
if apierrors.IsNotFound(err) {
hr.Status.HelmChart = ""
return nil
}
err = fmt.Errorf("failed to delete HelmChart '%s': %w", hr.Status.HelmChart, err)
return err
}
if err = r.Client.Delete(ctx, &hc); err != nil {
err = fmt.Errorf("failed to delete HelmChart '%s': %w", hr.Status.HelmChart, err)
return err
}
// Truncate the chart reference in the status object.
hr.Status.HelmChart = ""
return nil
}
// buildHelmChartFromTemplate builds a v1beta2.HelmChart from the
// v2beta1.HelmChartTemplate of the given v2beta1.HelmRelease.
func buildHelmChartFromTemplate(hr *v2.HelmRelease) *sourcev1.HelmChart {
template := hr.Spec.Chart
return &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: hr.GetHelmChartName(),
Namespace: hr.Spec.Chart.GetNamespace(hr.Namespace),
},
Spec: sourcev1.HelmChartSpec{
Chart: template.Spec.Chart,
Version: template.Spec.Version,
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: template.Spec.SourceRef.Name,
Kind: template.Spec.SourceRef.Kind,
},
Interval: template.GetInterval(hr.Spec.Interval),
ReconcileStrategy: template.Spec.ReconcileStrategy,
ValuesFiles: template.Spec.ValuesFiles,
ValuesFile: template.Spec.ValuesFile,
Verify: templateVerificationToSourceVerification(template.Spec.Verify),
},
}
}
// helmChartRequiresUpdate compares the v2beta1.HelmChartTemplate of the
// v2beta1.HelmRelease to the given v1beta2.HelmChart to determine if an
// update is required.
func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1.HelmChart) bool {
template := hr.Spec.Chart
switch {
case template.Spec.Chart != chart.Spec.Chart:
return true
// TODO(hidde): remove emptiness checks on next MINOR version
case template.Spec.Version == "" && chart.Spec.Version != "*",
template.Spec.Version != "" && template.Spec.Version != chart.Spec.Version:
return true
case template.Spec.SourceRef.Name != chart.Spec.SourceRef.Name:
return true
case template.Spec.SourceRef.Kind != chart.Spec.SourceRef.Kind:
return true
case template.GetInterval(hr.Spec.Interval) != chart.Spec.Interval:
return true
case template.Spec.ReconcileStrategy != chart.Spec.ReconcileStrategy:
return true
case !reflect.DeepEqual(template.Spec.ValuesFiles, chart.Spec.ValuesFiles):
return true
case template.Spec.ValuesFile != chart.Spec.ValuesFile:
return true
case !reflect.DeepEqual(templateVerificationToSourceVerification(template.Spec.Verify), chart.Spec.Verify):
return true
default:
return false
}
}
// templateVerificationToSourceVerification converts the HelmChartTemplateVerification to the OCIRepositoryVerification.
func templateVerificationToSourceVerification(template *v2.HelmChartTemplateVerification) *sourcev1.OCIRepositoryVerification {
if template == nil {
return nil
}
return &sourcev1.OCIRepositoryVerification{
Provider: template.Provider,
SecretRef: template.SecretRef,
}
}

View File

@ -1,533 +0,0 @@
/*
Copyright 2020 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 controllers
import (
"context"
"fmt"
"testing"
"time"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/go-logr/logr"
. "github.com/onsi/gomega"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
)
func TestHelmReleaseReconciler_reconcileChart(t *testing.T) {
tests := []struct {
name string
hr *v2.HelmRelease
hc *sourcev1.HelmChart
expectHelmChartStatus string
expectGC bool
expectErr bool
noCrossNamspaceRef bool
}{
{
name: "new HelmChart",
hr: &v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
Namespace: "default",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
Chart: "chart",
SourceRef: v2.CrossNamespaceObjectReference{
Name: "test-repository",
Kind: "HelmRepository",
},
},
},
},
},
hc: nil,
expectHelmChartStatus: "default/default-test-release",
},
{
name: "existing HelmChart",
hr: &v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
Namespace: "default",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
Chart: "chart",
SourceRef: v2.CrossNamespaceObjectReference{
Name: "test-repository",
Kind: "HelmRepository",
},
},
},
},
},
hc: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "default-test-release",
Namespace: "default",
},
Spec: sourcev1.HelmChartSpec{
Chart: "chart",
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: "test-repository",
Kind: "HelmRepository",
},
},
},
expectHelmChartStatus: "default/default-test-release",
},
{
name: "modified HelmChart",
hr: &v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
Namespace: "default",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
Chart: "chart",
SourceRef: v2.CrossNamespaceObjectReference{
Name: "test-repository",
Kind: "HelmRepository",
Namespace: "cross",
},
},
},
},
Status: v2.HelmReleaseStatus{
HelmChart: "default/default-test-release",
},
},
hc: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "default-test-release",
Namespace: "default",
},
Spec: sourcev1.HelmChartSpec{
Chart: "chart",
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: "test-repository",
Kind: "HelmRepository",
},
},
},
expectHelmChartStatus: "cross/default-test-release",
expectGC: true,
},
{
name: "block cross namespace access when flag is set",
hr: &v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
Namespace: "default",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
Chart: "chart",
SourceRef: v2.CrossNamespaceObjectReference{
Name: "test-repository",
Kind: "HelmRepository",
Namespace: "cross",
},
},
},
},
Status: v2.HelmReleaseStatus{
HelmChart: "",
},
},
noCrossNamspaceRef: true,
expectErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
g.Expect(v2.AddToScheme(scheme.Scheme)).To(Succeed())
g.Expect(sourcev1.AddToScheme(scheme.Scheme)).To(Succeed())
var c client.Client
if tt.hc != nil {
c = fake.NewFakeClientWithScheme(scheme.Scheme, tt.hc)
} else {
c = fake.NewFakeClientWithScheme(scheme.Scheme)
}
r := &HelmReleaseReconciler{
Client: c,
NoCrossNamespaceRef: tt.noCrossNamspaceRef,
}
hc, err := r.reconcileChart(logr.NewContext(context.TODO(), logr.Discard()), tt.hr)
if tt.expectErr {
g.Expect(err).To(HaveOccurred())
g.Expect(hc).To(BeNil())
} else {
g.Expect(err).NotTo(HaveOccurred())
g.Expect(hc).NotTo(BeNil())
}
g.Expect(tt.hr.Status.HelmChart).To(Equal(tt.expectHelmChartStatus))
if tt.expectGC {
objKey := client.ObjectKeyFromObject(tt.hc)
err = c.Get(context.TODO(), objKey, tt.hc.DeepCopy())
g.Expect(apierrors.IsNotFound(err)).To(BeTrue())
}
})
}
}
func TestHelmReleaseReconciler_deleteHelmChart(t *testing.T) {
tests := []struct {
name string
hc *sourcev1.HelmChart
hr *v2.HelmRelease
expectHelmChartStatus string
expectErr bool
}{
{
name: "delete existing HelmChart",
hc: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "test-chart",
Namespace: "default",
},
},
hr: &v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
},
Status: v2.HelmReleaseStatus{
HelmChart: "default/test-chart",
},
},
expectHelmChartStatus: "",
expectErr: false,
},
{
name: "delete already removed HelmChart",
hc: nil,
hr: &v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
},
Status: v2.HelmReleaseStatus{
HelmChart: "default/test-chart",
},
},
expectHelmChartStatus: "",
expectErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
g.Expect(v2.AddToScheme(scheme.Scheme)).To(Succeed())
g.Expect(sourcev1.AddToScheme(scheme.Scheme)).To(Succeed())
var c client.Client
if tt.hc != nil {
c = fake.NewFakeClientWithScheme(scheme.Scheme, tt.hc)
} else {
c = fake.NewFakeClientWithScheme(scheme.Scheme)
}
r := &HelmReleaseReconciler{
Client: c,
}
err := r.deleteHelmChart(context.TODO(), tt.hr)
if tt.expectErr {
g.Expect(err).To(HaveOccurred())
} else {
g.Expect(err).NotTo(HaveOccurred())
}
g.Expect(tt.hr.Status.HelmChart).To(Equal(tt.expectHelmChartStatus))
})
}
}
func Test_buildHelmChartFromTemplate(t *testing.T) {
hrWithChartTemplate := v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
Namespace: "default",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
Chart: "chart",
Version: "1.0.0",
SourceRef: v2.CrossNamespaceObjectReference{
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: &metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
}
tests := []struct {
name string
modify func(release *v2.HelmRelease)
want *sourcev1.HelmChart
}{
{
name: "builds HelmChart from HelmChartTemplate",
modify: func(*v2.HelmRelease) {},
want: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "default-test-release",
Namespace: "default",
},
Spec: sourcev1.HelmChartSpec{
Chart: "chart",
Version: "1.0.0",
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
{
name: "takes SourceRef namespace into account",
modify: func(hr *v2.HelmRelease) {
hr.Spec.Chart.Spec.SourceRef.Namespace = "cross"
},
want: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "default-test-release",
Namespace: "cross",
},
Spec: sourcev1.HelmChartSpec{
Chart: "chart",
Version: "1.0.0",
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
{
name: "falls back to HelmRelease interval",
modify: func(hr *v2.HelmRelease) {
hr.Spec.Chart.Spec.Interval = nil
},
want: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "default-test-release",
Namespace: "default",
},
Spec: sourcev1.HelmChartSpec{
Chart: "chart",
Version: "1.0.0",
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
{
name: "take cosign verification into account",
modify: func(hr *v2.HelmRelease) {
hr.Spec.Chart.Spec.Verify = &v2.HelmChartTemplateVerification{
Provider: "cosign",
SecretRef: &meta.LocalObjectReference{
Name: "cosign-key",
},
}
},
want: &sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: "default-test-release",
Namespace: "default",
},
Spec: sourcev1.HelmChartSpec{
Chart: "chart",
Version: "1.0.0",
SourceRef: sourcev1.LocalHelmChartSourceReference{
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
Verify: &sourcev1.OCIRepositoryVerification{
Provider: "cosign",
SecretRef: &meta.LocalObjectReference{
Name: "cosign-key",
},
},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
hr := hrWithChartTemplate.DeepCopy()
tt.modify(hr)
g.Expect(buildHelmChartFromTemplate(hr)).To(Equal(tt.want))
})
}
}
func Test_helmChartRequiresUpdate(t *testing.T) {
hrWithChartTemplate := v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test-release",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
Chart: "chart",
Version: "1.0.0",
SourceRef: v2.CrossNamespaceObjectReference{
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: &metav1.Duration{Duration: 2 * time.Minute},
Verify: &v2.HelmChartTemplateVerification{
Provider: "cosign",
},
},
},
},
}
tests := []struct {
name string
modify func(*v2.HelmRelease, *sourcev1.HelmChart)
want bool
}{
{
name: "detects no change",
modify: func(*v2.HelmRelease, *sourcev1.HelmChart) {},
want: false,
},
{
name: "detects chart change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.Chart = "new"
},
want: true,
},
{
name: "detects version change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.Version = "2.0.0"
},
want: true,
},
{
name: "detects chart source name change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.SourceRef.Name = "new"
},
want: true,
},
{
name: "detects chart source kind change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.SourceRef.Kind = "GitRepository"
},
want: true,
},
{
name: "detects interval change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.Interval = nil
},
want: true,
},
{
name: "detects reconcile strategy change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.ReconcileStrategy = "Revision"
},
want: true,
},
{
name: "detects values files change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.ValuesFiles = []string{"values-prod.yaml"}
},
want: true,
},
{
name: "detects values file change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.ValuesFile = "values-prod.yaml"
},
want: true,
},
{
name: "detects verify change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.Verify.Provider = "foo-bar"
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
hr := hrWithChartTemplate.DeepCopy()
hc := buildHelmChartFromTemplate(hr)
// second copy to avoid modifying the original
hr = hrWithChartTemplate.DeepCopy()
g.Expect(helmChartRequiresUpdate(hr, hc)).To(Equal(false))
tt.modify(hr, hc)
fmt.Println("verify", hr.Spec.Chart.Spec.Verify.Provider, hc.Spec.Verify.Provider)
g.Expect(helmChartRequiresUpdate(hr, hc)).To(Equal(tt.want))
})
}
}

View File

@ -1,685 +0,0 @@
/*
Copyright 2020 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 controllers
import (
"context"
"reflect"
"strings"
"testing"
"time"
"github.com/go-logr/logr"
"helm.sh/helm/v3/pkg/chartutil"
corev1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"sigs.k8s.io/yaml"
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
)
func TestHelmReleaseReconciler_composeValues(t *testing.T) {
scheme := runtime.NewScheme()
_ = corev1.AddToScheme(scheme)
_ = v2.AddToScheme(scheme)
tests := []struct {
name string
resources []runtime.Object
references []v2.ValuesReference
values string
want chartutil.Values
wantErr bool
}{
{
name: "merges",
resources: []runtime.Object{
valuesConfigMap("values", map[string]string{
"values.yaml": `flat: value
nested:
configuration: value
`,
}),
valuesSecret("values", map[string][]byte{
"values.yaml": []byte(`flat:
nested: value
nested: value
`),
}),
},
references: []v2.ValuesReference{
{
Kind: "ConfigMap",
Name: "values",
},
{
Kind: "Secret",
Name: "values",
},
},
values: `
other: values
`,
want: chartutil.Values{
"flat": map[string]interface{}{
"nested": "value",
},
"nested": "value",
"other": "values",
},
},
{
name: "target path",
resources: []runtime.Object{
valuesSecret("values", map[string][]byte{"single": []byte("value")}),
},
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "single",
TargetPath: "merge.at.specific.path",
},
},
want: chartutil.Values{
"merge": map[string]interface{}{
"at": map[string]interface{}{
"specific": map[string]interface{}{
"path": "value",
},
},
},
},
},
{
name: "target path with boolean value",
resources: []runtime.Object{
valuesSecret("values", map[string][]byte{"single": []byte("true")}),
},
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "single",
TargetPath: "merge.at.specific.path",
},
},
want: chartutil.Values{
"merge": map[string]interface{}{
"at": map[string]interface{}{
"specific": map[string]interface{}{
"path": true,
},
},
},
},
},
{
name: "target path with set-string behavior",
resources: []runtime.Object{
valuesSecret("values", map[string][]byte{"single": []byte("\"true\"")}),
},
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "single",
TargetPath: "merge.at.specific.path",
},
},
want: chartutil.Values{
"merge": map[string]interface{}{
"at": map[string]interface{}{
"specific": map[string]interface{}{
"path": "true",
},
},
},
},
},
{
name: "values reference to non existing secret",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "missing",
},
},
wantErr: true,
},
{
name: "optional values reference to non existing secret",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "missing",
Optional: true,
},
},
want: chartutil.Values{},
wantErr: false,
},
{
name: "values reference to non existing config map",
references: []v2.ValuesReference{
{
Kind: "ConfigMap",
Name: "missing",
},
},
wantErr: true,
},
{
name: "optional values reference to non existing config map",
references: []v2.ValuesReference{
{
Kind: "ConfigMap",
Name: "missing",
Optional: true,
},
},
want: chartutil.Values{},
wantErr: false,
},
{
name: "missing secret key",
resources: []runtime.Object{
valuesSecret("values", nil),
},
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "nonexisting",
},
},
wantErr: true,
},
{
name: "missing config map key",
resources: []runtime.Object{
valuesConfigMap("values", nil),
},
references: []v2.ValuesReference{
{
Kind: "ConfigMap",
Name: "values",
ValuesKey: "nonexisting",
},
},
wantErr: true,
},
{
name: "unsupported values reference kind",
references: []v2.ValuesReference{
{
Kind: "Unsupported",
},
},
wantErr: true,
},
{
name: "invalid values",
resources: []runtime.Object{
valuesConfigMap("values", map[string]string{
"values.yaml": `
invalid`,
}),
},
references: []v2.ValuesReference{
{
Kind: "ConfigMap",
Name: "values",
},
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := fake.NewFakeClientWithScheme(scheme, tt.resources...)
r := &HelmReleaseReconciler{Client: c}
var values *apiextensionsv1.JSON
if tt.values != "" {
v, _ := yaml.YAMLToJSON([]byte(tt.values))
values = &apiextensionsv1.JSON{Raw: v}
}
hr := v2.HelmRelease{
Spec: v2.HelmReleaseSpec{
ValuesFrom: tt.references,
Values: values,
},
}
got, err := r.composeValues(logr.NewContext(context.TODO(), logr.Discard()), hr)
if (err != nil) != tt.wantErr {
t.Errorf("composeValues() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("composeValues() got = %v, want %v", got, tt.want)
}
})
}
}
func TestValuesReferenceValidation(t *testing.T) {
tests := []struct {
name string
references []v2.ValuesReference
wantErr bool
}{
{
name: "valid ValuesKey",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "any-key_na.me",
},
},
wantErr: false,
},
{
name: "valid ValuesKey: empty",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "",
},
},
wantErr: false,
},
{
name: "valid ValuesKey: long",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: strings.Repeat("a", 253),
},
},
wantErr: false,
},
{
name: "invalid ValuesKey",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "a($&^%b",
},
},
wantErr: true,
},
{
name: "invalid ValuesKey: too long",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: strings.Repeat("a", 254),
},
},
wantErr: true,
},
{
name: "valid target path: empty",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
TargetPath: "",
},
},
wantErr: false,
},
{
name: "valid target path",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
TargetPath: "list_with.nested-values.and.index[0]",
},
},
wantErr: false,
},
{
name: "valid target path: long",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
TargetPath: strings.Repeat("a", 250),
},
},
wantErr: false,
},
{
name: "invalid target path: too long",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
TargetPath: strings.Repeat("a", 251),
},
},
wantErr: true,
},
{
name: "invalid target path: opened index",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "single",
TargetPath: "a[",
},
},
wantErr: true,
},
{
name: "invalid target path: incorrect index syntax",
references: []v2.ValuesReference{
{
Kind: "Secret",
Name: "values",
ValuesKey: "single",
TargetPath: "a]0[",
},
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var values *apiextensionsv1.JSON
v, _ := yaml.YAMLToJSON([]byte("values"))
values = &apiextensionsv1.JSON{Raw: v}
hr := v2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Namespace: "default",
},
Spec: v2.HelmReleaseSpec{
Interval: metav1.Duration{Duration: 5 * time.Minute},
Chart: v2.HelmChartTemplate{
Spec: v2.HelmChartTemplateSpec{
SourceRef: v2.CrossNamespaceObjectReference{
Name: "something",
},
},
},
ValuesFrom: tt.references,
Values: values,
},
}
err := k8sClient.Create(context.TODO(), &hr, client.DryRunAll)
if (err != nil) != tt.wantErr {
t.Errorf("composeValues() error = %v, wantErr %v", err, tt.wantErr)
return
}
})
}
}
func FuzzHelmReleaseReconciler_composeValues(f *testing.F) {
scheme := testScheme()
tests := []struct {
targetPath string
valuesKey string
hrValues string
createObject bool
secretData []byte
configData string
}{
{
targetPath: "flat",
valuesKey: "custom-values.yaml",
secretData: []byte(`flat:
nested: value
nested: value
`),
configData: `flat: value
nested:
configuration: value
`,
hrValues: `
other: values
`,
createObject: true,
},
{
targetPath: "'flat'",
valuesKey: "custom-values.yaml",
secretData: []byte(`flat:
nested: value
nested: value
`),
configData: `flat: value
nested:
configuration: value
`,
hrValues: `
other: values
`,
createObject: true,
},
{
targetPath: "flat[0]",
secretData: []byte(``),
configData: `flat: value`,
hrValues: `
other: values
`,
createObject: true,
},
{
secretData: []byte(`flat:
nested: value
nested: value
`),
configData: `flat: value
nested:
configuration: value
`,
hrValues: `
other: values
`,
createObject: true,
},
{
targetPath: "some-value",
hrValues: `
other: values
`,
createObject: false,
},
}
for _, tt := range tests {
f.Add(tt.targetPath, tt.valuesKey, tt.hrValues, tt.createObject, tt.secretData, tt.configData)
}
f.Fuzz(func(t *testing.T,
targetPath, valuesKey, hrValues string, createObject bool, secretData []byte, configData string) {
// objectName represents a core Kubernetes name (Secret/ConfigMap) which is validated
// upstream, and also validated by us in the OpenAPI-based validation set in
// v2.ValuesReference. Therefore a static value here suffices, and instead we just
// play with the objects presence/absence.
objectName := "values"
resources := []runtime.Object{}
if createObject {
resources = append(resources,
valuesConfigMap(objectName, map[string]string{valuesKey: configData}),
valuesSecret(objectName, map[string][]byte{valuesKey: secretData}),
)
}
references := []v2.ValuesReference{
{
Kind: "ConfigMap",
Name: objectName,
ValuesKey: valuesKey,
TargetPath: targetPath,
},
{
Kind: "Secret",
Name: objectName,
ValuesKey: valuesKey,
TargetPath: targetPath,
},
}
c := fake.NewFakeClientWithScheme(scheme, resources...)
r := &HelmReleaseReconciler{Client: c}
var values *apiextensionsv1.JSON
if hrValues != "" {
v, _ := yaml.YAMLToJSON([]byte(hrValues))
values = &apiextensionsv1.JSON{Raw: v}
}
hr := v2.HelmRelease{
Spec: v2.HelmReleaseSpec{
ValuesFrom: references,
Values: values,
},
}
// OpenAPI-based validation on schema is not verified here.
// Therefore some false positives may be arise, as the apiserver
// would not allow such values to make their way into the control plane.
//
// Testenv could be used so the fuzzing covers the entire E2E.
// The downsize being the resource and time cost per test would be a lot higher.
//
// Another approach could be to add validation to reject invalid inputs before
// the r.composeValues call.
_, _ = r.composeValues(logr.NewContext(context.TODO(), logr.Discard()), hr)
})
}
func FuzzHelmReleaseReconciler_reconcile(f *testing.F) {
scheme := testScheme()
tests := []struct {
valuesKey string
hrValues string
secretData []byte
configData string
}{
{
valuesKey: "custom-values.yaml",
secretData: []byte(`flat:
nested: value
nested: value
`),
configData: `flat: value
nested:
configuration: value
`,
hrValues: `
other: values
`,
},
}
for _, tt := range tests {
f.Add(tt.valuesKey, tt.hrValues, tt.secretData, tt.configData)
}
f.Fuzz(func(t *testing.T,
valuesKey, hrValues string, secretData []byte, configData string) {
var values *apiextensionsv1.JSON
if hrValues != "" {
v, _ := yaml.YAMLToJSON([]byte(hrValues))
values = &apiextensionsv1.JSON{Raw: v}
}
hr := v2.HelmRelease{
Spec: v2.HelmReleaseSpec{
Values: values,
},
}
hc := sourcev1.HelmChart{}
hc.ObjectMeta.Name = hr.GetHelmChartName()
hc.ObjectMeta.Namespace = hr.Spec.Chart.GetNamespace(hr.Namespace)
resources := []runtime.Object{
valuesConfigMap("values", map[string]string{valuesKey: configData}),
valuesSecret("values", map[string][]byte{valuesKey: secretData}),
&hc,
}
c := fake.NewFakeClientWithScheme(scheme, resources...)
r := &HelmReleaseReconciler{
Client: c,
EventRecorder: &DummyRecorder{},
}
_, _, _ = r.reconcile(logr.NewContext(context.TODO(), logr.Discard()), hr)
})
}
func valuesSecret(name string, data map[string][]byte) *corev1.Secret {
return &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: name},
Data: data,
}
}
func valuesConfigMap(name string, data map[string]string) *corev1.ConfigMap {
return &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{Name: name},
Data: data,
}
}
func testScheme() *runtime.Scheme {
scheme := runtime.NewScheme()
_ = corev1.AddToScheme(scheme)
_ = v2.AddToScheme(scheme)
_ = sourcev1.AddToScheme(scheme)
return scheme
}
// DummyRecorder serves as a dummy for kuberecorder.EventRecorder.
type DummyRecorder struct{}
func (r *DummyRecorder) Event(object runtime.Object, eventtype, reason, message string) {
}
func (r *DummyRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) {
}
func (r *DummyRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string,
eventtype, reason string, messageFmt string, args ...interface{}) {
}

View File

@ -1,64 +0,0 @@
/*
Copyright 2020 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 controllers
import (
"fmt"
"os"
"path/filepath"
"testing"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"github.com/fluxcd/helm-controller/api/v2beta1"
// +kubebuilder:scaffold:imports
)
var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
func TestMain(m *testing.M) {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
}
var err error
cfg, err = testEnv.Start()
if err != nil {
panic(fmt.Errorf("failed to start testenv: %v", err))
}
utilruntime.Must(v2beta1.AddToScheme(scheme.Scheme))
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
if err != nil {
panic(fmt.Errorf("failed to create k8s client: %v", err))
}
code := m.Run()
err = testEnv.Stop()
if err != nil {
panic(fmt.Errorf("failed to stop testenv: %v", err))
}
os.Exit(code)
}

3086
docs/api/v2/helm.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
<h1>HelmRelease API reference</h1>
<h1>Helm API reference v2beta1</h1>
<p>Packages:</p>
<ul class="simple">
<li>
@ -92,15 +92,17 @@ Kubernetes meta/v1.Duration
</em>
</td>
<td>
<p>Interval at which to reconcile the Helm release.</p>
<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>
</td>
</tr>
<tr>
<td>
<code>kubeConfig</code><br>
<em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.KubeConfig">
KubeConfig
<a href="https://godoc.org/github.com/fluxcd/pkg/apis/meta#KubeConfigReference">
github.com/fluxcd/pkg/apis/meta.KubeConfigReference
</a>
</em>
</td>
@ -226,6 +228,26 @@ when reconciling this HelmRelease.</p>
</tr>
<tr>
<td>
<code>persistentClient</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>PersistentClient tells the controller to use a persistent Kubernetes
client for this release. When enabled, the client will be reused for the
duration of the reconciliation, instead of being created and destroyed
for each (step of a) Helm action.</p>
<p>This can improve performance, but may cause issues with some Helm charts
that for example do create Custom Resource Definitions during installation
outside Helm&rsquo;s CRD lifecycle hooks, which are then not observed to be
available by e.g. post-install hooks.</p>
<p>If not set, it defaults to true.</p>
</td>
</tr>
<tr>
<td>
<code>install</code><br>
<em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.Install">
@ -457,6 +479,20 @@ v1beta2.Source.</p>
<tbody>
<tr>
<td>
<code>metadata</code><br>
<em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateObjectMeta">
HelmChartTemplateObjectMeta
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>ObjectMeta holds the template for metadata like labels and annotations.</p>
</td>
</tr>
<tr>
<td>
<code>spec</code><br>
<em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateSpec">
@ -591,6 +627,57 @@ Chart dependencies, which are not bundled in the umbrella chart artifact, are no
</table>
</div>
</div>
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateObjectMeta">HelmChartTemplateObjectMeta
</h3>
<p>
(<em>Appears on:</em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate">HelmChartTemplate</a>)
</p>
<p>HelmChartTemplateObjectMeta defines the template for the ObjectMeta of a
v1beta2.HelmChart.</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>labels</code><br>
<em>
map[string]string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Map of string keys and values that can be used to organize and categorize
(scope and select) objects.
More info: <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/</a></p>
</td>
</tr>
<tr>
<td>
<code>annotations</code><br>
<em>
map[string]string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Annotations is an unstructured key value map stored with a resource that may be
set by external tools to store and retrieve arbitrary metadata. They are not
queryable and should be preserved when modifying objects.
More info: <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/">https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/</a></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateSpec">HelmChartTemplateSpec
</h3>
<p>
@ -816,15 +903,17 @@ Kubernetes meta/v1.Duration
</em>
</td>
<td>
<p>Interval at which to reconcile the Helm release.</p>
<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>
</td>
</tr>
<tr>
<td>
<code>kubeConfig</code><br>
<em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.KubeConfig">
KubeConfig
<a href="https://godoc.org/github.com/fluxcd/pkg/apis/meta#KubeConfigReference">
github.com/fluxcd/pkg/apis/meta.KubeConfigReference
</a>
</em>
</td>
@ -950,6 +1039,26 @@ when reconciling this HelmRelease.</p>
</tr>
<tr>
<td>
<code>persistentClient</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>PersistentClient tells the controller to use a persistent Kubernetes
client for this release. When enabled, the client will be reused for the
duration of the reconciliation, instead of being created and destroyed
for each (step of a) Helm action.</p>
<p>This can improve performance, but may cause issues with some Helm charts
that for example do create Custom Resource Definitions during installation
outside Helm&rsquo;s CRD lifecycle hooks, which are then not observed to be
available by e.g. post-install hooks.</p>
<p>If not set, it defaults to true.</p>
</td>
</tr>
<tr>
<td>
<code>install</code><br>
<em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.Install">
@ -1460,48 +1569,6 @@ no retries remain. Defaults to &lsquo;false&rsquo;.</p>
</table>
</div>
</div>
<h3 id="helm.toolkit.fluxcd.io/v2beta1.KubeConfig">KubeConfig
</h3>
<p>
(<em>Appears on:</em>
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
</p>
<p>KubeConfig references a Kubernetes secret that contains a kubeconfig file.</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>secretRef</code><br>
<em>
<a href="https://godoc.org/github.com/fluxcd/pkg/apis/meta#SecretKeyReference">
github.com/fluxcd/pkg/apis/meta.SecretKeyReference
</a>
</em>
</td>
<td>
<p>SecretRef holds the name to a secret that contains a key with
the kubeconfig file as the value. If no key is specified the key will
default to &lsquo;value&rsquo;. The secret must be in the same namespace as
the HelmRelease.
It is recommended that the kubeconfig is self-contained, and the secret
is regularly updated if credentials such as a cloud-access-token expire.
Cloud specific <code>cmd-path</code> auth helpers will not function without adding
binaries and credentials to the Pod that is responsible for reconciling
the HelmRelease.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Kustomize">Kustomize
</h3>
<p>
@ -1877,6 +1944,19 @@ 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>

3001
docs/api/v2beta2/helm.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@ 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
@ -50,7 +51,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/v2beta1](./v2beta1/helmreleases.md).
The API design of the controller can be found at [helm.toolkit.fluxcd.io/v2](./v2/helmreleases.md).
## Backward compatibility

16
docs/spec/v2/README.md Normal file
View File

@ -0,0 +1,16 @@
# 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/)

2016
docs/spec/v2/helmreleases.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -809,7 +809,7 @@ spec:
When the controller completes a reconciliation, it reports the result in the status sub-resource.
The following `status.condtions` types are advertised. Here, "desired state" is as detailed in
The following `status.conditions` types are advertised. Here, "desired state" is as detailed in
[reconciliation](#reconciliation):
* `Ready` - status of the last reconciliation attempt

View File

@ -1,5 +1,7 @@
# Helm Releases
<!-- menuweight:20 -->
The `HelmRelease` API defines a resource for automated controller driven Helm releases.
## Specification
@ -18,6 +20,8 @@ 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"`
@ -66,6 +70,21 @@ type HelmReleaseSpec struct {
// +optional
MaxHistory *int `json:"maxHistory,omitempty"`
// PersistentClient tells the controller to use a persistent Kubernetes
// client for this release. When enabled, the client will be reused for the
// duration of the reconciliation, instead of being created and destroyed
// for each (step of a) Helm action.
//
// This can improve performance, but may cause issues with some Helm charts
// that for example do create Custom Resource Definitions during installation
// outside Helm's CRD lifecycle hooks, which are then not observed to be
// available by e.g. post-install hooks.
//
// If not set, it defaults to true.
//
// +optional
PersistentClient *bool `json:"persistentClient,omitempty"`
// Install holds the configuration for Helm install actions for this HelmRelease.
// +optional
Install *Install `json:"install,omitempty"`
@ -134,11 +153,32 @@ type KubeConfig struct {
// generate a v1beta1.HelmChart object in the same namespace as the referenced
// v1beta1.Source.
type HelmChartTemplate struct {
// ObjectMeta holds the template for metadata like labels and annotations.
// +optional
ObjectMeta *HelmChartTemplateObjectMeta `json:"metadata,omitempty"`
// Spec holds the template for the v1beta1.HelmChartSpec for this HelmRelease.
// +required
Spec HelmChartTemplateSpec `json:"spec"`
}
// HelmChartTemplateObjectMeta defines the template for the ObjectMeta of a
// v1beta2.HelmChart.
type HelmChartTemplateObjectMeta struct {
// Map of string keys and values that can be used to organize and categorize
// (scope and select) objects.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
// HelmChartTemplateSpec defines the template from which the controller will
// generate a v1beta1.HelmChartSpec object.
type HelmChartTemplateSpec struct {
@ -444,6 +484,13 @@ 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.
@ -681,7 +728,7 @@ of the `HelmRelease`. These can be overridden respectively via `spec.targetNames
## Helm chart template
The `spec.chart.spec` values are used by the helm-controller as a template
The `spec.chart` values are used by the helm-controller as a template
to create a new `HelmChart` resource with the given spec.
The `spec.chart.spec.sourceRef` is a reference to an object managed by
@ -699,8 +746,8 @@ The `HelmChart` is created in the same namespace as the `sourceRef`,
with a name matching the `HelmRelease` `<metadata.namespace>-<metadata.name>`.
> **Note** that on multi-tenant clusters, platform admins can disable cross-namespace references
> with the `--no-cross-namespace-refs=true` flag. When this flag is set, the helmrelease can only
> refer to sources in the same namespace as the helmrelease object.
> with the `--no-cross-namespace-refs=true` flag. When this flag is set, the HelmRelease can only
> refer to sources in the same namespace as the HelmRelease object.
The `chart.spec.chart` can either contain:
@ -713,6 +760,9 @@ The `chart.spec.version` can be a fixed semver, or any semver range
(i.e. `>=4.0.0 <5.0.0`). It is ignored for `HelmRelease` resources
that reference a `GitRepository` or `Bucket` source.
Annotations and labels can be added by configuring the respective `.spec.chart.metadata`
fields.
## Values overrides
The simplest way to define values overrides is inline via `spec.values`.
@ -774,6 +824,11 @@ 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:
@ -972,7 +1027,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 namespeced objects (deployments, ingresses, etc).
(cluster roles, cluster role binding, CRDs, etc) and namespaced 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.
@ -1270,11 +1325,104 @@ spec:
crds: CreateReplace
```
## Drift detection
**Note:** This feature is experimental and can be enabled by setting `--feature-gates=DetectDrift=true`.
When a HelmRelease is in-sync with the Helm release object in the storage, the controller will
compare the manifests from the Helm storage with the current state of the cluster using a
[server-side dry-run apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/).
If this comparison detects a drift (either due resource being created or modified during the
dry-run), the controller will perform an upgrade for the release, restoring the desired state.
To help aid transition to this new feature, it is possible to enable drift detection without it
correcting drift. This can be done by adding `CorrectDrift=false` to the `--feature-gates` flag,
i.e. `--feature-gates=DetectDrift=true,CorrectDrift=false`. This will allow you to see what drift
is detected in the controller logs (with `--log-level=debug`), to potentially add the appropriate
[exclusions annotations or labels](#excluding-resources-from-drift-detection), before enabling the
feature full.
### Excluding resources from drift detection
The drift detection feature can be configured to exclude certain resources from the comparison
by labeling or annotating them with `helm.toolkit.fluxcd.io/driftDetection: disabled`. Using
[post-renderers](#post-renderers), this can be applied to any resource rendered by Helm.
```yaml
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: app
namespace: webapp
spec:
postRenderers:
- kustomize:
patches:
- target:
version: v1
kind: Deployment
name: my-app
patch: |
- op: add
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection
value: disabled
```
**Note:** For some charts, we have observed the drift detection feature can detect spurious
changes due to Helm not properly patching an object, which seems to be related to
[Helm#5915](https://github.com/helm/helm/issues/5915) and issues alike. In this case (and
when possible for your workload), configuring `.spec.upgrade.force` to `true` might be a
more fitting solution than ignoring the object in full.
#### Drift exclusion example Prometheus Stack
```yaml
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: kube-prometheus-stack
spec:
interval: 5m
chart:
spec:
version: "45.x"
chart: kube-prometheus-stack
sourceRef:
kind: HelmRepository
name: prometheus-community
interval: 60m
upgrade:
crds: CreateReplace
# Force recreation due to Helm not properly patching Deployment with e.g. added port,
# causing spurious drift detection
force: true
postRenderers:
- kustomize:
patches:
- target:
# Ignore these objects from Flux diff as they are mutated from chart hooks
kind: (ValidatingWebhookConfiguration|MutatingWebhookConfiguration)
name: kube-prometheus-stack-admission
patch: |
- op: add
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection
value: disabled
- target:
# Ignore these objects from Flux diff as they are mutated at apply time but not
# at dry-run time
kind: PrometheusRule
patch: |
- op: add
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection
value: disabled
```
## Status
When the controller completes a reconciliation, it reports the result in the status sub-resource.
The following `status.condtions` types are advertised. Here, "desired state" is as detailed in
The following `status.conditions` types are advertised. Here, "desired state" is as detailed in
[reconciliation](#reconciliation):
- `Ready` - status of the last reconciliation attempt

Some files were not shown because too many files have changed in this diff Show More