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>
(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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>