diff --git a/pkg/scaffold/internal/templates/gomod.go b/pkg/scaffold/internal/templates/gomod.go index 75a7b79650d..20e55aed3fb 100644 --- a/pkg/scaffold/internal/templates/gomod.go +++ b/pkg/scaffold/internal/templates/gomod.go @@ -43,6 +43,7 @@ func (f *GoMod) SetTemplateDefaults() error { return nil } +//nolint:lll const goModTemplate = ` module {{ .Repo }} @@ -50,5 +51,12 @@ go 1.13 require ( sigs.k8s.io/controller-runtime {{ .ControllerRuntimeVersion }} + +) + +replace ( + // The following module is required for projects which are using addons + // More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 + sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c ) ` diff --git a/testdata/project-v2-addon/go.mod b/testdata/project-v2-addon/go.mod index 5455d3b8e22..9b10e71228e 100644 --- a/testdata/project-v2-addon/go.mod +++ b/testdata/project-v2-addon/go.mod @@ -9,5 +9,9 @@ require ( k8s.io/apimachinery v0.18.2 k8s.io/client-go v0.18.2 sigs.k8s.io/controller-runtime v0.6.0 - sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c + sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-00010101000000-000000000000 ) + +// The following module is required for projects which are using addons +// More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 +replace sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c diff --git a/testdata/project-v2-multigroup/go.mod b/testdata/project-v2-multigroup/go.mod index 6857ac76747..6a290703944 100644 --- a/testdata/project-v2-multigroup/go.mod +++ b/testdata/project-v2-multigroup/go.mod @@ -10,3 +10,7 @@ require ( k8s.io/client-go v0.18.2 sigs.k8s.io/controller-runtime v0.6.0 ) + +// The following module is required for projects which are using addons +// More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 +replace sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c diff --git a/testdata/project-v2/go.mod b/testdata/project-v2/go.mod index 884435dad0d..4cf9e850bd8 100644 --- a/testdata/project-v2/go.mod +++ b/testdata/project-v2/go.mod @@ -10,3 +10,7 @@ require ( k8s.io/client-go v0.18.2 sigs.k8s.io/controller-runtime v0.6.0 ) + +// The following module is required for projects which are using addons +// More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 +replace sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c diff --git a/testdata/project-v3-addon/go.mod b/testdata/project-v3-addon/go.mod index c88d149bea7..ef1e704f808 100644 --- a/testdata/project-v3-addon/go.mod +++ b/testdata/project-v3-addon/go.mod @@ -9,5 +9,9 @@ require ( k8s.io/apimachinery v0.18.2 k8s.io/client-go v0.18.2 sigs.k8s.io/controller-runtime v0.6.0 - sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c + sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-00010101000000-000000000000 ) + +// The following module is required for projects which are using addons +// More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 +replace sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c diff --git a/testdata/project-v3-multigroup/go.mod b/testdata/project-v3-multigroup/go.mod index 1420a8cfa4f..6906f1304cb 100644 --- a/testdata/project-v3-multigroup/go.mod +++ b/testdata/project-v3-multigroup/go.mod @@ -10,3 +10,7 @@ require ( k8s.io/client-go v0.18.2 sigs.k8s.io/controller-runtime v0.6.0 ) + +// The following module is required for projects which are using addons +// More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 +replace sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c diff --git a/testdata/project-v3/go.mod b/testdata/project-v3/go.mod index 814fe266215..d1f1f30031d 100644 --- a/testdata/project-v3/go.mod +++ b/testdata/project-v3/go.mod @@ -10,3 +10,7 @@ require ( k8s.io/client-go v0.18.2 sigs.k8s.io/controller-runtime v0.6.0 ) + +// The following module is required for projects which are using addons +// More info: https://github.com/kubernetes-sigs/kubebuilder/issues/1525 +replace sigs.k8s.io/kubebuilder-declarative-pattern => sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c