@@ -29,9 +29,7 @@ import (
2929"sigs.k8s.io/controller-runtime/pkg/client"
3030
3131"github.com/fluxcd/pkg/apis/meta"
32-
3332sourcev1"github.com/fluxcd/source-controller/api/v1"
34- sourcev1b2"github.com/fluxcd/source-controller/api/v1beta2"
3533
3634"github.com/fluxcd/flux2/v2/internal/flags"
3735"github.com/fluxcd/flux2/v2/internal/utils"
@@ -81,7 +79,7 @@ var sourceOCIRepositoryArgs = newSourceOCIFlags()
8179
8280func newSourceOCIFlags ()sourceOCIRepositoryFlags {
8381return sourceOCIRepositoryFlags {
84- provider :flags .SourceOCIProvider (sourcev1b2 .GenericOCIProvider ),
82+ provider :flags .SourceOCIProvider (sourcev1 .GenericOCIProvider ),
8583}
8684}
8785
@@ -127,20 +125,20 @@ func createSourceOCIRepositoryCmdRun(cmd *cobra.Command, args []string) error {
127125ignorePaths = & ignorePathsStr
128126}
129127
130- repository := & sourcev1b2 .OCIRepository {
128+ repository := & sourcev1 .OCIRepository {
131129ObjectMeta : metav1.ObjectMeta {
132130Name :name ,
133131Namespace :* kubeconfigArgs .Namespace ,
134132Labels :sourceLabels ,
135133},
136- Spec :sourcev1b2 .OCIRepositorySpec {
134+ Spec :sourcev1 .OCIRepositorySpec {
137135Provider :sourceOCIRepositoryArgs .provider .String (),
138136URL :sourceOCIRepositoryArgs .url ,
139137Insecure :sourceOCIRepositoryArgs .insecure ,
140138Interval : metav1.Duration {
141139Duration :createArgs .interval ,
142140},
143- Reference :& sourcev1b2 .OCIRepositoryRef {},
141+ Reference :& sourcev1 .OCIRepositoryRef {},
144142Ignore :ignorePaths ,
145143},
146144}
@@ -237,13 +235,13 @@ func createSourceOCIRepositoryCmdRun(cmd *cobra.Command, args []string) error {
237235}
238236
239237func upsertOCIRepository (ctx context.Context ,kubeClient client.Client ,
240- ociRepository * sourcev1b2 .OCIRepository ) (types.NamespacedName ,error ) {
238+ ociRepository * sourcev1 .OCIRepository ) (types.NamespacedName ,error ) {
241239namespacedName := types.NamespacedName {
242240Namespace :ociRepository .GetNamespace (),
243241Name :ociRepository .GetName (),
244242}
245243
246- var existing sourcev1b2 .OCIRepository
244+ var existing sourcev1 .OCIRepository
247245err := kubeClient .Get (ctx ,namespacedName ,& existing )
248246if err != nil {
249247if errors .IsNotFound (err ) {