Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 52 additions & 2 deletions pkg/genall/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,59 @@ var (

// +controllertools:marker:generateHelp:category=""

// InputPaths represents paths and go-style path patterns to use as package roots.
// InputPaths represents the package roots that controller-gen uses as input
// for code generation.
//
// Multiple paths can be specified using "{path1, path2, path3}".
// Multiple paths can be specified using the brace-delimited form or a
// semicolon-separated list.
//
// Each path is classified as either a filesystem path or a Go package/module
// name, following the same rules used by the "go" command. A path is treated
// as a filesystem path if it is absolute, or begins with "." or "..". All
// other paths are treated as Go package or module names. For more information
// on path classification, run "go help packages".
//
// Examples:
//
// // brace-delimited form (preferred when specifying multiple paths)
// paths="{./api/..., ./pkg/...}"
//
// // semicolon-separated form
// paths=./api/...;./pkg/...
//
// // filesystem paths (absolute or beginning with . or ..)
// paths=./...
// paths=./api/v1
// paths=/home/user/project/api

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using one space to indent the example is not very clear - looks like a formatting mistake instead of intentional indentation. Is this rendered in a better way?

@camilamacedo86 camilamacedo86 Jun 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catcher we should fix and do like other places.
Done.

//
// // Go package or module names
// paths=sigs.k8s.io/controller-tools/pkg/...
// paths=example.com/myproject/api/v1
//
// When a filesystem path ends with "...", controller-gen crosses module
// boundaries and includes packages from any nested Go modules found in
// subdirectories (directories that contain their own go.mod file). This is
// useful when working in a repository with multiple Go modules and you want
// to run generation across all of them in a single invocation. This behavior
// does not apply to Go package or module names, which follow standard Go
// module rules and stay within a single module.
//
// Example:
//
// // given this layout:
// // myrepo/go.mod
// // myrepo/api/v1/
// // myrepo/subproject/go.mod (nested module)
// // myrepo/subproject/api/
//
// // this includes packages from both modules:
// paths=./...
//
// // this includes only the root module:
// paths=sigs.k8s.io/myrepo/...
//
// To limit generation to a single module, use a Go package or module name
// rather than a filesystem path.
type InputPaths []string

// RegisterOptionsMarkers registers "mandatory" options markers for FromOptions into the given registry.
Expand Down
4 changes: 2 additions & 2 deletions pkg/genall/zz_generated.markerhelp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading