From e40961c6d0fad595c070a97492a9fcae52843018 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 6 May 2024 15:23:30 +0300 Subject: [PATCH] Migrate `flux trace` to Helm Source API v1 Signed-off-by: Stefan Prodan --- cmd/flux/trace.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/flux/trace.go b/cmd/flux/trace.go index bab5a457..89094eed 100644 --- a/cmd/flux/trace.go +++ b/cmd/flux/trace.go @@ -388,10 +388,10 @@ func traceHelm(ctx context.Context, kubeClient client.Client, hrName types.Names } hrReady := meta.FindStatusCondition(hr.Status.Conditions, fluxmeta.ReadyCondition) - var hrChart *sourcev1b2.HelmChart + var hrChart *sourcev1.HelmChart var hrChartReady *metav1.Condition if chart := hr.Status.HelmChart; chart != "" { - hrChart = &sourcev1b2.HelmChart{} + hrChart = &sourcev1.HelmChart{} err = kubeClient.Get(ctx, utils.ParseNamespacedName(chart), hrChart) if err != nil { return "", fmt.Errorf("failed to find HelmChart: %w", err) @@ -417,10 +417,10 @@ func traceHelm(ctx context.Context, kubeClient client.Client, hrName types.Names hrGitRepositoryReady = meta.FindStatusCondition(hrGitRepository.Status.Conditions, fluxmeta.ReadyCondition) } - var hrHelmRepository *sourcev1b2.HelmRepository + var hrHelmRepository *sourcev1.HelmRepository var hrHelmRepositoryReady *metav1.Condition - if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1b2.HelmRepositoryKind { - hrHelmRepository = &sourcev1b2.HelmRepository{} + if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.HelmRepositoryKind { + hrHelmRepository = &sourcev1.HelmRepository{} sourceNamespace := hr.Namespace if hr.Spec.Chart.Spec.SourceRef.Namespace != "" { sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace @@ -522,11 +522,11 @@ Status: Unknown ObjectNamespace string HelmRelease *helmv2.HelmRelease HelmReleaseReady *metav1.Condition - HelmChart *sourcev1b2.HelmChart + HelmChart *sourcev1.HelmChart HelmChartReady *metav1.Condition GitRepository *sourcev1.GitRepository GitRepositoryReady *metav1.Condition - HelmRepository *sourcev1b2.HelmRepository + HelmRepository *sourcev1.HelmRepository HelmRepositoryReady *metav1.Condition }{ ObjectName: obj.GetKind() + "/" + obj.GetName(),