diff --git a/cmd/flux/create_image_policy.go b/cmd/flux/create_image_policy.go index 5f8c8ab1..6fa79b22 100644 --- a/cmd/flux/create_image_policy.go +++ b/cmd/flux/create_image_policy.go @@ -28,7 +28,7 @@ import ( "github.com/fluxcd/pkg/apis/meta" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var createImagePolicyCmd = &cobra.Command{ diff --git a/cmd/flux/create_image_repository.go b/cmd/flux/create_image_repository.go index d8c3b1de..033414b1 100644 --- a/cmd/flux/create_image_repository.go +++ b/cmd/flux/create_image_repository.go @@ -26,7 +26,7 @@ import ( "github.com/fluxcd/pkg/apis/meta" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var createImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/create_image_update.go b/cmd/flux/create_image_update.go index 59da4e53..4495c811 100644 --- a/cmd/flux/create_image_update.go +++ b/cmd/flux/create_image_update.go @@ -22,9 +22,8 @@ import ( "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/fluxcd/pkg/apis/meta" - - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var createImageUpdateCmd = &cobra.Command{ @@ -113,25 +112,33 @@ func createImageUpdateRun(cmd *cobra.Command, args []string) error { Labels: labels, }, Spec: autov1.ImageUpdateAutomationSpec{ - Checkout: autov1.GitCheckoutSpec{ - GitRepositoryRef: meta.LocalObjectReference{ - Name: imageUpdateArgs.gitRepoRef, + SourceRef: autov1.SourceReference{ + Kind: sourcev1.GitRepositoryKind, + Name: imageUpdateArgs.gitRepoRef, + }, + + GitSpec: &autov1.GitSpec{ + Checkout: &autov1.GitCheckoutSpec{ + Reference: sourcev1.GitRepositoryRef{ + Branch: imageUpdateArgs.checkoutBranch, + }, + }, + Commit: autov1.CommitSpec{ + Author: autov1.CommitUser{ + Name: imageUpdateArgs.authorName, + Email: imageUpdateArgs.authorEmail, + }, + MessageTemplate: imageUpdateArgs.commitTemplate, }, - Branch: imageUpdateArgs.checkoutBranch, }, Interval: metav1.Duration{ Duration: createArgs.interval, }, - Commit: autov1.CommitSpec{ - AuthorName: imageUpdateArgs.authorName, - AuthorEmail: imageUpdateArgs.authorEmail, - MessageTemplate: imageUpdateArgs.commitTemplate, - }, }, } if imageUpdateArgs.pushBranch != "" { - update.Spec.Push = &autov1.PushSpec{ + update.Spec.GitSpec.Push = &autov1.PushSpec{ Branch: imageUpdateArgs.pushBranch, } } diff --git a/cmd/flux/delete_image_policy.go b/cmd/flux/delete_image_policy.go index bf4f5ad5..06f65c18 100644 --- a/cmd/flux/delete_image_policy.go +++ b/cmd/flux/delete_image_policy.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var deleteImagePolicyCmd = &cobra.Command{ diff --git a/cmd/flux/delete_image_repository.go b/cmd/flux/delete_image_repository.go index 6b1d50be..7193fa3d 100644 --- a/cmd/flux/delete_image_repository.go +++ b/cmd/flux/delete_image_repository.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var deleteImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/delete_image_update.go b/cmd/flux/delete_image_update.go index f419aa2c..4fb4df5e 100644 --- a/cmd/flux/delete_image_update.go +++ b/cmd/flux/delete_image_update.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" ) var deleteImageUpdateCmd = &cobra.Command{ diff --git a/cmd/flux/export_image_policy.go b/cmd/flux/export_image_policy.go index 6eb546bb..bc57feea 100644 --- a/cmd/flux/export_image_policy.go +++ b/cmd/flux/export_image_policy.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var exportImagePolicyCmd = &cobra.Command{ diff --git a/cmd/flux/export_image_repository.go b/cmd/flux/export_image_repository.go index 6f9484f8..a8386bfd 100644 --- a/cmd/flux/export_image_repository.go +++ b/cmd/flux/export_image_repository.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var exportImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/export_image_update.go b/cmd/flux/export_image_update.go index 761ad2f1..3619c0a6 100644 --- a/cmd/flux/export_image_update.go +++ b/cmd/flux/export_image_update.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" ) var exportImageUpdateCmd = &cobra.Command{ diff --git a/cmd/flux/get_image_all.go b/cmd/flux/get_image_all.go index d3b27b48..a4bda6b3 100644 --- a/cmd/flux/get_image_all.go +++ b/cmd/flux/get_image_all.go @@ -21,8 +21,8 @@ import ( "github.com/spf13/cobra" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var getImageAllCmd = &cobra.Command{ diff --git a/cmd/flux/get_image_policy.go b/cmd/flux/get_image_policy.go index 0d010528..6cf6f00d 100644 --- a/cmd/flux/get_image_policy.go +++ b/cmd/flux/get_image_policy.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var getImagePolicyCmd = &cobra.Command{ diff --git a/cmd/flux/get_image_repository.go b/cmd/flux/get_image_repository.go index 707d01a2..0a12d0a8 100644 --- a/cmd/flux/get_image_repository.go +++ b/cmd/flux/get_image_repository.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var getImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/get_image_update.go b/cmd/flux/get_image_update.go index a2aae04a..3de8aa90 100644 --- a/cmd/flux/get_image_update.go +++ b/cmd/flux/get_image_update.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" ) var getImageUpdateCmd = &cobra.Command{ diff --git a/cmd/flux/image.go b/cmd/flux/image.go index 4bf6e57b..01a92f43 100644 --- a/cmd/flux/image.go +++ b/cmd/flux/image.go @@ -19,8 +19,8 @@ package main import ( "sigs.k8s.io/controller-runtime/pkg/client" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) // These are general-purpose adapters for attaching methods to, for diff --git a/cmd/flux/reconcile_image_repository.go b/cmd/flux/reconcile_image_repository.go index 0c4ceaca..1314ded8 100644 --- a/cmd/flux/reconcile_image_repository.go +++ b/cmd/flux/reconcile_image_repository.go @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var reconcileImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/reconcile_image_updateauto.go b/cmd/flux/reconcile_image_updateauto.go index a7620312..453ad867 100644 --- a/cmd/flux/reconcile_image_updateauto.go +++ b/cmd/flux/reconcile_image_updateauto.go @@ -22,7 +22,7 @@ import ( "github.com/spf13/cobra" apimeta "k8s.io/apimachinery/pkg/api/meta" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" meta "github.com/fluxcd/pkg/apis/meta" ) diff --git a/cmd/flux/resume_image_repository.go b/cmd/flux/resume_image_repository.go index f1567817..3153a174 100644 --- a/cmd/flux/resume_image_repository.go +++ b/cmd/flux/resume_image_repository.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var resumeImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/resume_image_updateauto.go b/cmd/flux/resume_image_updateauto.go index 6e7152c0..2d92d54e 100644 --- a/cmd/flux/resume_image_updateauto.go +++ b/cmd/flux/resume_image_updateauto.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" ) var resumeImageUpdateCmd = &cobra.Command{ diff --git a/cmd/flux/suspend_image_repository.go b/cmd/flux/suspend_image_repository.go index c0315f72..6ea3f45f 100644 --- a/cmd/flux/suspend_image_repository.go +++ b/cmd/flux/suspend_image_repository.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" ) var suspendImageRepositoryCmd = &cobra.Command{ diff --git a/cmd/flux/suspend_image_updateauto.go b/cmd/flux/suspend_image_updateauto.go index fae2b475..c8bd8aca 100644 --- a/cmd/flux/suspend_image_updateauto.go +++ b/cmd/flux/suspend_image_updateauto.go @@ -19,7 +19,7 @@ package main import ( "github.com/spf13/cobra" - autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" + autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" ) var suspendImageUpdateCmd = &cobra.Command{ diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 461fdd74..5cefc4c4 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -30,8 +30,8 @@ import ( "text/template" helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" - imageautov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" - imagereflectv1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" + imageautov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2" + imagereflectv1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2" kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1" "github.com/fluxcd/pkg/runtime/dependency"