-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(ko): allow configuration of local domain to allow publishing to other local registries (e.g. kind) #5809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5809 +/- ##
=======================================
Coverage 82.94% 82.95%
=======================================
Files 163 163
Lines 16310 16316 +6
=======================================
+ Hits 13529 13535 +6
Misses 2190 2190
Partials 591 591 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a configurable local_domain
option for ko
builds, updating schemas, documentation, config, and build logic to support custom local registry domains, along with extending tests for the new field.
- Add
local_domain
to JSON schemas and Go config struct - Document
local_domain
usage in customization guide - Implement default/fallback logic in build pipeline and extend tests
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
www/docs/static/schema.json | Add local_domain property to the JSON schema |
www/docs/static/schema-pro.json | Add local_domain property to the Pro JSON schema |
www/docs/customization/ko.md | Document the new local_domain configuration option |
pkg/config/config.go | Add LocalDomain field to the Ko struct |
internal/pipe/ko/ko.go | Use LocalDomain from config with default fallback logic |
internal/pipe/ko/ko_test.go | Extend test struct to include LocalDomain |
Comments suppressed due to low confidence (1)
internal/pipe/ko/ko_test.go:194
- Add a test case that sets a non-default
LocalDomain
value to verify that the custom domain is correctly applied during publishing.
LocalDomain string
internal/pipe/ko/ko.go
Outdated
@@ -286,14 +286,19 @@ func doBuild(ctx *context.Context, ko config.Ko) error { | |||
return fmt.Errorf("build: %w", err) | |||
} | |||
|
|||
localDomain := "goreleaser.ko.local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider extracting the default local domain literal into a constant to avoid duplication and make future updates easier.
localDomain := "goreleaser.ko.local" | |
localDomain := defaultLocalDomain |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR!
proposed one small docs change.
also, maybe worth adding a test for the local domain as well?
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
…rt/goreleaser into feat/ko-local-domain
I added a focused test for the new logic instead of testing the entire |
Thank you! <3 |
If applied, this commit will make the localDomain for
ko
builds configurable and add tests for the new configuration option.This change allows users to specify a custom localDomain for ko builds, increasing flexibility for local image publishing scenarios.
https://ko.build/configuration/#local-publishing-options
closes https://github.com/orgs/goreleaser/discussions/5808