Migrate `flux trace` to Helm Source API v1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
pull/4759/head
Stefan Prodan 8 months ago
parent 315c53a717
commit e40961c6d0
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF

@ -388,10 +388,10 @@ func traceHelm(ctx context.Context, kubeClient client.Client, hrName types.Names
} }
hrReady := meta.FindStatusCondition(hr.Status.Conditions, fluxmeta.ReadyCondition) hrReady := meta.FindStatusCondition(hr.Status.Conditions, fluxmeta.ReadyCondition)
var hrChart *sourcev1b2.HelmChart var hrChart *sourcev1.HelmChart
var hrChartReady *metav1.Condition var hrChartReady *metav1.Condition
if chart := hr.Status.HelmChart; chart != "" { if chart := hr.Status.HelmChart; chart != "" {
hrChart = &sourcev1b2.HelmChart{} hrChart = &sourcev1.HelmChart{}
err = kubeClient.Get(ctx, utils.ParseNamespacedName(chart), hrChart) err = kubeClient.Get(ctx, utils.ParseNamespacedName(chart), hrChart)
if err != nil { if err != nil {
return "", fmt.Errorf("failed to find HelmChart: %w", err) 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) hrGitRepositoryReady = meta.FindStatusCondition(hrGitRepository.Status.Conditions, fluxmeta.ReadyCondition)
} }
var hrHelmRepository *sourcev1b2.HelmRepository var hrHelmRepository *sourcev1.HelmRepository
var hrHelmRepositoryReady *metav1.Condition var hrHelmRepositoryReady *metav1.Condition
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1b2.HelmRepositoryKind { if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.HelmRepositoryKind {
hrHelmRepository = &sourcev1b2.HelmRepository{} hrHelmRepository = &sourcev1.HelmRepository{}
sourceNamespace := hr.Namespace sourceNamespace := hr.Namespace
if hr.Spec.Chart.Spec.SourceRef.Namespace != "" { if hr.Spec.Chart.Spec.SourceRef.Namespace != "" {
sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace
@ -522,11 +522,11 @@ Status: Unknown
ObjectNamespace string ObjectNamespace string
HelmRelease *helmv2.HelmRelease HelmRelease *helmv2.HelmRelease
HelmReleaseReady *metav1.Condition HelmReleaseReady *metav1.Condition
HelmChart *sourcev1b2.HelmChart HelmChart *sourcev1.HelmChart
HelmChartReady *metav1.Condition HelmChartReady *metav1.Condition
GitRepository *sourcev1.GitRepository GitRepository *sourcev1.GitRepository
GitRepositoryReady *metav1.Condition GitRepositoryReady *metav1.Condition
HelmRepository *sourcev1b2.HelmRepository HelmRepository *sourcev1.HelmRepository
HelmRepositoryReady *metav1.Condition HelmRepositoryReady *metav1.Condition
}{ }{
ObjectName: obj.GetKind() + "/" + obj.GetName(), ObjectName: obj.GetKind() + "/" + obj.GetName(),

Loading…
Cancel
Save