feat(ko): allow configuration of local domain to allow publishing to other local registries (e.g. kind)#5809
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.
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_domainto JSON schemas and Go config struct - Document
local_domainusage 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
LocalDomainvalue to verify that the custom domain is correctly applied during publishing.
LocalDomain string
| return fmt.Errorf("build: %w", err) | ||
| } | ||
|
|
||
| localDomain := "goreleaser.ko.local" |
There was a problem hiding this comment.
[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 |
caarlos0
left a comment
There was a problem hiding this comment.
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
kobuilds 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