From 9720e242a078b7c365943bb12a63bef0794f7519 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 24 May 2023 17:23:45 +0200 Subject: [PATCH] Rename controllers to controller Signed-off-by: Hidde Beydals --- .gitignore | 4 ++-- Makefile | 2 +- docs/spec/v1beta1/imageupdateautomations.md | 2 +- .../controllers_fuzzer_test.go | 0 .../imageupdateautomation_controller.go | 0 .../imageupdateautomation_controller_test.go | 0 internal/{controllers => controller}/suite_test.go | 0 .../testdata/appconfig-expected/deploy.yaml | 0 .../testdata/appconfig-expected2/deploy.yaml | 0 .../testdata/appconfig-setters-expected/deploy.yaml | 0 .../testdata/appconfig/deploy.yaml | 0 .../testdata/brokenlink/bar.yaml | 0 .../testdata/pathconfig/no/deploy.yaml | 0 .../testdata/pathconfig/yes/deploy.yaml | 0 internal/{controllers => controller}/update_test.go | 0 main.go | 2 +- tests/fuzz/oss_fuzz_prebuild.sh | 12 ++++++------ 17 files changed, 11 insertions(+), 11 deletions(-) rename internal/{controllers => controller}/controllers_fuzzer_test.go (100%) rename internal/{controllers => controller}/imageupdateautomation_controller.go (100%) rename internal/{controllers => controller}/imageupdateautomation_controller_test.go (100%) rename internal/{controllers => controller}/suite_test.go (100%) rename internal/{controllers => controller}/testdata/appconfig-expected/deploy.yaml (100%) rename internal/{controllers => controller}/testdata/appconfig-expected2/deploy.yaml (100%) rename internal/{controllers => controller}/testdata/appconfig-setters-expected/deploy.yaml (100%) rename internal/{controllers => controller}/testdata/appconfig/deploy.yaml (100%) rename internal/{controllers => controller}/testdata/brokenlink/bar.yaml (100%) rename internal/{controllers => controller}/testdata/pathconfig/no/deploy.yaml (100%) rename internal/{controllers => controller}/testdata/pathconfig/yes/deploy.yaml (100%) rename internal/{controllers => controller}/update_test.go (100%) diff --git a/.gitignore b/.gitignore index 434bdc57..e0173301 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ notes # Thes are downloaded in the Makefile cache/* -internal/controllers/testdata/crds/* +internal/controller/testdata/crds/* # Binaries for programs and plugins *.exe @@ -33,4 +33,4 @@ testbin build/ # CRDs for fuzzing tests. -internal/controllers/testdata/crd +internal/controller/testdata/crd diff --git a/Makefile b/Makefile index 2f32b520..6aff326f 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ ifeq ($(shell uname -s),Darwin) ENVTEST_ARCH=amd64 endif -TEST_CRDS := internal/controllers/testdata/crds +TEST_CRDS := internal/controller/testdata/crds # Log level for `make run` LOG_LEVEL ?= info diff --git a/docs/spec/v1beta1/imageupdateautomations.md b/docs/spec/v1beta1/imageupdateautomations.md index f99000fe..bbeb5dfe 100644 --- a/docs/spec/v1beta1/imageupdateautomations.md +++ b/docs/spec/v1beta1/imageupdateautomations.md @@ -264,7 +264,7 @@ The message template is a [Go text template][go-text-template]. The data availab have this structure (not reproduced verbatim): ```go -// controllers/imageupdateautomation_controller.go +// internal/controller/imageupdateautomation_controller.go // TemplateData is the type of the value given to the commit message // template. diff --git a/internal/controllers/controllers_fuzzer_test.go b/internal/controller/controllers_fuzzer_test.go similarity index 100% rename from internal/controllers/controllers_fuzzer_test.go rename to internal/controller/controllers_fuzzer_test.go diff --git a/internal/controllers/imageupdateautomation_controller.go b/internal/controller/imageupdateautomation_controller.go similarity index 100% rename from internal/controllers/imageupdateautomation_controller.go rename to internal/controller/imageupdateautomation_controller.go diff --git a/internal/controllers/imageupdateautomation_controller_test.go b/internal/controller/imageupdateautomation_controller_test.go similarity index 100% rename from internal/controllers/imageupdateautomation_controller_test.go rename to internal/controller/imageupdateautomation_controller_test.go diff --git a/internal/controllers/suite_test.go b/internal/controller/suite_test.go similarity index 100% rename from internal/controllers/suite_test.go rename to internal/controller/suite_test.go diff --git a/internal/controllers/testdata/appconfig-expected/deploy.yaml b/internal/controller/testdata/appconfig-expected/deploy.yaml similarity index 100% rename from internal/controllers/testdata/appconfig-expected/deploy.yaml rename to internal/controller/testdata/appconfig-expected/deploy.yaml diff --git a/internal/controllers/testdata/appconfig-expected2/deploy.yaml b/internal/controller/testdata/appconfig-expected2/deploy.yaml similarity index 100% rename from internal/controllers/testdata/appconfig-expected2/deploy.yaml rename to internal/controller/testdata/appconfig-expected2/deploy.yaml diff --git a/internal/controllers/testdata/appconfig-setters-expected/deploy.yaml b/internal/controller/testdata/appconfig-setters-expected/deploy.yaml similarity index 100% rename from internal/controllers/testdata/appconfig-setters-expected/deploy.yaml rename to internal/controller/testdata/appconfig-setters-expected/deploy.yaml diff --git a/internal/controllers/testdata/appconfig/deploy.yaml b/internal/controller/testdata/appconfig/deploy.yaml similarity index 100% rename from internal/controllers/testdata/appconfig/deploy.yaml rename to internal/controller/testdata/appconfig/deploy.yaml diff --git a/internal/controllers/testdata/brokenlink/bar.yaml b/internal/controller/testdata/brokenlink/bar.yaml similarity index 100% rename from internal/controllers/testdata/brokenlink/bar.yaml rename to internal/controller/testdata/brokenlink/bar.yaml diff --git a/internal/controllers/testdata/pathconfig/no/deploy.yaml b/internal/controller/testdata/pathconfig/no/deploy.yaml similarity index 100% rename from internal/controllers/testdata/pathconfig/no/deploy.yaml rename to internal/controller/testdata/pathconfig/no/deploy.yaml diff --git a/internal/controllers/testdata/pathconfig/yes/deploy.yaml b/internal/controller/testdata/pathconfig/yes/deploy.yaml similarity index 100% rename from internal/controllers/testdata/pathconfig/yes/deploy.yaml rename to internal/controller/testdata/pathconfig/yes/deploy.yaml diff --git a/internal/controllers/update_test.go b/internal/controller/update_test.go similarity index 100% rename from internal/controllers/update_test.go rename to internal/controller/update_test.go diff --git a/main.go b/main.go index 5a0eb00b..ba96a60a 100644 --- a/main.go +++ b/main.go @@ -49,7 +49,7 @@ import ( "github.com/fluxcd/pkg/git" // +kubebuilder:scaffold:imports - "github.com/fluxcd/image-automation-controller/internal/controllers" + "github.com/fluxcd/image-automation-controller/internal/controller" ) const ( diff --git a/tests/fuzz/oss_fuzz_prebuild.sh b/tests/fuzz/oss_fuzz_prebuild.sh index a9d7418d..3c971873 100755 --- a/tests/fuzz/oss_fuzz_prebuild.sh +++ b/tests/fuzz/oss_fuzz_prebuild.sh @@ -21,8 +21,8 @@ set -euxo pipefail # Some tests requires embedded resources. Embedding does not allow # for traversing into ascending dirs, therefore we copy those contents here: -mkdir -p internal/controllers/testdata/crd -cp config/crd/bases/*.yaml internal/controllers/testdata/crd +mkdir -p internal/controller/testdata/crd +cp config/crd/bases/*.yaml internal/controller/testdata/crd # Version of the source-controller from which to get the GitRepository CRD. # Pulls source-controller/api's version set in go.mod. @@ -32,10 +32,10 @@ SOURCE_VER=$(go list -m github.com/fluxcd/source-controller/api | awk '{print $2 # Pulls image-reflector-controller/api's version set in go.mod. REFLECTOR_VER=$(go list -m github.com/fluxcd/image-reflector-controller/api | awk '{print $2}') -if [ -d "../../internal/controllers/testdata/crds" ]; then - cp ../../internal/controllers/testdata/crds/*.yaml testdata/crds +if [ -d "../../internal/controller/testdata/crds" ]; then + cp ../../internal/controller/testdata/crds/*.yaml testdata/crds else # Fetch the CRDs if not present since we need them when running fuzz tests on CI. - curl -s --fail https://raw.githubusercontent.com/fluxcd/source-controller/${SOURCE_VER}/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml -o internal/controllers/testdata/crd/gitrepositories.yaml - curl -s --fail https://raw.githubusercontent.com/fluxcd/image-reflector-controller/${REFLECTOR_VER}/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml -o internal/controllers/testdata/crd/imagepolicies.yaml + curl -s --fail https://raw.githubusercontent.com/fluxcd/source-controller/${SOURCE_VER}/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml -o internal/controller/testdata/crd/gitrepositories.yaml + curl -s --fail https://raw.githubusercontent.com/fluxcd/image-reflector-controller/${REFLECTOR_VER}/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml -o internal/controller/testdata/crd/imagepolicies.yaml fi