mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 00:37:27 +00:00
Merge pull request #2859 from SomtochiAma/oci-success-msg
Return different success message for `oci` type - `reconcile_source_helm`
This commit is contained in:
commit
12504c76d0
1 changed files with 12 additions and 0 deletions
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue