Update GitRepository Receiver, and Kustomization to v1

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
pull/3758/head
Somtochi Onyekwere 2 years ago committed by Stefan Prodan
parent ccb7d62d95
commit 24452ecd37
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF

@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/internal/build"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
var buildKsCmd = &cobra.Command{

@ -92,7 +92,7 @@ func TestBuildKustomization(t *testing.T) {
}
func TestBuildLocalKustomization(t *testing.T) {
podinfo := `apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
podinfo := `apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo

@ -28,7 +28,8 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/internal/utils"
@ -96,13 +97,13 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
logger.Generatef("generating Alert")
}
alert := notificationv1.Alert{
alert := notificationv1b2.Alert{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: notificationv1.AlertSpec{
Spec: notificationv1b2.AlertSpec{
ProviderRef: meta.LocalObjectReference{
Name: alertArgs.providerRef,
},
@ -140,13 +141,13 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
}
func upsertAlert(ctx context.Context, kubeClient client.Client,
alert *notificationv1.Alert) (types.NamespacedName, error) {
alert *notificationv1b2.Alert) (types.NamespacedName, error) {
namespacedName := types.NamespacedName{
Namespace: alert.GetNamespace(),
Name: alert.GetName(),
}
var existing notificationv1.Alert
var existing notificationv1b2.Alert
err := kubeClient.Get(ctx, namespacedName, &existing)
if err != nil {
if errors.IsNotFound(err) {
@ -171,7 +172,7 @@ func upsertAlert(ctx context.Context, kubeClient client.Client,
}
func isAlertReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, alert *notificationv1.Alert) wait.ConditionFunc {
namespacedName types.NamespacedName, alert *notificationv1b2.Alert) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, alert)
if err != nil {

@ -23,7 +23,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var createImageUpdateCmd = &cobra.Command{

@ -31,7 +31,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/internal/flags"

@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/internal/utils"

@ -37,7 +37,7 @@ import (
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/runtime/conditions"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"

@ -24,14 +24,15 @@ import (
"testing"
"time"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var pollInterval = 50 * time.Millisecond
@ -176,6 +177,9 @@ func TestCreateSourceGit(t *testing.T) {
repo.Status.Artifact = &sourcev1.Artifact{
Path: "some-path",
Revision: "v1",
LastUpdateTime: metav1.Time{
Time: time.Now(),
},
}
},
}, {

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
var deleteKsCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
)
var deleteReceiverCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var deleteSourceGitCmd = &cobra.Command{

@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/internal/build"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
var diffKsCmd = &cobra.Command{

@ -42,9 +42,11 @@ import (
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/printers"
@ -390,18 +392,18 @@ var fluxKindMap = refMap{
gv: helmv2.GroupVersion,
crossNamespaced: true,
otherRefs: func(namespace, name string) []string {
return []string{fmt.Sprintf("%s/%s-%s", sourcev1.HelmChartKind, namespace, name)}
return []string{fmt.Sprintf("%s/%s-%s", sourcev1b2.HelmChartKind, namespace, name)}
},
field: []string{"spec", "chart", "spec", "sourceRef"},
},
notificationv1.AlertKind: {
gv: notificationv1.GroupVersion,
kind: notificationv1.ProviderKind,
notificationv1b2.AlertKind: {
gv: notificationv1b2.GroupVersion,
kind: notificationv1b2.ProviderKind,
crossNamespaced: false,
field: []string{"spec", "providerRef"},
},
notificationv1.ReceiverKind: {gv: notificationv1.GroupVersion},
notificationv1.ProviderKind: {gv: notificationv1.GroupVersion},
notificationv1.ReceiverKind: {gv: notificationv1.GroupVersion},
notificationv1b2.ProviderKind: {gv: notificationv1b2.GroupVersion},
imagev1.ImagePolicyKind: {
gv: imagev1.GroupVersion,
kind: imagev1.ImageRepositoryKind,
@ -409,10 +411,10 @@ var fluxKindMap = refMap{
field: []string{"spec", "imageRepositoryRef"},
},
sourcev1.GitRepositoryKind: {gv: sourcev1.GroupVersion},
sourcev1.OCIRepositoryKind: {gv: sourcev1.GroupVersion},
sourcev1.BucketKind: {gv: sourcev1.GroupVersion},
sourcev1.HelmRepositoryKind: {gv: sourcev1.GroupVersion},
sourcev1.HelmChartKind: {gv: sourcev1.GroupVersion},
sourcev1b2.OCIRepositoryKind: {gv: sourcev1b2.GroupVersion},
sourcev1b2.BucketKind: {gv: sourcev1b2.GroupVersion},
sourcev1b2.HelmRepositoryKind: {gv: sourcev1b2.GroupVersion},
sourcev1b2.HelmChartKind: {gv: sourcev1b2.GroupVersion},
autov1.ImageUpdateAutomationKind: {gv: autov1.GroupVersion},
imagev1.ImageRepositoryKind: {gv: imagev1.GroupVersion},
}

@ -23,15 +23,6 @@ import (
"strings"
"testing"
"github.com/fluxcd/flux2/internal/utils"
helmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
"github.com/fluxcd/pkg/ssa"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -40,10 +31,23 @@ import (
cmdutil "k8s.io/kubectl/pkg/cmd/util"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
helmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
"github.com/fluxcd/pkg/ssa"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/internal/utils"
)
var objects = `
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: flux-system
@ -56,7 +60,7 @@ spec:
kind: GitRepository
name: flux-system
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
@ -70,7 +74,7 @@ spec:
name: flux-system
namespace: flux-system
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: flux-system
@ -376,9 +380,11 @@ func getScheme() *runtime.Scheme {
kustomizev1.AddToScheme(newscheme)
helmv2beta1.AddToScheme(newscheme)
notificationv1.AddToScheme(newscheme)
notificationv1b2.AddToScheme(newscheme)
imagev1.AddToScheme(newscheme)
autov1.AddToScheme(newscheme)
sourcev1.AddToScheme(newscheme)
sourcev1b2.AddToScheme(newscheme)
return newscheme
}

@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
var exportKsCmd = &cobra.Command{

@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
)
var exportReceiverCmd = &cobra.Command{
@ -44,7 +44,7 @@ func init() {
}
func exportReceiver(receiver *notificationv1.Receiver) interface{} {
gvk := notificationv1.GroupVersion.WithKind("Receiver")
gvk := notificationv1.GroupVersion.WithKind(notificationv1.ReceiverKind)
export := notificationv1.Receiver{
TypeMeta: metav1.TypeMeta{
Kind: gvk.Kind,

@ -21,7 +21,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var exportSourceGitCmd = &cobra.Command{

@ -22,8 +22,9 @@ import (
"github.com/spf13/cobra"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
)
var getAllCmd = &cobra.Command{
@ -62,11 +63,11 @@ var getAllCmd = &cobra.Command{
},
{
apiType: alertProviderType,
list: alertProviderListAdapter{&notificationv1.ProviderList{}},
list: alertProviderListAdapter{&notificationv1b2.ProviderList{}},
},
{
apiType: alertType,
list: &alertListAdapter{&notificationv1.AlertList{}},
list: &alertListAdapter{&notificationv1b2.AlertList{}},
},
}

@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/flux2/internal/utils"
)

@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
)
var getReceiverCmd = &cobra.Command{

@ -21,7 +21,8 @@ import (
"github.com/spf13/cobra"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
var getSourceAllCmd = &cobra.Command{
@ -42,11 +43,11 @@ var getSourceAllCmd = &cobra.Command{
var allSourceCmd = []getCommand{
{
apiType: ociRepositoryType,
list: &ociRepositoryListAdapter{&sourcev1.OCIRepositoryList{}},
list: &ociRepositoryListAdapter{&sourcev1b2.OCIRepositoryList{}},
},
{
apiType: bucketType,
list: &bucketListAdapter{&sourcev1.BucketList{}},
list: &bucketListAdapter{&sourcev1b2.BucketList{}},
},
{
apiType: gitRepositoryType,
@ -54,11 +55,11 @@ var getSourceAllCmd = &cobra.Command{
},
{
apiType: helmRepositoryType,
list: &helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
list: &helmRepositoryListAdapter{&sourcev1b2.HelmRepositoryList{}},
},
{
apiType: helmChartType,
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
list: &helmChartListAdapter{&sourcev1b2.HelmChartList{}},
},
}

@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/fluxcd/flux2/internal/utils"
)

@ -19,7 +19,7 @@ package main
import (
"sigs.k8s.io/controller-runtime/pkg/client"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
// kustomizev1.Kustomization

@ -20,13 +20,13 @@ import (
"context"
"fmt"
"github.com/fluxcd/flux2/internal/flags"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/pkg/printers"
oci "github.com/fluxcd/pkg/oci/client"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/pkg/printers"
"github.com/fluxcd/flux2/internal/flags"
)
type listArtifactFlags struct {

@ -19,7 +19,7 @@ package main
import (
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
)
// notificationv1.Receiver

@ -30,7 +30,8 @@ import (
"k8s.io/client-go/util/retry"
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/internal/utils"
@ -111,7 +112,7 @@ func (reconcile reconcileCommand) run(cmd *cobra.Command, args []string) error {
}
logger.Successf("%s annotated", reconcile.kind)
if reconcile.kind == notificationv1.AlertKind || reconcile.kind == notificationv1.ReceiverKind {
if reconcile.kind == notificationv1b2.AlertKind || reconcile.kind == notificationv1.ReceiverKind {
if err = wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout,
isReconcileReady(ctx, kubeClient, namespacedName, reconcile.object)); err != nil {
return err

@ -21,7 +21,8 @@ import (
"k8s.io/apimachinery/pkg/types"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
var reconcileHrCmd = &cobra.Command{
@ -65,20 +66,20 @@ func (obj helmReleaseAdapter) reconcileSource() bool {
func (obj helmReleaseAdapter) getSource() (reconcileCommand, types.NamespacedName) {
var cmd reconcileCommand
switch obj.Spec.Chart.Spec.SourceRef.Kind {
case sourcev1.HelmRepositoryKind:
case sourcev1b2.HelmRepositoryKind:
cmd = reconcileCommand{
apiType: helmRepositoryType,
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
object: helmRepositoryAdapter{&sourcev1b2.HelmRepository{}},
}
case sourcev1.GitRepositoryKind:
cmd = reconcileCommand{
apiType: gitRepositoryType,
object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
}
case sourcev1.BucketKind:
case sourcev1b2.BucketKind:
cmd = reconcileCommand{
apiType: bucketType,
object: bucketAdapter{&sourcev1.Bucket{}},
object: bucketAdapter{&sourcev1b2.Bucket{}},
}
}

@ -20,8 +20,9 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
var reconcileKsCmd = &cobra.Command{
@ -65,20 +66,20 @@ func (obj kustomizationAdapter) reconcileSource() bool {
func (obj kustomizationAdapter) getSource() (reconcileCommand, types.NamespacedName) {
var cmd reconcileCommand
switch obj.Spec.SourceRef.Kind {
case sourcev1.OCIRepositoryKind:
case sourcev1b2.OCIRepositoryKind:
cmd = reconcileCommand{
apiType: ociRepositoryType,
object: ociRepositoryAdapter{&sourcev1.OCIRepository{}},
object: ociRepositoryAdapter{&sourcev1b2.OCIRepository{}},
}
case sourcev1.GitRepositoryKind:
cmd = reconcileCommand{
apiType: gitRepositoryType,
object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
}
case sourcev1.BucketKind:
case sourcev1b2.BucketKind:
cmd = reconcileCommand{
apiType: bucketType,
object: bucketAdapter{&sourcev1.Bucket{}},
object: bucketAdapter{&sourcev1b2.Bucket{}},
}
}

@ -25,7 +25,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/internal/utils"

@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var reconcileSourceGitCmd = &cobra.Command{

@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
var resumeKsCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
)
var resumeReceiverCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var resumeSourceGitCmd = &cobra.Command{

@ -19,7 +19,8 @@ package main
import (
"sigs.k8s.io/controller-runtime/pkg/client"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
// These are general-purpose adapters for attaching methods to, for
@ -29,13 +30,13 @@ import (
// sourcev1.ociRepository
var ociRepositoryType = apiType{
kind: sourcev1.OCIRepositoryKind,
kind: sourcev1b2.OCIRepositoryKind,
humanKind: "source oci",
groupVersion: sourcev1.GroupVersion,
groupVersion: sourcev1b2.GroupVersion,
}
type ociRepositoryAdapter struct {
*sourcev1.OCIRepository
*sourcev1b2.OCIRepository
}
func (a ociRepositoryAdapter) asClientObject() client.Object {
@ -46,10 +47,10 @@ func (a ociRepositoryAdapter) deepCopyClientObject() client.Object {
return a.OCIRepository.DeepCopy()
}
// sourcev1.OCIRepositoryList
// sourcev1b2.OCIRepositoryList
type ociRepositoryListAdapter struct {
*sourcev1.OCIRepositoryList
*sourcev1b2.OCIRepositoryList
}
func (a ociRepositoryListAdapter) asClientList() client.ObjectList {
@ -60,16 +61,16 @@ func (a ociRepositoryListAdapter) len() int {
return len(a.OCIRepositoryList.Items)
}
// sourcev1.Bucket
// sourcev1b2.Bucket
var bucketType = apiType{
kind: sourcev1.BucketKind,
kind: sourcev1b2.BucketKind,
humanKind: "source bucket",
groupVersion: sourcev1.GroupVersion,
groupVersion: sourcev1b2.GroupVersion,
}
type bucketAdapter struct {
*sourcev1.Bucket
*sourcev1b2.Bucket
}
func (a bucketAdapter) asClientObject() client.Object {
@ -80,10 +81,10 @@ func (a bucketAdapter) deepCopyClientObject() client.Object {
return a.Bucket.DeepCopy()
}
// sourcev1.BucketList
// sourcev1b2.BucketList
type bucketListAdapter struct {
*sourcev1.BucketList
*sourcev1b2.BucketList
}
func (a bucketListAdapter) asClientList() client.ObjectList {
@ -94,16 +95,16 @@ func (a bucketListAdapter) len() int {
return len(a.BucketList.Items)
}
// sourcev1.HelmChart
// sourcev1b2.HelmChart
var helmChartType = apiType{
kind: sourcev1.HelmChartKind,
kind: sourcev1b2.HelmChartKind,
humanKind: "source chart",
groupVersion: sourcev1.GroupVersion,
groupVersion: sourcev1b2.GroupVersion,
}
type helmChartAdapter struct {
*sourcev1.HelmChart
*sourcev1b2.HelmChart
}
func (a helmChartAdapter) asClientObject() client.Object {
@ -114,10 +115,10 @@ func (a helmChartAdapter) deepCopyClientObject() client.Object {
return a.HelmChart.DeepCopy()
}
// sourcev1.HelmChartList
// sourcev1b2.HelmChartList
type helmChartListAdapter struct {
*sourcev1.HelmChartList
*sourcev1b2.HelmChartList
}
func (a helmChartListAdapter) asClientList() client.ObjectList {
@ -162,16 +163,16 @@ func (a gitRepositoryListAdapter) len() int {
return len(a.GitRepositoryList.Items)
}
// sourcev1.HelmRepository
// sourcev1b2.HelmRepository
var helmRepositoryType = apiType{
kind: sourcev1.HelmRepositoryKind,
kind: sourcev1b2.HelmRepositoryKind,
humanKind: "source helm",
groupVersion: sourcev1.GroupVersion,
groupVersion: sourcev1b2.GroupVersion,
}
type helmRepositoryAdapter struct {
*sourcev1.HelmRepository
*sourcev1b2.HelmRepository
}
func (a helmRepositoryAdapter) asClientObject() client.Object {
@ -182,10 +183,10 @@ func (a helmRepositoryAdapter) deepCopyClientObject() client.Object {
return a.HelmRepository.DeepCopy()
}
// sourcev1.HelmRepositoryList
// sourcev1b2.HelmRepositoryList
type helmRepositoryListAdapter struct {
*sourcev1.HelmRepositoryList
*sourcev1b2.HelmRepositoryList
}
func (a helmRepositoryListAdapter) asClientList() client.ObjectList {

@ -19,20 +19,24 @@ package main
import (
"context"
"fmt"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/printers"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/cli-utils/pkg/kstatus/status"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/printers"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
var statsCmd = &cobra.Command{
@ -76,24 +80,24 @@ func runStatsCmd(cmd *cobra.Command, args []string) error {
Group: sourcev1.GroupVersion.Group,
},
{
Kind: sourcev1.OCIRepositoryKind,
Version: sourcev1.GroupVersion.Version,
Group: sourcev1.GroupVersion.Group,
Kind: sourcev1b2.OCIRepositoryKind,
Version: sourcev1b2.GroupVersion.Version,
Group: sourcev1b2.GroupVersion.Group,
},
{
Kind: sourcev1.HelmRepositoryKind,
Version: sourcev1.GroupVersion.Version,
Group: sourcev1.GroupVersion.Group,
Kind: sourcev1b2.HelmRepositoryKind,
Version: sourcev1b2.GroupVersion.Version,
Group: sourcev1b2.GroupVersion.Group,
},
{
Kind: sourcev1.HelmChartKind,
Version: sourcev1.GroupVersion.Version,
Group: sourcev1.GroupVersion.Group,
Kind: sourcev1b2.HelmChartKind,
Version: sourcev1b2.GroupVersion.Version,
Group: sourcev1b2.GroupVersion.Group,
},
{
Kind: sourcev1.BucketKind,
Version: sourcev1.GroupVersion.Version,
Group: sourcev1.GroupVersion.Group,
Kind: sourcev1b2.BucketKind,
Version: sourcev1b2.GroupVersion.Version,
Group: sourcev1b2.GroupVersion.Group,
},
{
Kind: kustomizev1.KustomizationKind,
@ -106,14 +110,14 @@ func runStatsCmd(cmd *cobra.Command, args []string) error {
Group: helmv2.GroupVersion.Group,
},
{
Kind: notificationv1.AlertKind,
Version: notificationv1.GroupVersion.Version,
Group: notificationv1.GroupVersion.Group,
Kind: notificationv1b2.AlertKind,
Version: notificationv1b2.GroupVersion.Version,
Group: notificationv1b2.GroupVersion.Group,
},
{
Kind: notificationv1.ProviderKind,
Version: notificationv1.GroupVersion.Version,
Group: notificationv1.GroupVersion.Group,
Kind: notificationv1b2.ProviderKind,
Version: notificationv1b2.GroupVersion.Version,
Group: notificationv1b2.GroupVersion.Group,
},
{
Kind: notificationv1.ReceiverKind,

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
var suspendKsCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
)
var suspendReceiverCmd = &cobra.Command{

@ -19,7 +19,7 @@ package main
import (
"github.com/spf13/cobra"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var suspendSourceGitCmd = &cobra.Command{

@ -20,11 +20,12 @@ import (
"context"
"fmt"
"github.com/fluxcd/flux2/internal/flags"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/spf13/cobra"
oci "github.com/fluxcd/pkg/oci/client"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/internal/flags"
)
var tagArtifactCmd = &cobra.Command{

@ -1,5 +1,5 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo

@ -4,7 +4,7 @@ kind: Namespace
metadata:
name: {{ .fluxns }}
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo

@ -1,11 +1,10 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: flux-system
namespace: {{ .fluxns }}
spec:
gitImplementation: go-git
interval: 5m0s
ref:
branch: main

@ -1,5 +1,5 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: flux-system

@ -71,7 +71,7 @@ spec:
path: ./clusters/my-cluster
strategy: Setters
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: flux-system
@ -84,7 +84,7 @@ spec:
interval: 5m
url: ssh://git@github.com/example/repo
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: flux-system
@ -97,7 +97,7 @@ spec:
interval: 5m
prune: true
---
apiVersion: notification.toolkit.fluxcd.io/v1beta2
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata:
name: flux-system
@ -114,7 +114,7 @@ spec:
name: flux-system
namespace: flux-system
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: flux-system
@ -139,7 +139,7 @@ spec:
name: flux-systen
namespace: {{ .fluxns }}
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: Bucket
metadata:
name: flux-system

@ -1,5 +1,5 @@
---
apiVersion: notification.toolkit.fluxcd.io/v1beta2
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata:
name: flux-system
@ -8,6 +8,7 @@ spec:
events:
- ping
- push
interval: 10m0s
resources:
- kind: GitRepository
name: flux-system

@ -137,7 +137,7 @@ status:
status: "True"
type: Ready
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
labels:
@ -146,7 +146,6 @@ metadata:
name: flux-system
namespace: {{ .fluxns }}
spec:
gitImplementation: go-git
ref:
branch: main
secretRef:

@ -38,7 +38,7 @@ status:
lastAttemptedRevision: 6.3.5
lastAttemptedValuesChecksum: c31db75d05b7515eba2eef47bd71038c74b2e531
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure

@ -38,7 +38,7 @@ status:
lastAttemptedRevision: 6.3.5
lastAttemptedValuesChecksum: c31db75d05b7515eba2eef47bd71038c74b2e531
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure
@ -60,7 +60,7 @@ status:
type: Ready
lastAppliedRevision: main@sha1:696f056df216eea4f9401adbee0ff744d4df390f
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
labels:
@ -69,7 +69,6 @@ metadata:
name: flux-system
namespace: {{ .fluxns }}
spec:
gitImplementation: go-git
ref:
branch: main
secretRef:

@ -4,7 +4,7 @@ kind: Namespace
metadata:
name: {{ .fluxns }}
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: flux-system
@ -40,7 +40,7 @@ status:
- id: {{ .fluxns }}_flux-system_source.toolkit.fluxcd.io_GitRepository
v: v1beta1
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure
@ -66,7 +66,7 @@ status:
- id: cert-manager_cert-manager_source.toolkit.fluxcd.io_HelmRepository
v: v1beta1
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: empty

@ -35,10 +35,11 @@ import (
"github.com/fluxcd/flux2/internal/utils"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
fluxmeta "github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/oci"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
var traceCmd = &cobra.Command{
@ -221,7 +222,7 @@ func traceKustomization(ctx context.Context, kubeClient client.Client, ksName ty
ksReady := meta.FindStatusCondition(ks.Status.Conditions, fluxmeta.ReadyCondition)
var gitRepository *sourcev1.GitRepository
var ociRepository *sourcev1.OCIRepository
var ociRepository *sourcev1b2.OCIRepository
var ksRepositoryReady *metav1.Condition
switch ks.Spec.SourceRef.Kind {
case sourcev1.GitRepositoryKind:
@ -238,8 +239,8 @@ func traceKustomization(ctx context.Context, kubeClient client.Client, ksName ty
return "", fmt.Errorf("failed to find GitRepository: %w", err)
}
ksRepositoryReady = meta.FindStatusCondition(gitRepository.Status.Conditions, fluxmeta.ReadyCondition)
case sourcev1.OCIRepositoryKind:
ociRepository = &sourcev1.OCIRepository{}
case sourcev1b2.OCIRepositoryKind:
ociRepository = &sourcev1b2.OCIRepository{}
sourceNamespace := ks.Namespace
if ks.Spec.SourceRef.Namespace != "" {
sourceNamespace = ks.Spec.SourceRef.Namespace
@ -346,7 +347,7 @@ Status: Unknown
Kustomization *kustomizev1.Kustomization
KustomizationReady *metav1.Condition
GitRepository *sourcev1.GitRepository
OCIRepository *sourcev1.OCIRepository
OCIRepository *sourcev1b2.OCIRepository
RepositoryReady *metav1.Condition
Annotations map[string]string
}{
@ -386,10 +387,10 @@ func traceHelm(ctx context.Context, kubeClient client.Client, hrName types.Names
}
hrReady := meta.FindStatusCondition(hr.Status.Conditions, fluxmeta.ReadyCondition)
var hrChart *sourcev1.HelmChart
var hrChart *sourcev1b2.HelmChart
var hrChartReady *metav1.Condition
if chart := hr.Status.HelmChart; chart != "" {
hrChart = &sourcev1.HelmChart{}
hrChart = &sourcev1b2.HelmChart{}
err = kubeClient.Get(ctx, utils.ParseNamespacedName(chart), hrChart)
if err != nil {
return "", fmt.Errorf("failed to find HelmChart: %w", err)
@ -415,10 +416,10 @@ func traceHelm(ctx context.Context, kubeClient client.Client, hrName types.Names
hrGitRepositoryReady = meta.FindStatusCondition(hrGitRepository.Status.Conditions, fluxmeta.ReadyCondition)
}
var hrHelmRepository *sourcev1.HelmRepository
var hrHelmRepository *sourcev1b2.HelmRepository
var hrHelmRepositoryReady *metav1.Condition
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.HelmRepositoryKind {
hrHelmRepository = &sourcev1.HelmRepository{}
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1b2.HelmRepositoryKind {
hrHelmRepository = &sourcev1b2.HelmRepository{}
sourceNamespace := hr.Namespace
if hr.Spec.Chart.Spec.SourceRef.Namespace != "" {
sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace
@ -520,11 +521,11 @@ Status: Unknown
ObjectNamespace string
HelmRelease *helmv2.HelmRelease
HelmReleaseReady *metav1.Condition
HelmChart *sourcev1.HelmChart
HelmChart *sourcev1b2.HelmChart
HelmChartReady *metav1.Condition
GitRepository *sourcev1.GitRepository
GitRepositoryReady *metav1.Condition
HelmRepository *sourcev1.HelmRepository
HelmRepository *sourcev1b2.HelmRepository
HelmRepositoryReady *metav1.Condition
}{
ObjectName: obj.GetKind() + "/" + obj.GetName(),

@ -36,7 +36,7 @@ import (
"sigs.k8s.io/yaml"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/ssa"
"github.com/fluxcd/flux2/internal/tree"

@ -18,7 +18,7 @@ require (
github.com/fluxcd/pkg/apis/meta v1.0.0
github.com/fluxcd/pkg/git v0.11.0
github.com/fluxcd/pkg/git/gogit v0.8.1
github.com/fluxcd/pkg/kustomize v0.13.2
github.com/fluxcd/pkg/kustomize v0.14.0
github.com/fluxcd/pkg/oci v0.21.1
github.com/fluxcd/pkg/runtime v0.31.0
github.com/fluxcd/pkg/sourceignore v0.3.2

@ -222,8 +222,8 @@ github.com/fluxcd/pkg/git v0.11.0/go.mod h1:VHRVlrZMHNoWBlaSAWxlGH6Vwlb9VRazUhPU
github.com/fluxcd/pkg/git/gogit v0.8.1 h1:Q3EV2WBX6HiXSmsHyrwFzwl82gO4ZtFwb675iQPWwVc=
github.com/fluxcd/pkg/git/gogit v0.8.1/go.mod h1:5M27gCl0gyo6l+ht9HwZSzimPY3LahKVIJ7/1vCCctg=
github.com/fluxcd/pkg/gittestserver v0.8.1 h1:FMqnZBuS/11+9NhtLv9UAg+wm/v0Nf+hHeUOi2wJR3Q=
github.com/fluxcd/pkg/kustomize v0.13.2 h1:isA9yi+m7sSIxdTrFR1U7+LyS2BraG07ZkKLHw3bnGo=
github.com/fluxcd/pkg/kustomize v0.13.2/go.mod h1:1H9qednPxL/JvZE5at/f6wVHTH4WmxJYqfgVOZJ3uAk=
github.com/fluxcd/pkg/kustomize v0.14.0 h1:XsvGTRsTMlW5u3+ciNChzp3c755SXG5PiCozjyLQYX0=
github.com/fluxcd/pkg/kustomize v0.14.0/go.mod h1:1PmtFOgx3Rn7uoB5C1NVbb0DxXPdY3v0lBX3L9ozCZw=
github.com/fluxcd/pkg/oci v0.21.1 h1:9kn19wkabE2xB77NRlOtMJlSYhZmUjdloZCzlHdAS6s=
github.com/fluxcd/pkg/oci v0.21.1/go.mod h1:9E2DBlQII7YmeWt2ieTh38wwkiBqx3yg5NEJ51uefaA=
github.com/fluxcd/pkg/runtime v0.31.0 h1:addyXaANHl/A68bEjCbiR4HzcFKgfXv1eaG7B7ZHxOo=

@ -40,7 +40,7 @@ import (
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/kyaml/yaml"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/kustomize"
runclient "github.com/fluxcd/pkg/runtime/client"
"sigs.k8s.io/kustomize/kyaml/filesys"

@ -42,7 +42,7 @@ import (
"github.com/fluxcd/pkg/ssa"
"github.com/fluxcd/flux2/pkg/printers"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
)
func (b *Builder) Manager() (*ssa.ResourceManager, error) {

@ -1,4 +1,4 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra

@ -1,5 +1,5 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-namespace
@ -11,7 +11,7 @@ spec:
prune: true
---
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo
@ -22,11 +22,11 @@ spec:
branch: master
url: https://github.com/stefanprodan/podinfo
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
namespace: flux-system
spec:
path: "./clusters/test-build"
---
---

@ -1,4 +1,4 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo

@ -1,4 +1,4 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo

@ -44,12 +44,14 @@ import (
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
imageautov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagereflectv1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
"github.com/fluxcd/pkg/apis/meta"
runclient "github.com/fluxcd/pkg/runtime/client"
"github.com/fluxcd/pkg/version"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
)
@ -126,10 +128,12 @@ func NewScheme() *apiruntime.Scheme {
_ = rbacv1.AddToScheme(scheme)
_ = appsv1.AddToScheme(scheme)
_ = networkingv1.AddToScheme(scheme)
_ = sourcev1b2.AddToScheme(scheme)
_ = sourcev1.AddToScheme(scheme)
_ = kustomizev1.AddToScheme(scheme)
_ = helmv2.AddToScheme(scheme)
_ = notificationv1.AddToScheme(scheme)
_ = notificationv1b2.AddToScheme(scheme)
_ = imagereflectv1.AddToScheme(scheme)
_ = imageautov1.AddToScheme(scheme)
return scheme

@ -30,7 +30,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"

@ -36,7 +36,7 @@ import (
"sigs.k8s.io/kustomize/api/konfig"
"sigs.k8s.io/yaml"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/kustomize/filesys"
runclient "github.com/fluxcd/pkg/runtime/client"

@ -26,9 +26,9 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/fluxcd/flux2/pkg/manifestgen"
)

@ -24,8 +24,8 @@ import (
"strings"
"testing"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
func TestGenerate(t *testing.T) {

@ -33,9 +33,11 @@ import (
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
// Components removes all Kubernetes components that are part of Flux excluding the CRDs and namespace.
@ -144,7 +146,7 @@ func Finalizers(ctx context.Context, logger log.Logger, kubeClient client.Client
}
}
{
var list sourcev1.OCIRepositoryList
var list sourcev1b2.OCIRepositoryList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}
@ -158,7 +160,7 @@ func Finalizers(ctx context.Context, logger log.Logger, kubeClient client.Client
}
}
{
var list sourcev1.HelmRepositoryList
var list sourcev1b2.HelmRepositoryList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}
@ -172,7 +174,7 @@ func Finalizers(ctx context.Context, logger log.Logger, kubeClient client.Client
}
}
{
var list sourcev1.HelmChartList
var list sourcev1b2.HelmChartList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}
@ -186,7 +188,7 @@ func Finalizers(ctx context.Context, logger log.Logger, kubeClient client.Client
}
}
{
var list sourcev1.BucketList
var list sourcev1b2.BucketList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}
@ -228,7 +230,7 @@ func Finalizers(ctx context.Context, logger log.Logger, kubeClient client.Client
}
}
{
var list notificationv1.AlertList
var list notificationv1b2.AlertList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}
@ -242,7 +244,7 @@ func Finalizers(ctx context.Context, logger log.Logger, kubeClient client.Client
}
}
{
var list notificationv1.ProviderList
var list notificationv1b2.ProviderList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}

@ -51,8 +51,9 @@ import (
"github.com/fluxcd/go-git/v5/plumbing"
automationv1beta1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
reflectorv1beta2 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notiv1beta1 "github.com/fluxcd/notification-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notiv1 "github.com/fluxcd/notification-controller/api/v1"
notiv1beta2 "github.com/fluxcd/notification-controller/api/v1beta2"
eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
@ -678,14 +679,14 @@ func TestAzureDevOpsCommitStatus(t *testing.T) {
}
return nil
})
provider := notiv1beta1.Provider{
provider := notiv1beta2.Provider{
ObjectMeta: metav1.ObjectMeta{
Name: "azuredevops",
Namespace: name,
},
}
_, err = controllerutil.CreateOrUpdate(ctx, cfg.kubeClient, &provider, func() error {
provider.Spec = notiv1beta1.ProviderSpec{
provider.Spec = notiv1beta2.ProviderSpec{
Type: "azuredevops",
Address: repoUrl,
SecretRef: &meta.LocalObjectReference{
@ -695,18 +696,18 @@ func TestAzureDevOpsCommitStatus(t *testing.T) {
return nil
})
require.NoError(t, err)
alert := notiv1beta1.Alert{
alert := notiv1beta2.Alert{
ObjectMeta: metav1.ObjectMeta{
Name: "azuredevops",
Namespace: name,
},
}
_, err = controllerutil.CreateOrUpdate(ctx, cfg.kubeClient, &alert, func() error {
alert.Spec = notiv1beta1.AlertSpec{
alert.Spec = notiv1beta2.AlertSpec{
ProviderRef: meta.LocalObjectReference{
Name: provider.Name,
},
EventSources: []notiv1beta1.CrossNamespaceObjectReference{
EventSources: []notiv1.CrossNamespaceObjectReference{
{
Kind: "Kustomization",
Name: name,
@ -806,14 +807,14 @@ func TestEventHubNotification(t *testing.T) {
}
return nil
})
provider := notiv1beta1.Provider{
provider := notiv1beta2.Provider{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: name,
},
}
_, err = controllerutil.CreateOrUpdate(ctx, cfg.kubeClient, &provider, func() error {
provider.Spec = notiv1beta1.ProviderSpec{
provider.Spec = notiv1beta2.ProviderSpec{
Type: "azureeventhub",
Address: repoUrl,
SecretRef: &meta.LocalObjectReference{
@ -823,18 +824,18 @@ func TestEventHubNotification(t *testing.T) {
return nil
})
require.NoError(t, err)
alert := notiv1beta1.Alert{
alert := notiv1beta2.Alert{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: name,
},
}
_, err = controllerutil.CreateOrUpdate(ctx, cfg.kubeClient, &alert, func() error {
alert.Spec = notiv1beta1.AlertSpec{
alert.Spec = notiv1beta2.AlertSpec{
ProviderRef: meta.LocalObjectReference{
Name: provider.Name,
},
EventSources: []notiv1beta1.CrossNamespaceObjectReference{
EventSources: []notiv1.CrossNamespaceObjectReference{
{
Kind: "Kustomization",
Name: name,

@ -8,23 +8,23 @@ require (
github.com/fluxcd/helm-controller/api v0.31.2
github.com/fluxcd/image-automation-controller/api v0.31.0
github.com/fluxcd/image-reflector-controller/api v0.26.1
github.com/fluxcd/kustomize-controller/api v0.35.1
github.com/fluxcd/notification-controller/api v0.33.0
github.com/fluxcd/kustomize-controller/api v1.0.0-rc.1
github.com/fluxcd/notification-controller/api v1.0.0-rc.1
github.com/fluxcd/pkg/apis/event v0.4.1
github.com/fluxcd/pkg/apis/meta v0.19.1
github.com/fluxcd/pkg/apis/meta v1.0.0
github.com/fluxcd/pkg/git v0.11.0
github.com/fluxcd/pkg/git/gogit v0.8.1
github.com/fluxcd/source-controller/api v0.36.1
github.com/fluxcd/source-controller/api v1.0.0-rc.1
github.com/hashicorp/hc-install v0.5.0
github.com/hashicorp/terraform-exec v0.18.1
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
github.com/stretchr/testify v1.8.2
github.com/whilp/git-urls v1.0.0
go.uber.org/multierr v1.10.0
k8s.io/api v0.26.2
k8s.io/apimachinery v0.26.2
k8s.io/client-go v0.26.2
sigs.k8s.io/controller-runtime v0.14.5
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
sigs.k8s.io/controller-runtime v0.14.6
)
// Fix CVE-2022-28948
@ -55,7 +55,7 @@ require (
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fluxcd/pkg/apis/acl v0.1.0 // indirect
github.com/fluxcd/pkg/apis/kustomize v0.8.1 // indirect
github.com/fluxcd/pkg/apis/kustomize v1.0.0 // indirect
github.com/fluxcd/pkg/ssh v0.7.3 // indirect
github.com/fluxcd/pkg/version v0.2.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
@ -110,7 +110,7 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.2 // indirect
k8s.io/apiextensions-apiserver v0.26.3 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect

@ -142,18 +142,18 @@ github.com/fluxcd/image-automation-controller/api v0.31.0 h1:xA2MXbVpXWAFBCmlaOq
github.com/fluxcd/image-automation-controller/api v0.31.0/go.mod h1:kNQ/g5TK0Epwguma2+Y1binRMRZ1d6E2VmZLg2iGkqw=
github.com/fluxcd/image-reflector-controller/api v0.26.1 h1:AKfqabDlcouGilX0y+/Wa1R9qwMb6ZlTHD1ELEkK9tw=
github.com/fluxcd/image-reflector-controller/api v0.26.1/go.mod h1:xZILku1/O6higkHTW/D3dvte4Ld7kRuZH9r+Rm4p1B0=
github.com/fluxcd/kustomize-controller/api v0.35.1 h1:l7AndDJXVLZcCHmEIRXU9ksWInlP6SjFtHQH1SC7++c=
github.com/fluxcd/kustomize-controller/api v0.35.1/go.mod h1:hrxVOUss0om4mg+ykMYtH4CgLuM2RReSPf0hG9e0b18=
github.com/fluxcd/notification-controller/api v0.33.0 h1:iVnIGDfkpVuzcILSGwi//Q3devCg7E7G4lfDx8vuvsA=
github.com/fluxcd/notification-controller/api v0.33.0/go.mod h1:0IyWy0J6+z1TbijVQjFx1gWQDOzXaRfzV2NClfjHZPk=
github.com/fluxcd/kustomize-controller/api v1.0.0-rc.1 h1:HnPpGw9RhVyE4LsvOOMUcCo4jA+gSfnkM2Xe/vjlpHg=
github.com/fluxcd/kustomize-controller/api v1.0.0-rc.1/go.mod h1:ql/HdV+pGzqnHaU5oNyvYR7lHPWc/me3HUPd4g7A9BI=
github.com/fluxcd/notification-controller/api v1.0.0-rc.1 h1:L6xM9Nvm2icc7SqcUSXYiIY8bTiV73kss5KleaUewts=
github.com/fluxcd/notification-controller/api v1.0.0-rc.1/go.mod h1:bfZCGyWq1SPmZSQSCuHRum5Z1olidWp8UbZkO5kcato=
github.com/fluxcd/pkg/apis/acl v0.1.0 h1:EoAl377hDQYL3WqanWCdifauXqXbMyFuK82NnX6pH4Q=
github.com/fluxcd/pkg/apis/acl v0.1.0/go.mod h1:zfEZzz169Oap034EsDhmCAGgnWlcWmIObZjYMusoXS8=
github.com/fluxcd/pkg/apis/event v0.4.1 h1:63wP8NM/uA4680F4Ft8q8/0rJivX90i7FmMkRvUI8Is=
github.com/fluxcd/pkg/apis/event v0.4.1/go.mod h1:LHT1ZsbMrcHwCHQCaFtQviQBZwhMOAbTUPK6+KgBkFo=
github.com/fluxcd/pkg/apis/kustomize v0.8.1 h1:uRH9xVDJfSBGIiL6PIhkguHvf2Nme6uTWX+RX1iZznc=
github.com/fluxcd/pkg/apis/kustomize v0.8.1/go.mod h1:TBem+2mHp6Ib7XD1fmzDkoUnBzx07wSzIYo6BVx3XAc=
github.com/fluxcd/pkg/apis/meta v0.19.1 h1:fCI5CnTXpAqr67UlaI9q0H+OztMKB5kDTr6xV6vlAo0=
github.com/fluxcd/pkg/apis/meta v0.19.1/go.mod h1:ZPPMYrPnWwPQYNEGM/Uc0N4SurUPS3xNI3IIpCQEfuM=
github.com/fluxcd/pkg/apis/kustomize v1.0.0 h1:5T2b/mRZiGWtP7fvSU8gZOApIc06H6SdLX3MlsE6LRo=
github.com/fluxcd/pkg/apis/kustomize v1.0.0/go.mod h1:XaDYlKxrf9D2zZWcZ0BnSIqGtcm8mdNtJGzZWYjCnQo=
github.com/fluxcd/pkg/apis/meta v1.0.0 h1:i9IGHd/VNEZELX7mepkiYFbJxs2J5znaB4cN9z2nPm8=
github.com/fluxcd/pkg/apis/meta v1.0.0/go.mod h1:04ZdpZYm1x+aL93K4daNHW1UX6E8K7Gyf5za9OhrE+U=
github.com/fluxcd/pkg/git v0.11.0 h1:GvB+3QOB8xbF5WNjVrkskseOnsZBuqSOzW3VxfsHuX4=
github.com/fluxcd/pkg/git v0.11.0/go.mod h1:VHRVlrZMHNoWBlaSAWxlGH6Vwlb9VRazUhPUykviHwY=
github.com/fluxcd/pkg/git/gogit v0.8.1 h1:Q3EV2WBX6HiXSmsHyrwFzwl82gO4ZtFwb675iQPWwVc=
@ -163,8 +163,8 @@ github.com/fluxcd/pkg/ssh v0.7.3 h1:Dhs+nXdp806lBriUJtPyRi0SVIVWbJafJGD/qQ71GiY=
github.com/fluxcd/pkg/ssh v0.7.3/go.mod h1:/z5ZNgQz+h9s/2nNFKAcZDHtZRMA1nj5YcriGDUOoLY=
github.com/fluxcd/pkg/version v0.2.1 h1:RRH7+6qiWHdTvRNwpoBmilnubJ2C4FZYGgy5wTDVKVc=
github.com/fluxcd/pkg/version v0.2.1/go.mod h1:UmUYHDz4BxHQMesMUx3gYVrT2Wf66H49JpTg/PW+/OY=
github.com/fluxcd/source-controller/api v0.36.1 h1:/ul69kJNEwrFG1Cwk2P/GwgraIxOETCL+tP+zMtxTu8=
github.com/fluxcd/source-controller/api v0.36.1/go.mod h1:GktZmd5Dfxo84vPFBdLDl0bBtiJRODfd47uugK0romU=
github.com/fluxcd/source-controller/api v1.0.0-rc.1 h1:MZaP5utClMG95Aw/AVu1l05WEfmpEw/RIlCLnkCQl14=
github.com/fluxcd/source-controller/api v1.0.0-rc.1/go.mod h1:CvGNdS8g/MqwpERUK6aJp4lndsrm+JBzGpoyyZ4u0c8=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
@ -778,14 +778,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.26.2 h1:dM3cinp3PGB6asOySalOZxEG4CZ0IAdJsrYZXE/ovGQ=
k8s.io/api v0.26.2/go.mod h1:1kjMQsFE+QHPfskEcVNgL3+Hp88B80uj0QtSOlj8itU=
k8s.io/apiextensions-apiserver v0.26.2 h1:/yTG2B9jGY2Q70iGskMf41qTLhL9XeNN2KhI0uDgwko=
k8s.io/apiextensions-apiserver v0.26.2/go.mod h1:Y7UPgch8nph8mGCuVk0SK83LnS8Esf3n6fUBgew8SH8=
k8s.io/apimachinery v0.26.2 h1:da1u3D5wfR5u2RpLhE/ZtZS2P7QvDgLZTi9wrNZl/tQ=
k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I=
k8s.io/client-go v0.26.2 h1:s1WkVujHX3kTp4Zn4yGNFK+dlDXy1bAAkIl+cFAiuYI=
k8s.io/client-go v0.26.2/go.mod h1:u5EjOuSyBa09yqqyY7m3abZeovO/7D/WehVVlZ2qcqU=
k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=
k8s.io/apiextensions-apiserver v0.26.3 h1:5PGMm3oEzdB1W/FTMgGIDmm100vn7IaUP5er36dB+YE=
k8s.io/apiextensions-apiserver v0.26.3/go.mod h1:jdA5MdjNWGP+njw1EKMZc64xAT5fIhN6VJrElV3sfpQ=
k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k=
k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I=
k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s=
k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ=
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70 h1:zfqQc1V6/ZgGpvrOVvr62OjiqQX4lZjfznK34NQwkqw=
@ -795,8 +795,8 @@ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/controller-runtime v0.14.5 h1:6xaWFqzT5KuAQ9ufgUaj1G/+C4Y1GRkhrxl+BJ9i+5s=
sigs.k8s.io/controller-runtime v0.14.5/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA=
sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=

@ -43,14 +43,15 @@ import (
helmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
automationv1beta1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
reflectorv1beta2 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notiv1beta1 "github.com/fluxcd/notification-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notiv1 "github.com/fluxcd/notification-controller/api/v1"
notiv1beta2 "github.com/fluxcd/notification-controller/api/v1beta2"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit"
"github.com/fluxcd/pkg/git/repository"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
)
const defaultBranch = "main"
@ -71,6 +72,10 @@ func getKubernetesCredentials(kubeconfig, aksHost, aksCert, aksKey, aksCa string
CAData: []byte(aksCa),
},
}
err = sourcev1b2.AddToScheme(scheme.Scheme)
if err != nil {
return "", nil, err
}
err = sourcev1.AddToScheme(scheme.Scheme)
if err != nil {
return "", nil, err
@ -91,7 +96,11 @@ func getKubernetesCredentials(kubeconfig, aksHost, aksCert, aksKey, aksCa string
if err != nil {
return "", nil, err
}
err = notiv1beta1.AddToScheme(scheme.Scheme)
err = notiv1beta2.AddToScheme(scheme.Scheme)
if err != nil {
return "", nil, err
}
err = notiv1.AddToScheme(scheme.Scheme)
if err != nil {
return "", nil, err
}
@ -251,7 +260,6 @@ func setupNamespace(ctx context.Context, kubeClient client.Client, repoUrl, pass
Interval: metav1.Duration{
Duration: 1 * time.Minute,
},
GitImplementation: sourcev1.LibGit2Implementation,
Reference: &sourcev1.GitRepositoryRef{
Branch: name,
},

Loading…
Cancel
Save