Skip to content

Commit

Permalink
Rework the controller flow; not yet ready
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed Jul 20, 2021
1 parent 298b222 commit 35d31fb
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 201 deletions.
19 changes: 11 additions & 8 deletions api/v2beta1/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,15 +824,15 @@ func (in *HelmRelease) SetConditions(conditions []metav1.Condition) {

// HelmReleaseAttempted registers an attempt of the given HelmRelease with the given state.
// and returns the modified HelmRelease and a boolean indicating a state change.
func HelmReleaseAttempted(hr HelmRelease, revision string, releaseRevision int, valuesChecksum string) (HelmRelease, bool) {
changed := hr.Status.LastAttemptedRevision != revision ||
hr.Status.LastReleaseRevision != releaseRevision ||
hr.Status.LastAttemptedValuesChecksum != valuesChecksum
hr.Status.LastAttemptedRevision = revision
hr.Status.LastReleaseRevision = releaseRevision
hr.Status.LastAttemptedValuesChecksum = valuesChecksum
func HelmReleaseAttempted(obj *HelmRelease, revision string, releaseRevision int, valuesChecksum string) bool {
changed := obj.Status.LastAttemptedRevision != revision ||
obj.Status.LastReleaseRevision != releaseRevision ||
obj.Status.LastAttemptedValuesChecksum != valuesChecksum
obj.Status.LastAttemptedRevision = revision
obj.Status.LastReleaseRevision = releaseRevision
obj.Status.LastAttemptedValuesChecksum = valuesChecksum

return hr, changed
return changed
}

func resetFailureCounts(hr *HelmRelease) {
Expand Down Expand Up @@ -928,6 +928,9 @@ func (in HelmRelease) GetMaxHistory() int {

// GetDependsOn returns the types.NamespacedName of the HelmRelease, and a
// dependency.CrossNamespaceDependencyReference slice it depends on.
// TODO: This should probably have the signature
// GetDependsOn() []meta.NamespacedObjectReference
// to comply with github.com/fluxcd/pkg/apis/meta#ObjectWithDependencies
func (in HelmRelease) GetDependsOn() (types.NamespacedName, []meta.NamespacedObjectReference) {
return types.NamespacedName{
Namespace: in.Namespace,
Expand Down
Loading

0 comments on commit 35d31fb

Please sign in to comment.