Update `HelmRelease` API to v2

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

@ -1,5 +1,5 @@
/*
Copyright 2020 The Flux authors
Copyright 2024 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -24,12 +24,6 @@ import (
"strings"
"time"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/runtime/transform"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/spf13/cobra"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/api/errors"
@ -39,7 +33,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/runtime/transform"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createHelmReleaseCmd = &cobra.Command{

@ -29,7 +29,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
)
var deleteHelmReleaseCmd = &cobra.Command{

@ -39,7 +39,7 @@ import (
cmdutil "k8s.io/kubectl/pkg/cmd/util"
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta2"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"

@ -78,7 +78,7 @@ spec:
timeout: 1m0s
url: ssh://git@github.com/example/repo
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: podinfo

@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
)
var exportHelmReleaseCmd = &cobra.Command{

@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra"
apimeta "k8s.io/apimachinery/pkg/api/meta"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b3 "github.com/fluxcd/notification-controller/api/v1beta3"

@ -25,7 +25,7 @@ import (
"golang.org/x/text/language"
"k8s.io/apimachinery/pkg/runtime"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
)
var getHelmReleaseCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
)
// helmv2.HelmRelease

@ -31,7 +31,7 @@ import (
"k8s.io/client-go/util/retry"
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/v2/internal/utils"

@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)

@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
)
var resumeHrCmd = &cobra.Command{

@ -27,7 +27,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/cli-utils/pkg/kstatus/status"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta2"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
)
var suspendHrCmd = &cobra.Command{

@ -1,5 +1,5 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: flux-system

@ -138,7 +138,7 @@ spec:
name: podinfo
version: '*'
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: flux-system

@ -34,7 +34,7 @@ spec:
command: [ "echo hello world" ]
image: busybox
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
labels:

@ -9,7 +9,7 @@ kind: Namespace
metadata:
name: {{ .ns }}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
labels:

@ -9,7 +9,7 @@ kind: Namespace
metadata:
name: {{ .ns }}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
labels:

@ -33,7 +33,7 @@ import (
"k8s.io/cli-runtime/pkg/resource"
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
fluxmeta "github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/oci"
@ -64,7 +64,7 @@ You can also trace multiple objects with different resource kinds using <resourc
# API Version and Kind can also be specified explicitly
# Note that either both, kind and api-version, or neither have to be specified.
flux trace redis --kind=helmrelease --api-version=helm.toolkit.fluxcd.io/v2beta2 -n redis`,
flux trace redis --kind=helmrelease --api-version=helm.toolkit.fluxcd.io/v2 -n redis`,
RunE: traceCmdRun,
}

@ -47,7 +47,7 @@ func TestTrace(t *testing.T) {
},
{
"HelmRelease",
"trace podinfo --kind HelmRelease --api-version=helm.toolkit.fluxcd.io/v2beta2",
"trace podinfo --kind HelmRelease --api-version=helm.toolkit.fluxcd.io/v2",
"testdata/trace/helmrelease.yaml",
"testdata/trace/helmrelease.golden",
map[string]string{
@ -59,7 +59,7 @@ func TestTrace(t *testing.T) {
},
{
"HelmRelease from OCI registry",
"trace podinfo --kind HelmRelease --api-version=helm.toolkit.fluxcd.io/v2beta2",
"trace podinfo --kind HelmRelease --api-version=helm.toolkit.fluxcd.io/v2",
"testdata/trace/helmrelease-oci.yaml",
"testdata/trace/helmrelease-oci.golden",
map[string]string{

@ -36,7 +36,7 @@ import (
"sigs.k8s.io/yaml"
"github.com/fluxcd/cli-utils/pkg/object"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
ssautil "github.com/fluxcd/pkg/ssa/utils"

@ -20,7 +20,7 @@ import (
"fmt"
"strings"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
"github.com/fluxcd/flux2/v2/internal/utils"
)

@ -41,7 +41,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
imageautov1 "github.com/fluxcd/image-automation-controller/api/v1beta2"
imagereflectv1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"

@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/util/errors"
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta2"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"

Loading…
Cancel
Save