Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return different success message for oci type - reconcile_source_helm #2859

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}