From 315c53a717623e848da322d56d0c0d226a9d93dd Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 6 May 2024 15:15:38 +0300 Subject: [PATCH] Migrate `flux events` to Helm Source API v1 Signed-off-by: Stefan Prodan --- cmd/flux/events.go | 8 ++++---- cmd/flux/reconcile_source_chart.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/flux/events.go b/cmd/flux/events.go index 481f9e79..6593d1d2 100644 --- a/cmd/flux/events.go +++ b/cmd/flux/events.go @@ -422,7 +422,7 @@ var fluxKindMap = refMap{ gvk: helmv2.GroupVersion.WithKind(helmv2.HelmReleaseKind), crossNamespaced: true, otherRefs: func(namespace, name string) []string { - return []string{fmt.Sprintf("%s/%s-%s", sourcev1b2.HelmChartKind, namespace, name)} + return []string{fmt.Sprintf("%s/%s-%s", sourcev1.HelmChartKind, namespace, name)} }, field: []string{"spec", "chart", "spec", "sourceRef"}, }, @@ -440,15 +440,15 @@ var fluxKindMap = refMap{ crossNamespaced: true, field: []string{"spec", "imageRepositoryRef"}, }, - sourcev1b2.HelmChartKind: { - gvk: sourcev1b2.GroupVersion.WithKind(sourcev1b2.HelmChartKind), + sourcev1.HelmChartKind: { + gvk: sourcev1.GroupVersion.WithKind(sourcev1.HelmChartKind), crossNamespaced: true, field: []string{"spec", "sourceRef"}, }, sourcev1.GitRepositoryKind: {gvk: sourcev1.GroupVersion.WithKind(sourcev1.GitRepositoryKind)}, sourcev1b2.OCIRepositoryKind: {gvk: sourcev1b2.GroupVersion.WithKind(sourcev1b2.OCIRepositoryKind)}, sourcev1b2.BucketKind: {gvk: sourcev1b2.GroupVersion.WithKind(sourcev1b2.BucketKind)}, - sourcev1b2.HelmRepositoryKind: {gvk: sourcev1b2.GroupVersion.WithKind(sourcev1b2.HelmRepositoryKind)}, + sourcev1.HelmRepositoryKind: {gvk: sourcev1.GroupVersion.WithKind(sourcev1.HelmRepositoryKind)}, autov1.ImageUpdateAutomationKind: {gvk: autov1.GroupVersion.WithKind(autov1.ImageUpdateAutomationKind)}, imagev1.ImageRepositoryKind: {gvk: imagev1.GroupVersion.WithKind(imagev1.ImageRepositoryKind)}, } diff --git a/cmd/flux/reconcile_source_chart.go b/cmd/flux/reconcile_source_chart.go index 7db42087..77887b75 100644 --- a/cmd/flux/reconcile_source_chart.go +++ b/cmd/flux/reconcile_source_chart.go @@ -33,7 +33,7 @@ var reconcileSourceHelmChartCmd = &cobra.Command{ # Trigger a reconciliation of the HelmCharts's source and apply changes flux reconcile helmchart podinfo --with-source`, - ValidArgsFunction: resourceNamesCompletionFunc(sourcev1.GroupVersion.WithKind(sourcev1b2.HelmChartKind)), + ValidArgsFunction: resourceNamesCompletionFunc(sourcev1.GroupVersion.WithKind(sourcev1.HelmChartKind)), RunE: reconcileWithSourceCommand{ apiType: helmChartType, object: helmChartAdapter{&sourcev1.HelmChart{}},