chore: move controller main to cmd/controller#1962
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors build/version plumbing to use a dedicated internal version package and updates build tooling/config to build the controller binary from ./cmd/controller instead of ./cmd/.
Changes:
- Switch version variable references to
internal/versionand update linker flags accordingly. - Update ko / GoReleaser / GH workflow build entrypoints to
./cmd/controller. - Add local Makefile targets for testing releases (goreleaser) and SBOM generation (syft).
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/utils/node_selector_test.go | Adds a blank line after the license header for formatting consistency. |
| pkg/template/reference.go | Adds a blank line after the license header for formatting consistency. |
| pkg/template/functions/uuid.go | Adds a blank line after the license header for formatting consistency. |
| pkg/template/functions/funcmap.go | Adds a blank line after the license header for formatting consistency. |
| pkg/template/functions/conversion.go | Adds a blank line after the license header for formatting consistency. |
| pkg/template/functions/age.go | Adds a blank line after the license header for formatting consistency. |
| pkg/runtime/admission/utils.go | Adds a blank line after the license header for formatting consistency. |
| internal/webhook/customquota/utils.go | Adds a blank line after the license header for formatting consistency. |
| internal/webhook/customquota/globalcustomquota_validating.go | Adds a blank line after the license header for formatting consistency. |
| internal/webhook/customquota/customquota_validating.go | Adds a blank line after the license header for formatting consistency. |
| internal/webhook/customquota/calculation.go | Adds a blank line after the license header for formatting consistency. |
| internal/controllers/tenantowner/manager.go | Adds a blank line after the license header for formatting consistency. |
| internal/controllers/tenantowner/enqueue.go | Adds a blank line after the license header for formatting consistency. |
| e2e/tenantowner_status_test.go | Adds a blank line after the license header for formatting consistency. |
| cmd/version.go | Changes the package declaration (impacts how version vars are compiled/linked). |
| cmd/main.go | Switches version printing to internal/version and removes redundant parentheses in route wiring. |
| Makefile | Updates ldflags to internal/version, changes ko build path, and adds goreleaser/syft helper targets. |
| .ko.yaml | Updates ko build entrypoint to ./cmd/controller. |
| .goreleaser.yml | Updates GoReleaser build entrypoint and ldflags to internal/version. |
| .github/workflows/docker-publish.yml | Updates workflow build entrypoint path to ./cmd/controller/. |
| -X github.com/projectcapsule/capsule/internal/version.Version={{ .Tag }} | ||
| -X github.com/projectcapsule/capsule/internal/version.GitCommit={{ .Commit }} | ||
| -X github.com/projectcapsule/capsule/internal/version.GitTag={{ .Tag }} | ||
| -X github.com/projectcapsule/capsule/internal/version.GitDirty={{ .Date }} |
Signed-off-by: bakito <github@bakito.ch>
| } | ||
|
|
||
| type HanderWithTenant interface { | ||
| type HandlerWithTenant interface { |
oliverbaehler
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the controller main.go into the module path cmd/controller.
This is in preparation for #1959 where an traditional cli binary is introduced.
Minor formatting issues are also addressed and a make task added to run roreleaser local.
make test-release