From c77e3bfa5e998a5f8a81f942425287b23f4b2e0d Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 11 Aug 2021 11:10:29 +0000 Subject: [PATCH] feat: support "controllers" top-level directory It is used by our CAPI providers and common for other providers (AWS, GCP). Signed-off-by: Alexey Palazhchenko --- internal/project/auto/golang.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/project/auto/golang.go b/internal/project/auto/golang.go index 862599e5..7374c327 100644 --- a/internal/project/auto/golang.go +++ b/internal/project/auto/golang.go @@ -42,7 +42,14 @@ func (builder *builder) DetectGolang() (bool, error) { builder.meta.CanonicalPath = modfile.ModulePath(contents) - for _, srcDir := range []string{"src", "internal", "pkg", "cmd", "api"} { + for _, srcDir := range []string{ + "api", // API definitions (generated protobufs, Kubebuilder's resources) + "cmd", // main packages + "controllers", // Kubernetes controllers + "internal", // internal packages + "pkg", // generic, general use packages that can be used independently + "src", // deprecated + } { exists, err := directoryExists(builder.rootPath, srcDir) if err != nil { return true, err