Move `controllers` to `internal/controllers`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
2f5d875878
commit
31a62adfa9
|
@ -1,22 +1,26 @@
|
||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins.
|
||||||
*.exe
|
*.exe
|
||||||
*.exe~
|
*.exe~
|
||||||
*.dll
|
*.dll
|
||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
# Test binary, built with `go test -c`.
|
||||||
*.test
|
*.test
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool.
|
||||||
*.out
|
*.out
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Build tools downloaded at runtime.
|
||||||
# vendor/
|
|
||||||
bin/
|
bin/
|
||||||
|
|
||||||
|
# Release manifests generated at runtime.
|
||||||
config/release/
|
config/release/
|
||||||
config/crd/bases/ocirepositories.yaml
|
config/crd/bases/ocirepositories.yaml
|
||||||
config/crd/bases/gitrepositories.yaml
|
config/crd/bases/gitrepositories.yaml
|
||||||
config/crd/bases/buckets.yaml
|
config/crd/bases/buckets.yaml
|
||||||
|
|
||||||
build/
|
build/
|
||||||
|
|
||||||
|
# CRDs for fuzzing tests.
|
||||||
|
internal/controllers/testdata/crd
|
||||||
|
|
|
@ -24,7 +24,6 @@ RUN go mod download
|
||||||
|
|
||||||
# copy source code
|
# copy source code
|
||||||
COPY main.go main.go
|
COPY main.go main.go
|
||||||
COPY controllers/ controllers/
|
|
||||||
COPY internal/ internal/
|
COPY internal/ internal/
|
||||||
|
|
||||||
# build
|
# build
|
||||||
|
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
apiacl "github.com/fluxcd/pkg/apis/acl"
|
apiacl "github.com/fluxcd/pkg/apis/acl"
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
"github.com/fluxcd/pkg/testserver"
|
"github.com/fluxcd/pkg/testserver"
|
||||||
|
@ -32,6 +31,8 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKustomizationReconciler_NoCrossNamespaceRefs(t *testing.T) {
|
func TestKustomizationReconciler_NoCrossNamespaceRefs(t *testing.T) {
|
|
@ -51,6 +51,7 @@ import (
|
||||||
eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
|
eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
"github.com/fluxcd/pkg/http/fetch"
|
"github.com/fluxcd/pkg/http/fetch"
|
||||||
|
generator "github.com/fluxcd/pkg/kustomize"
|
||||||
"github.com/fluxcd/pkg/runtime/acl"
|
"github.com/fluxcd/pkg/runtime/acl"
|
||||||
runtimeClient "github.com/fluxcd/pkg/runtime/client"
|
runtimeClient "github.com/fluxcd/pkg/runtime/client"
|
||||||
"github.com/fluxcd/pkg/runtime/conditions"
|
"github.com/fluxcd/pkg/runtime/conditions"
|
||||||
|
@ -64,7 +65,6 @@ import (
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
"github.com/fluxcd/kustomize-controller/internal/decryptor"
|
"github.com/fluxcd/kustomize-controller/internal/decryptor"
|
||||||
"github.com/fluxcd/kustomize-controller/internal/inventory"
|
"github.com/fluxcd/kustomize-controller/internal/inventory"
|
||||||
generator "github.com/fluxcd/pkg/kustomize"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// +kubebuilder:rbac:groups=kustomize.toolkit.fluxcd.io,resources=kustomizations,verbs=get;list;watch;create;update;patch;delete
|
// +kubebuilder:rbac:groups=kustomize.toolkit.fluxcd.io,resources=kustomizations,verbs=get;list;watch;create;update;patch;delete
|
|
@ -24,7 +24,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
"github.com/hashicorp/vault/api"
|
"github.com/hashicorp/vault/api"
|
||||||
|
@ -33,6 +32,8 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKustomizationReconciler_Decryptor(t *testing.T) {
|
func TestKustomizationReconciler_Decryptor(t *testing.T) {
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
"github.com/fluxcd/pkg/testserver"
|
"github.com/fluxcd/pkg/testserver"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
|
@ -32,6 +31,8 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKustomizationReconciler_Force(t *testing.T) {
|
func TestKustomizationReconciler_Force(t *testing.T) {
|
|
@ -60,6 +60,7 @@ import (
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
|
|
||||||
fuzz "github.com/AdaLogics/go-fuzz-headers"
|
fuzz "github.com/AdaLogics/go-fuzz-headers"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
"github.com/fluxcd/pkg/testserver"
|
"github.com/fluxcd/pkg/testserver"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
|
@ -34,6 +33,8 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKustomizationReconciler_Impersonation(t *testing.T) {
|
func TestKustomizationReconciler_Impersonation(t *testing.T) {
|
|
@ -23,9 +23,10 @@ import (
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/reconcile"
|
"sigs.k8s.io/controller-runtime/pkg/reconcile"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
"github.com/fluxcd/pkg/runtime/dependency"
|
"github.com/fluxcd/pkg/runtime/dependency"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (r *KustomizationReconciler) requestsForRevisionChangeOf(indexKey string) func(obj client.Object) []reconcile.Request {
|
func (r *KustomizationReconciler) requestsForRevisionChangeOf(indexKey string) func(obj client.Object) []reconcile.Request {
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
"github.com/fluxcd/pkg/testserver"
|
"github.com/fluxcd/pkg/testserver"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
|
@ -32,6 +31,8 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKustomizationReconciler_Prune(t *testing.T) {
|
func TestKustomizationReconciler_Prune(t *testing.T) {
|
|
@ -22,13 +22,14 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKustomizationReconciler_Validation(t *testing.T) {
|
func TestKustomizationReconciler_Validation(t *testing.T) {
|
|
@ -188,7 +188,7 @@ func TestMain(m *testing.M) {
|
||||||
}, func() error {
|
}, func() error {
|
||||||
code = m.Run()
|
code = m.Run()
|
||||||
return nil
|
return nil
|
||||||
}, filepath.Join("..", "config", "crd", "bases"))
|
}, filepath.Join("..", "..", "config", "crd", "bases"))
|
||||||
|
|
||||||
os.Exit(code)
|
os.Exit(code)
|
||||||
}
|
}
|
2
main.go
2
main.go
|
@ -45,7 +45,7 @@ import (
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||||
"github.com/fluxcd/kustomize-controller/controllers"
|
"github.com/fluxcd/kustomize-controller/internal/controllers"
|
||||||
"github.com/fluxcd/kustomize-controller/internal/features"
|
"github.com/fluxcd/kustomize-controller/internal/features"
|
||||||
"github.com/fluxcd/kustomize-controller/internal/statusreaders"
|
"github.com/fluxcd/kustomize-controller/internal/statusreaders"
|
||||||
// +kubebuilder:scaffold:imports
|
// +kubebuilder:scaffold:imports
|
||||||
|
|
|
@ -21,5 +21,5 @@ set -euxo pipefail
|
||||||
|
|
||||||
# Some tests requires embedded resources. Embedding does not allow
|
# Some tests requires embedded resources. Embedding does not allow
|
||||||
# for traversing into ascending dirs, therefore we copy those contents here:
|
# for traversing into ascending dirs, therefore we copy those contents here:
|
||||||
mkdir -p controllers/testdata/crd
|
mkdir -p internal/controllers/testdata/crd
|
||||||
cp config/crd/bases/*.yaml controllers/testdata/crd
|
cp config/crd/bases/*.yaml internal/controllers/testdata/crd
|
||||||
|
|
Loading…
Reference in New Issue