Skip to content

Commit 13f8589

Browse files
darkowlzzhiddeco
authored andcommitted
Use source-controller v1beta2 API
Signed-off-by: Sunny <darkowlzz@protonmail.com>
1 parent 4388efb commit 13f8589

28 files changed

+244
-284
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
IMG ?= fluxcd/kustomize-controller:latest
33
# Produce CRDs that work back to Kubernetes 1.16
44
CRD_OPTIONS ?= crd:crdVersions=v1
5-
SOURCE_VER ?= v0.21.2
5+
SOURCE_VER ?= rewrite-dev
66

77
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
88
ifeq (,$(shell go env GOBIN))

api/go.mod

+4-18
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,29 @@ go 1.17
44

55
require (
66
github.com/fluxcd/pkg/apis/kustomize v0.3.1
7-
github.com/fluxcd/pkg/apis/meta v0.11.0-rc.3
8-
github.com/fluxcd/pkg/runtime v0.13.0-rc.8
7+
github.com/fluxcd/pkg/apis/meta v0.12.0
98
k8s.io/apiextensions-apiserver v0.23.1
10-
k8s.io/apimachinery v0.23.1
9+
k8s.io/apimachinery v0.23.2
1110
sigs.k8s.io/controller-runtime v0.11.0
1211
)
1312

1413
require (
15-
github.com/davecgh/go-spew v1.1.1 // indirect
16-
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
1714
github.com/go-logr/logr v1.2.2 // indirect
1815
github.com/gogo/protobuf v1.3.2 // indirect
19-
github.com/golang/protobuf v1.5.2 // indirect
2016
github.com/google/go-cmp v0.5.6 // indirect
2117
github.com/google/gofuzz v1.2.0 // indirect
22-
github.com/googleapis/gnostic v0.5.5 // indirect
2318
github.com/json-iterator/go v1.1.12 // indirect
2419
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2520
github.com/modern-go/reflect2 v1.0.2 // indirect
26-
github.com/pkg/errors v0.9.1 // indirect
2721
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
28-
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
2922
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08 // indirect
30-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
3123
golang.org/x/text v0.3.7 // indirect
32-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
33-
google.golang.org/appengine v1.6.7 // indirect
34-
google.golang.org/protobuf v1.27.1 // indirect
24+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
3525
gopkg.in/inf.v0 v0.9.1 // indirect
3626
gopkg.in/yaml.v2 v2.4.0 // indirect
37-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
38-
k8s.io/api v0.23.1 // indirect
39-
k8s.io/client-go v0.23.1 // indirect
4027
k8s.io/klog/v2 v2.30.0 // indirect
41-
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
4228
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 // indirect
4329
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
44-
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
30+
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
4531
sigs.k8s.io/yaml v1.3.0 // indirect
4632
)

api/go.sum

+35-33
Large diffs are not rendered by default.

api/v1beta1/zz_generated.deepcopy.go

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta2/condition_types.go

+8
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,12 @@ const (
4040
// DependencyNotReadyReason represents the fact that
4141
// one of the dependencies is not ready.
4242
DependencyNotReadyReason string = "DependencyNotReady"
43+
44+
// ReconciliationSucceededReason represents the fact that
45+
// the reconciliation succeeded.
46+
ReconciliationSucceededReason string = "ReconciliationSucceeded"
47+
48+
// ReconciliationFailedReason represents the fact that
49+
// the reconciliation failed.
50+
ReconciliationFailedReason string = "ReconciliationFailed"
4351
)

api/v1beta2/zz_generated.deepcopy.go

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml

+32-26
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ spec:
6262
used for decryption.
6363
properties:
6464
name:
65-
description: Name of the referent
65+
description: Name of the referent.
6666
type: string
6767
required:
6868
- name
@@ -71,18 +71,19 @@ spec:
7171
- provider
7272
type: object
7373
dependsOn:
74-
description: DependsOn may contain a dependency.CrossNamespaceDependencyReference
74+
description: DependsOn may contain a meta.NamespacedObjectReference
7575
slice with references to Kustomization resources that must be ready
7676
before this Kustomization can be reconciled.
7777
items:
78-
description: CrossNamespaceDependencyReference holds the reference
79-
to a dependency.
78+
description: NamespacedObjectReference contains enough information
79+
to locate the referenced Kubernetes resource object in any namespace.
8080
properties:
8181
name:
82-
description: Name holds the name reference of a dependency.
82+
description: Name of the referent.
8383
type: string
8484
namespace:
85-
description: Namespace holds the namespace reference of a dependency.
85+
description: Namespace of the referent, when not specified it
86+
acts as LocalObjectReference.
8687
type: string
8788
required:
8889
- name
@@ -97,21 +98,22 @@ spec:
9798
description: A list of resources to be included in the health assessment.
9899
items:
99100
description: NamespacedObjectKindReference contains enough information
100-
to let you locate the typed referenced object in any namespace
101+
to locate the typed referenced Kubernetes resource object in any
102+
namespace.
101103
properties:
102104
apiVersion:
103105
description: API version of the referent, if not specified the
104-
Kubernetes preferred version will be used
106+
Kubernetes preferred version will be used.
105107
type: string
106108
kind:
107-
description: Kind of the referent
109+
description: Kind of the referent.
108110
type: string
109111
name:
110-
description: Name of the referent
112+
description: Name of the referent.
111113
type: string
112114
namespace:
113115
description: Namespace of the referent, when not specified it
114-
acts as LocalObjectReference
116+
acts as LocalObjectReference.
115117
type: string
116118
required:
117119
- kind
@@ -164,7 +166,7 @@ spec:
164166
for reconciling the Kustomization.
165167
properties:
166168
name:
167-
description: Name of the referent
169+
description: Name of the referent.
168170
type: string
169171
required:
170172
- name
@@ -513,7 +515,8 @@ spec:
513515
type: string
514516
lastHandledReconcileAt:
515517
description: LastHandledReconcileAt holds the value of the most recent
516-
reconcile request value, so a change can be detected.
518+
reconcile request value, so a change of the annotation value can
519+
be detected.
517520
type: string
518521
observedGeneration:
519522
description: ObservedGeneration is the last reconciled generation.
@@ -598,7 +601,7 @@ spec:
598601
used for decryption.
599602
properties:
600603
name:
601-
description: Name of the referent
604+
description: Name of the referent.
602605
type: string
603606
required:
604607
- name
@@ -607,18 +610,19 @@ spec:
607610
- provider
608611
type: object
609612
dependsOn:
610-
description: DependsOn may contain a dependency.CrossNamespaceDependencyReference
613+
description: DependsOn may contain a meta.NamespacedObjectReference
611614
slice with references to Kustomization resources that must be ready
612615
before this Kustomization can be reconciled.
613616
items:
614-
description: CrossNamespaceDependencyReference holds the reference
615-
to a dependency.
617+
description: NamespacedObjectReference contains enough information
618+
to locate the referenced Kubernetes resource object in any namespace.
616619
properties:
617620
name:
618-
description: Name holds the name reference of a dependency.
621+
description: Name of the referent.
619622
type: string
620623
namespace:
621-
description: Namespace holds the namespace reference of a dependency.
624+
description: Namespace of the referent, when not specified it
625+
acts as LocalObjectReference.
622626
type: string
623627
required:
624628
- name
@@ -633,21 +637,22 @@ spec:
633637
description: A list of resources to be included in the health assessment.
634638
items:
635639
description: NamespacedObjectKindReference contains enough information
636-
to let you locate the typed referenced object in any namespace
640+
to locate the typed referenced Kubernetes resource object in any
641+
namespace.
637642
properties:
638643
apiVersion:
639644
description: API version of the referent, if not specified the
640-
Kubernetes preferred version will be used
645+
Kubernetes preferred version will be used.
641646
type: string
642647
kind:
643-
description: Kind of the referent
648+
description: Kind of the referent.
644649
type: string
645650
name:
646-
description: Name of the referent
651+
description: Name of the referent.
647652
type: string
648653
namespace:
649654
description: Namespace of the referent, when not specified it
650-
acts as LocalObjectReference
655+
acts as LocalObjectReference.
651656
type: string
652657
required:
653658
- kind
@@ -700,7 +705,7 @@ spec:
700705
for reconciling the Kustomization.
701706
properties:
702707
name:
703-
description: Name of the referent
708+
description: Name of the referent.
704709
type: string
705710
required:
706711
- name
@@ -1086,7 +1091,8 @@ spec:
10861091
type: string
10871092
lastHandledReconcileAt:
10881093
description: LastHandledReconcileAt holds the value of the most recent
1089-
reconcile request value, so a change can be detected.
1094+
reconcile request value, so a change of the annotation value can
1095+
be detected.
10901096
type: string
10911097
observedGeneration:
10921098
description: ObservedGeneration is the last reconciled generation.

controllers/kustomization_acl_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
apiacl "github.com/fluxcd/pkg/apis/acl"
2727
"github.com/fluxcd/pkg/apis/meta"
2828
"github.com/fluxcd/pkg/testserver"
29-
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
29+
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
3030
. "github.com/onsi/gomega"
3131
apimeta "k8s.io/apimachinery/pkg/api/meta"
3232
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -114,7 +114,7 @@ stringData:
114114
return resultK.Status.LastAppliedRevision == revision
115115
}, timeout, time.Second).Should(BeTrue())
116116

117-
g.Expect(readyCondition.Reason).To(Equal(meta.ReconciliationSucceededReason))
117+
g.Expect(readyCondition.Reason).To(Equal(kustomizev1.ReconciliationSucceededReason))
118118
})
119119

120120
t.Run("fails to reconcile from cross-namespace source", func(t *testing.T) {

0 commit comments

Comments
 (0)