Skip to content

Commit

Permalink
Update API version in comments and docs
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed May 6, 2024
1 parent f04e393 commit 32306bc
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions internal/action/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/action/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions internal/action/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/action/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/action/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/action/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions internal/reconcile/helmchart_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions internal/reconcile/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -63,15 +63,15 @@ 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.
ReleaseStatusFailed ReleaseStatus = "Failed"
)

// 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
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion internal/reconcile/unlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
4 changes: 2 additions & 2 deletions internal/release/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 32306bc

Please sign in to comment.