diff --git a/api/go.mod b/api/go.mod index a9beb614..aaa08b45 100644 --- a/api/go.mod +++ b/api/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/fluxcd/pkg/apis/meta v0.7.0 - k8s.io/api v0.20.2 + k8s.io/api v0.20.2 // indirect k8s.io/apimachinery v0.20.2 sigs.k8s.io/controller-runtime v0.8.0 ) diff --git a/api/v1beta1/bucket_types.go b/api/v1beta1/bucket_types.go index 32d19640..492002b8 100644 --- a/api/v1beta1/bucket_types.go +++ b/api/v1beta1/bucket_types.go @@ -18,7 +18,6 @@ package v1beta1 import ( "github.com/fluxcd/pkg/apis/meta" - corev1 "k8s.io/api/core/v1" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -55,7 +54,7 @@ type BucketSpec struct { // The name of the secret containing authentication credentials // for the Bucket. // +optional - SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` + SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"` // The interval at which to check for bucket updates. // +required diff --git a/api/v1beta1/gitrepository_types.go b/api/v1beta1/gitrepository_types.go index 2667eb3a..8bc69ff2 100644 --- a/api/v1beta1/gitrepository_types.go +++ b/api/v1beta1/gitrepository_types.go @@ -18,7 +18,6 @@ package v1beta1 import ( "github.com/fluxcd/pkg/apis/meta" - corev1 "k8s.io/api/core/v1" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -45,7 +44,7 @@ type GitRepositorySpec struct { // For SSH repositories the secret must contain identity, identity.pub and // known_hosts fields. // +optional - SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` + SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"` // The interval at which to check for repository updates. // +required @@ -110,7 +109,7 @@ type GitRepositoryVerification struct { Mode string `json:"mode"` // The secret name containing the public keys of all trusted Git authors. - SecretRef corev1.LocalObjectReference `json:"secretRef,omitempty"` + SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"` } // GitRepositoryStatus defines the observed state of a Git repository. diff --git a/api/v1beta1/helmrepository_types.go b/api/v1beta1/helmrepository_types.go index 655f1e57..5e32d442 100644 --- a/api/v1beta1/helmrepository_types.go +++ b/api/v1beta1/helmrepository_types.go @@ -18,7 +18,6 @@ package v1beta1 import ( "github.com/fluxcd/pkg/apis/meta" - corev1 "k8s.io/api/core/v1" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -44,7 +43,7 @@ type HelmRepositorySpec struct { // For TLS the secret must contain a certFile and keyFile, and/or // caCert fields. // +optional - SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` + SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"` // The interval at which to check the upstream for updates. // +required diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index d8e1018b..24e929f3 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -21,8 +21,8 @@ limitations under the License. package v1beta1 import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/fluxcd/pkg/apis/meta" + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -106,13 +106,13 @@ func (in *BucketSpec) DeepCopyInto(out *BucketSpec) { *out = *in if in.SecretRef != nil { in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) + *out = new(meta.LocalObjectReference) **out = **in } out.Interval = in.Interval if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(metav1.Duration) + *out = new(v1.Duration) **out = **in } if in.Ignore != nil { @@ -137,7 +137,7 @@ func (in *BucketStatus) DeepCopyInto(out *BucketStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) + *out = make([]v1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -239,13 +239,13 @@ func (in *GitRepositorySpec) DeepCopyInto(out *GitRepositorySpec) { *out = *in if in.SecretRef != nil { in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) + *out = new(meta.LocalObjectReference) **out = **in } out.Interval = in.Interval if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(metav1.Duration) + *out = new(v1.Duration) **out = **in } if in.Reference != nil { @@ -280,7 +280,7 @@ func (in *GitRepositoryStatus) DeepCopyInto(out *GitRepositoryStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) + *out = make([]v1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -400,7 +400,7 @@ func (in *HelmChartStatus) DeepCopyInto(out *HelmChartStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) + *out = make([]v1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -487,13 +487,13 @@ func (in *HelmRepositorySpec) DeepCopyInto(out *HelmRepositorySpec) { *out = *in if in.SecretRef != nil { in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) + *out = new(meta.LocalObjectReference) **out = **in } out.Interval = in.Interval if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(metav1.Duration) + *out = new(v1.Duration) **out = **in } } @@ -513,7 +513,7 @@ func (in *HelmRepositoryStatus) DeepCopyInto(out *HelmRepositoryStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) + *out = make([]v1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml b/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml index 6e95950f..d3e59eb2 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml @@ -83,9 +83,10 @@ spec: for the Bucket. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: Name of the referent type: string + required: + - name type: object suspend: description: This flag tells the controller to suspend the reconciliation diff --git a/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml index c6513c3d..75e8f161 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml @@ -93,9 +93,10 @@ spec: and known_hosts fields. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: Name of the referent type: string + required: + - name type: object suspend: description: This flag tells the controller to suspend the reconciliation @@ -125,9 +126,10 @@ spec: trusted Git authors. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: Name of the referent type: string + required: + - name type: object required: - mode diff --git a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml index 00868c6a..a6b38b95 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml @@ -59,9 +59,10 @@ spec: certFile and keyFile, and/or caCert fields. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: Name of the referent type: string + required: + - name type: object suspend: description: This flag tells the controller to suspend the reconciliation diff --git a/controllers/helmchart_controller_test.go b/controllers/helmchart_controller_test.go index 140e0b7e..0c39e482 100644 --- a/controllers/helmchart_controller_test.go +++ b/controllers/helmchart_controller_test.go @@ -314,7 +314,7 @@ var _ = Describe("HelmChartReconciler", func() { }, Spec: sourcev1.HelmRepositorySpec{ URL: helmServer.URL(), - SecretRef: &corev1.LocalObjectReference{ + SecretRef: &meta.LocalObjectReference{ Name: secretKey.Name, }, Interval: metav1.Duration{Duration: pullInterval}, @@ -803,7 +803,7 @@ var _ = Describe("HelmChartReconciler", func() { }, Spec: sourcev1.HelmRepositorySpec{ URL: helmServer.URL(), - SecretRef: &corev1.LocalObjectReference{ + SecretRef: &meta.LocalObjectReference{ Name: secretKey.Name, }, Interval: metav1.Duration{Duration: pullInterval}, diff --git a/controllers/helmrepository_controller_test.go b/controllers/helmrepository_controller_test.go index f10762b9..126ed11c 100644 --- a/controllers/helmrepository_controller_test.go +++ b/controllers/helmrepository_controller_test.go @@ -30,6 +30,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/helmtestserver" sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" @@ -250,7 +251,7 @@ var _ = Describe("HelmRepositoryReconciler", func() { }, Spec: sourcev1.HelmRepositorySpec{ URL: helmServer.URL(), - SecretRef: &corev1.LocalObjectReference{ + SecretRef: &meta.LocalObjectReference{ Name: secretKey.Name, }, Interval: metav1.Duration{Duration: indexInterval}, @@ -343,7 +344,7 @@ var _ = Describe("HelmRepositoryReconciler", func() { }, Spec: sourcev1.HelmRepositorySpec{ URL: helmServer.URL(), - SecretRef: &corev1.LocalObjectReference{ + SecretRef: &meta.LocalObjectReference{ Name: secretKey.Name, }, Interval: metav1.Duration{Duration: indexInterval}, diff --git a/docs/api/source.md b/docs/api/source.md index 2b0147ce..c0de25e9 100644 --- a/docs/api/source.md +++ b/docs/api/source.md @@ -136,8 +136,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference @@ -291,8 +291,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference @@ -642,8 +642,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference @@ -880,8 +880,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference @@ -1137,8 +1137,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference @@ -1371,8 +1371,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference @@ -1600,8 +1600,8 @@ string secretRef
- -Kubernetes core/v1.LocalObjectReference + +github.com/fluxcd/pkg/apis/meta.LocalObjectReference