Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit79fed69

Browse files
committed
Update CLI to OCIRepository v1 (GA)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 parentb37ba73 commit79fed69

File tree

37 files changed

+61
-76
lines changed

37 files changed

+61
-76
lines changed

‎cmd/flux/create_helmrelease.go‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"github.com/fluxcd/pkg/apis/meta"
3838
"github.com/fluxcd/pkg/runtime/transform"
3939
sourcev1"github.com/fluxcd/source-controller/api/v1"
40-
sourcev1b2"github.com/fluxcd/source-controller/api/v1beta2"
4140

4241
"github.com/fluxcd/flux2/v2/internal/flags"
4342
"github.com/fluxcd/flux2/v2/internal/utils"
@@ -142,7 +141,7 @@ var helmReleaseArgs helmReleaseFlags
142141

143142
varsupportedHelmReleaseValuesFromKinds= []string{"Secret","ConfigMap"}
144143

145-
varsupportedHelmReleaseReferenceKinds= []string{sourcev1b2.OCIRepositoryKind,sourcev1.HelmChartKind}
144+
varsupportedHelmReleaseReferenceKinds= []string{sourcev1.OCIRepositoryKind,sourcev1.HelmChartKind}
146145

147146
funcinit() {
148147
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.name,"release-name","","name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
@@ -222,7 +221,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
222221
}
223222
casehelmReleaseArgs.chartRef!="":
224223
kind,name,ns:=utils.ParseObjectKindNameNamespace(helmReleaseArgs.chartRef)
225-
ifkind!=sourcev1.HelmChartKind&&kind!=sourcev1b2.OCIRepositoryKind {
224+
ifkind!=sourcev1.HelmChartKind&&kind!=sourcev1.OCIRepositoryKind {
226225
returnfmt.Errorf("chart reference kind '%s' is not supported, must be one of: %s",
227226
kind,strings.Join(supportedHelmReleaseReferenceKinds,", "))
228227
}

‎cmd/flux/create_source_oci.go‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ import (
2929
"sigs.k8s.io/controller-runtime/pkg/client"
3030

3131
"github.com/fluxcd/pkg/apis/meta"
32-
3332
sourcev1"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

8280
funcnewSourceOCIFlags()sourceOCIRepositoryFlags {
8381
returnsourceOCIRepositoryFlags{
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 {
127125
ignorePaths=&ignorePathsStr
128126
}
129127

130-
repository:=&sourcev1b2.OCIRepository{
128+
repository:=&sourcev1.OCIRepository{
131129
ObjectMeta: metav1.ObjectMeta{
132130
Name:name,
133131
Namespace:*kubeconfigArgs.Namespace,
134132
Labels:sourceLabels,
135133
},
136-
Spec:sourcev1b2.OCIRepositorySpec{
134+
Spec:sourcev1.OCIRepositorySpec{
137135
Provider:sourceOCIRepositoryArgs.provider.String(),
138136
URL:sourceOCIRepositoryArgs.url,
139137
Insecure:sourceOCIRepositoryArgs.insecure,
140138
Interval: metav1.Duration{
141139
Duration:createArgs.interval,
142140
},
143-
Reference:&sourcev1b2.OCIRepositoryRef{},
141+
Reference:&sourcev1.OCIRepositoryRef{},
144142
Ignore:ignorePaths,
145143
},
146144
}
@@ -237,13 +235,13 @@ func createSourceOCIRepositoryCmdRun(cmd *cobra.Command, args []string) error {
237235
}
238236

239237
funcupsertOCIRepository(ctx context.Context,kubeClient client.Client,
240-
ociRepository*sourcev1b2.OCIRepository) (types.NamespacedName,error) {
238+
ociRepository*sourcev1.OCIRepository) (types.NamespacedName,error) {
241239
namespacedName:= types.NamespacedName{
242240
Namespace:ociRepository.GetNamespace(),
243241
Name:ociRepository.GetName(),
244242
}
245243

246-
varexistingsourcev1b2.OCIRepository
244+
varexistingsourcev1.OCIRepository
247245
err:=kubeClient.Get(ctx,namespacedName,&existing)
248246
iferr!=nil {
249247
iferrors.IsNotFound(err) {

‎cmd/flux/delete_source_chart.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package main
1919
import (
2020
"github.com/spf13/cobra"
2121

22-
sourcev1"github.com/fluxcd/source-controller/api/v1beta2"
22+
sourcev1"github.com/fluxcd/source-controller/api/v1"
2323
)
2424

2525
vardeleteSourceChartCmd=&cobra.Command{

‎cmd/flux/delete_source_oci.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package main
1919
import (
2020
"github.com/spf13/cobra"
2121

22-
sourcev1"github.com/fluxcd/source-controller/api/v1beta2"
22+
sourcev1"github.com/fluxcd/source-controller/api/v1"
2323
)
2424

2525
vardeleteSourceOCIRepositoryCmd=&cobra.Command{

‎cmd/flux/diff_artifact.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323

2424
"github.com/fluxcd/pkg/oci"
25-
sourcev1"github.com/fluxcd/source-controller/api/v1beta2"
25+
sourcev1"github.com/fluxcd/source-controller/api/v1"
2626
"github.com/google/go-containerregistry/pkg/crane"
2727
"github.com/spf13/cobra"
2828

‎cmd/flux/events.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import (
4646
notificationv1"github.com/fluxcd/notification-controller/api/v1"
4747
notificationv1b3"github.com/fluxcd/notification-controller/api/v1beta3"
4848
sourcev1"github.com/fluxcd/source-controller/api/v1"
49-
sourcev1b2"github.com/fluxcd/source-controller/api/v1beta2"
5049

5150
"github.com/fluxcd/flux2/v2/internal/utils"
5251
"github.com/fluxcd/flux2/v2/pkg/printers"
@@ -446,7 +445,7 @@ var fluxKindMap = refMap{
446445
field: []string{"spec","sourceRef"},
447446
},
448447
sourcev1.GitRepositoryKind: {gvk:sourcev1.GroupVersion.WithKind(sourcev1.GitRepositoryKind)},
449-
sourcev1b2.OCIRepositoryKind: {gvk:sourcev1b2.GroupVersion.WithKind(sourcev1b2.OCIRepositoryKind)},
448+
sourcev1.OCIRepositoryKind:{gvk:sourcev1.GroupVersion.WithKind(sourcev1.OCIRepositoryKind)},
450449
sourcev1.BucketKind: {gvk:sourcev1.GroupVersion.WithKind(sourcev1.BucketKind)},
451450
sourcev1.HelmRepositoryKind: {gvk:sourcev1.GroupVersion.WithKind(sourcev1.HelmRepositoryKind)},
452451
autov1.ImageUpdateAutomationKind: {gvk:autov1.GroupVersion.WithKind(autov1.ImageUpdateAutomationKind)},

‎cmd/flux/export_source_oci.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
metav1"k8s.io/apimachinery/pkg/apis/meta/v1"
2222
"k8s.io/apimachinery/pkg/types"
2323

24-
sourcev1"github.com/fluxcd/source-controller/api/v1beta2"
24+
sourcev1"github.com/fluxcd/source-controller/api/v1"
2525
)
2626

2727
varexportSourceOCIRepositoryCmd=&cobra.Command{

‎cmd/flux/get_source_all.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
apimeta"k8s.io/apimachinery/pkg/api/meta"
2222

2323
sourcev1"github.com/fluxcd/source-controller/api/v1"
24-
sourcev1b2"github.com/fluxcd/source-controller/api/v1beta2"
2524
)
2625

2726
vargetSourceAllCmd=&cobra.Command{
@@ -42,7 +41,7 @@ var getSourceAllCmd = &cobra.Command{
4241
varallSourceCmd= []getCommand{
4342
{
4443
apiType:ociRepositoryType,
45-
list:&ociRepositoryListAdapter{&sourcev1b2.OCIRepositoryList{}},
44+
list:&ociRepositoryListAdapter{&sourcev1.OCIRepositoryList{}},
4645
},
4746
{
4847
apiType:bucketType,

‎cmd/flux/get_source_oci.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"golang.org/x/text/language"
2626
"k8s.io/apimachinery/pkg/runtime"
2727

28-
sourcev1"github.com/fluxcd/source-controller/api/v1beta2"
28+
sourcev1"github.com/fluxcd/source-controller/api/v1"
2929

3030
"github.com/fluxcd/flux2/v2/internal/utils"
3131
)

‎cmd/flux/list_artifact.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/spf13/cobra"
2525

2626
"github.com/fluxcd/pkg/oci"
27-
sourcev1"github.com/fluxcd/source-controller/api/v1beta2"
27+
sourcev1"github.com/fluxcd/source-controller/api/v1"
2828

2929
"github.com/fluxcd/flux2/v2/internal/flags"
3030
"github.com/fluxcd/flux2/v2/pkg/printers"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp