From 32306bc971951f9c4be6ee0b932dcdadef41b15b Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 6 May 2024 11:21:38 +0300 Subject: [PATCH] Update API version in comments and docs Signed-off-by: Stefan Prodan --- docs/spec/README.md | 2 +- internal/action/install.go | 4 ++-- internal/action/rollback.go | 2 +- internal/action/test.go | 4 ++-- internal/action/uninstall.go | 4 ++-- internal/action/upgrade.go | 4 ++-- internal/action/verify.go | 4 ++-- internal/controller/helmrelease_controller.go | 6 +++--- internal/reconcile/helmchart_template.go | 8 ++++---- internal/reconcile/state.go | 12 ++++++------ internal/reconcile/unlock.go | 2 +- internal/release/observation.go | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/spec/README.md b/docs/spec/README.md index 826f2817a..3c481b43d 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -51,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/v2beta2](./v2beta2/helmreleases.md). +The API design of the controller can be found at [helm.toolkit.fluxcd.io/v2](./v2/helmreleases.md). ## Backward compatibility diff --git a/internal/action/install.go b/internal/action/install.go index 840c77019..9584005ff 100644 --- a/internal/action/install.go +++ b/internal/action/install.go @@ -32,12 +32,12 @@ import ( ) // InstallOption can be used to modify Helm's action.Install after the instructions -// from the v2beta2.HelmRelease have been applied. This is for example useful to +// from the v2.HelmRelease have been applied. This is for example useful to // enable the dry-run setting as a CLI. type InstallOption func(action *helmaction.Install) // Install runs the Helm install action with the provided config, using the -// v2beta2.HelmReleaseSpec of the given object to determine the target release +// v2.HelmReleaseSpec of the given object to determine the target release // and rollback configuration. // // It performs the installation according to the spec, which includes installing diff --git a/internal/action/rollback.go b/internal/action/rollback.go index c626d1021..559cb5dfb 100644 --- a/internal/action/rollback.go +++ b/internal/action/rollback.go @@ -23,7 +23,7 @@ import ( ) // RollbackOption can be used to modify Helm's action.Rollback after the -// instructions from the v2beta2.HelmRelease have been applied. This is for +// instructions from the v2.HelmRelease have been applied. This is for // example useful to enable the dry-run setting as a CLI. type RollbackOption func(*helmaction.Rollback) diff --git a/internal/action/test.go b/internal/action/test.go index 2750f4941..a469443b8 100644 --- a/internal/action/test.go +++ b/internal/action/test.go @@ -26,12 +26,12 @@ import ( ) // TestOption can be used to modify Helm's action.ReleaseTesting after the -// instructions from the v2beta2.HelmRelease have been applied. This is for +// instructions from the v2.HelmRelease have been applied. This is for // example useful to enable the dry-run setting as a CLI. type TestOption func(action *helmaction.ReleaseTesting) // Test runs the Helm test action with the provided config, using the -// v2beta2.HelmReleaseSpec of the given object to determine the target release +// v2.HelmReleaseSpec of the given object to determine the target release // and test configuration. // // It does not determine if there is a desire to perform the action, this is diff --git a/internal/action/uninstall.go b/internal/action/uninstall.go index e7dd60cfd..8afbc4e6f 100644 --- a/internal/action/uninstall.go +++ b/internal/action/uninstall.go @@ -26,12 +26,12 @@ import ( ) // UninstallOption can be used to modify Helm's action.Uninstall after the -// instructions from the v2beta2.HelmRelease have been applied. This is for +// instructions from the v2.HelmRelease have been applied. This is for // example useful to enable the dry-run setting as a CLI. type UninstallOption func(cfg *helmaction.Uninstall) // Uninstall runs the Helm uninstall action with the provided config, using the -// v2beta2.HelmReleaseSpec of the given object to determine the target release +// v2.HelmReleaseSpec of the given object to determine the target release // and uninstall configuration. // // It does not determine if there is a desire to perform the action, this is diff --git a/internal/action/upgrade.go b/internal/action/upgrade.go index 5ca9965ca..9901d7adc 100644 --- a/internal/action/upgrade.go +++ b/internal/action/upgrade.go @@ -32,12 +32,12 @@ import ( ) // UpgradeOption can be used to modify Helm's action.Upgrade after the instructions -// from the v2beta2.HelmRelease have been applied. This is for example useful to +// from the v2.HelmRelease have been applied. This is for example useful to // enable the dry-run setting as a CLI. type UpgradeOption func(upgrade *helmaction.Upgrade) // Upgrade runs the Helm upgrade action with the provided config, using the -// v2beta2.HelmReleaseSpec of the given object to determine the target release +// v2.HelmReleaseSpec of the given object to determine the target release // and upgrade configuration. // // It performs the upgrade according to the spec, which includes upgrading the diff --git a/internal/action/verify.go b/internal/action/verify.go index f5a2271cc..e21c63fe6 100644 --- a/internal/action/verify.go +++ b/internal/action/verify.go @@ -90,7 +90,7 @@ func LastRelease(config *helmaction.Configuration, releaseName string) (*helmrel return rls, nil } -// VerifySnapshot verifies the data of the given v2beta2.Snapshot +// VerifySnapshot verifies the data of the given v2.Snapshot // matches the release object in the Helm storage. It returns the verified // release, or an error of type ErrReleaseNotFound, ErrReleaseDisappeared, // ErrReleaseDigest or ErrReleaseNotObserved indicating the reason for the @@ -114,7 +114,7 @@ func VerifySnapshot(config *helmaction.Configuration, snapshot *v2.Snapshot) (rl return rls, nil } -// VerifyReleaseObject verifies the data of the given v2beta2.Snapshot +// VerifyReleaseObject verifies the data of the given v2.Snapshot // matches the given Helm release object. It returns an error of type // ErrReleaseDigest or ErrReleaseNotObserved indicating the reason for the // verification failure, or nil. diff --git a/internal/controller/helmrelease_controller.go b/internal/controller/helmrelease_controller.go index b9bdcfb31..c476486b8 100644 --- a/internal/controller/helmrelease_controller.go +++ b/internal/controller/helmrelease_controller.go @@ -424,7 +424,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, patchHelpe return jitter.JitteredRequeueInterval(ctrl.Result{RequeueAfter: obj.GetRequeueAfter()}), nil } -// reconcileDelete deletes the v1beta2.HelmChart of the v2beta2.HelmRelease, +// reconcileDelete deletes the v1beta2.HelmChart of the v2.HelmRelease, // and uninstalls the Helm release if the resource has not been suspended. func (r *HelmReleaseReconciler) reconcileDelete(ctx context.Context, obj *v2.HelmRelease) (ctrl.Result, error) { // Only uninstall the release and delete the HelmChart resource if the @@ -566,7 +566,7 @@ func (r *HelmReleaseReconciler) reconcileUninstall(ctx context.Context, getter g return intreconcile.NewUninstall(cfg, r.EventRecorder).Reconcile(ctx, &intreconcile.Request{Object: obj}) } -// checkDependencies checks if the dependencies of the given v2beta2.HelmRelease +// checkDependencies checks if the dependencies of the given v2.HelmRelease // are Ready. // It returns an error if a dependency can not be retrieved or is not Ready, // otherwise nil. @@ -730,7 +730,7 @@ func (r *HelmReleaseReconciler) getSourceFromOCIRef(ctx context.Context, obj *v2 // waitForHistoryCacheSync returns a function that can be used to wait for the // cache backing the Kubernetes client to be in sync with the current state of -// the v2beta2.HelmRelease. +// the v2.HelmRelease. // This is a trade-off between not caching at all, and introducing a slight // delay to ensure we always have the latest history state. func (r *HelmReleaseReconciler) waitForHistoryCacheSync(obj *v2.HelmRelease) wait.ConditionWithContextFunc { diff --git a/internal/reconcile/helmchart_template.go b/internal/reconcile/helmchart_template.go index 4d3bba3a4..6529bf206 100644 --- a/internal/reconcile/helmchart_template.go +++ b/internal/reconcile/helmchart_template.go @@ -43,22 +43,22 @@ import ( // based on the given Request data. // // It does this by building a v1beta2.HelmChart from the template declared in -// the v2beta2.HelmRelease, and then reconciling that v1beta2.HelmChart using +// the v2.HelmRelease, and then reconciling that v1beta2.HelmChart using // a server-side apply. // // When the server-side apply succeeds, the namespaced name of the chart is -// written to the Status.HelmChart field of the v2beta2.HelmRelease. If the +// written to the Status.HelmChart field of the v2.HelmRelease. If the // server-side apply fails, the error is returned to the caller and indicates // they should retry. // // When at the beginning of the reconciliation the deletion timestamp is set -// on the v2beta2.HelmRelease, or the Status.HelmChart differs from the +// on the v2.HelmRelease, or the Status.HelmChart differs from the // namespaced name of the chart to be applied, the existing chart is deleted. // The deletion is observed, and when it completes, the Status.HelmChart is // cleared. If the deletion fails, the error is returned to the caller and // indicates they should retry. // -// In case the v2beta2.HelmRelease is marked for deletion, the reconciler will +// In case the v2.HelmRelease is marked for deletion, the reconciler will // not continue to attempt to create or update the v1beta2.HelmChart. type HelmChartTemplate struct { client client.Client diff --git a/internal/reconcile/state.go b/internal/reconcile/state.go index e4b32594b..b3bf7d03e 100644 --- a/internal/reconcile/state.go +++ b/internal/reconcile/state.go @@ -31,7 +31,7 @@ import ( ) // ReleaseStatus represents the status of a Helm release as determined by -// comparing the Helm storage with the v2beta2.HelmRelease object. +// comparing the Helm storage with the v2.HelmRelease object. type ReleaseStatus string // String returns the string representation of the release status. @@ -47,10 +47,10 @@ const ( // Helm storage. ReleaseStatusAbsent ReleaseStatus = "Absent" // ReleaseStatusUnmanaged indicates that the release is present in the Helm - // storage, but is not managed by the v2beta2.HelmRelease object. + // storage, but is not managed by the v2.HelmRelease object. ReleaseStatusUnmanaged ReleaseStatus = "Unmanaged" // ReleaseStatusOutOfSync indicates that the release is present in the Helm - // storage, but is not in sync with the v2beta2.HelmRelease object. + // storage, but is not in sync with the v2.HelmRelease object. ReleaseStatusOutOfSync ReleaseStatus = "OutOfSync" // ReleaseStatusDrifted indicates that the release is present in the Helm // storage, but the cluster state has drifted from the manifest in the @@ -63,7 +63,7 @@ const ( // storage, but has not been tested. ReleaseStatusUntested ReleaseStatus = "Untested" // ReleaseStatusInSync indicates that the release is present in the Helm - // storage, and is in sync with the v2beta2.HelmRelease object. + // storage, and is in sync with the v2.HelmRelease object. ReleaseStatusInSync ReleaseStatus = "InSync" // ReleaseStatusFailed indicates that the release is present in the Helm // storage, but has failed. @@ -71,7 +71,7 @@ const ( ) // ReleaseState represents the state of a Helm release as determined by -// comparing the Helm storage with the v2beta2.HelmRelease object. +// comparing the Helm storage with the v2.HelmRelease object. type ReleaseState struct { // Status is the status of the release. Status ReleaseStatus @@ -83,7 +83,7 @@ type ReleaseState struct { } // DetermineReleaseState determines the state of the Helm release as compared -// to the v2beta2.HelmRelease object. It returns a ReleaseState that indicates +// to the v2.HelmRelease object. It returns a ReleaseState that indicates // the status of the release, and an error if the state could not be determined. func DetermineReleaseState(ctx context.Context, cfg *action.ConfigFactory, req *Request) (ReleaseState, error) { rls, err := action.LastRelease(cfg.Build(nil), req.Object.GetReleaseName()) diff --git a/internal/reconcile/unlock.go b/internal/reconcile/unlock.go index eb58e8a71..18da580a6 100644 --- a/internal/reconcile/unlock.go +++ b/internal/reconcile/unlock.go @@ -41,7 +41,7 @@ import ( // This write to the Helm storage is observed, and updates the Status.History // field if the persisted object targets the same release version. // -// Any pending state marks the v2beta2.HelmRelease object with +// Any pending state marks the v2.HelmRelease object with // ReleasedCondition=False, even if persisting the object to the Helm storage // fails. // diff --git a/internal/release/observation.go b/internal/release/observation.go index 357dec7b2..437bb94f8 100644 --- a/internal/release/observation.go +++ b/internal/release/observation.go @@ -152,7 +152,7 @@ func ObserveRelease(rel *helmrelease.Release, filter ...DataFilter) Observation return obsRel } -// ObservedToSnapshot returns a v2beta2.Snapshot constructed from the +// ObservedToSnapshot returns a v2.Snapshot constructed from the // Observation data. Calculating the (config) digest using the // digest.Canonical algorithm. func ObservedToSnapshot(rls Observation) *v2.Snapshot { @@ -172,7 +172,7 @@ func ObservedToSnapshot(rls Observation) *v2.Snapshot { } } -// TestHooksFromRelease returns the list of v2beta2.TestHookStatus for the +// TestHooksFromRelease returns the list of v2.TestHookStatus for the // given release, indexed by name. func TestHooksFromRelease(rls *helmrelease.Release) map[string]*v2.TestHookStatus { hooks := make(map[string]*v2.TestHookStatus)