Skip to content

Commit

Permalink
Merge pull request #2859 from SomtochiAma/oci-success-msg
Browse files Browse the repository at this point in the history
Return different success message for `oci` type - `reconcile_source_helm`
  • Loading branch information
stefanprodan authored Jun 22, 2022
2 parents f7d616d + 7346b1a commit 12504c7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/flux/reconcile_source_helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"github.com/spf13/cobra"

"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/runtime/conditions"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
)

Expand All @@ -46,5 +48,15 @@ func (obj helmRepositoryAdapter) lastHandledReconcileRequest() string {
}

func (obj helmRepositoryAdapter) successMessage() string {
// HelmRepository of type OCI don't set an Artifact
if obj.Spec.Type == sourcev1.HelmRepositoryTypeOCI {
readyCondition := conditions.Get(obj.HelmRepository, meta.ReadyCondition)
// This shouldn't happen, successMessage shouldn't be called if
// object isn't ready
if readyCondition == nil {
return ""
}
return readyCondition.Message
}
return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision)
}

0 comments on commit 12504c7

Please sign in to comment.