Repository navigation
feat(agent): add --plain-http for a registry without TLS (MK8S-445) - #31
Open
ezekiel-alexrod wants to merge 1 commit into
Open
ezekiel-alexrod wants to merge 1 commit into
ezekiel-alexrod wants to merge 1 commit into
Conversation
A registry that serves plain HTTP under a host name could not be reached: go-containerregistry only falls back to HTTP for a loopback or private address. The manager and imagecachectl import now take --plain-http, which marks every registry insecure. The client still tries HTTPS first, and tries HTTP too when HTTPS fails or is slow. It is off by default and no manifest sets it. The agent logs a warning at startup and the command prints one before it pulls. It excludes --ca-file and --insecure-skip-tls-verify: it is for a registry without TLS, so a certificate setting next to it is a mistake. Relates-to: MK8S-445
ezekiel-alexrod
force-pushed
the
feature/MK8S-445-plain-http
branch
from
October 9, 2026 16:23
36cd54b to
f7d31c7
Compare
| `--insecure-skip-tls-verify` turns verification off for test clusters. It | ||
| excludes `--ca-file`, so neither setting wins in silence. | ||
| - On its own, the library falls back to plain HTTP only for a loopback or a | ||
| private address. |
There was a problem hiding this comment.
"Only for a loopback or a private address" is incomplete. In go-containerregistry, name.Registry.Scheme() also returns http for a localhost:<port> registry and for any host ending in .local or .localhost. So a registry at registry.local:5000 already works without --plain-http, and this sentence tells the reader it won't. I couldn't open the v0.21.7 source here, so check pkg/name/registry.go.
Suggested change
| private address. | |
| private address, or a `localhost` or `*.local` host name. |
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.
Component
agent, docs
Problem
The MetalK8s registry serves plain HTTP. go-containerregistry only falls back to HTTP for a loopback or private address, so a registry reached by host name or public IP can't be pulled from. That breaks the join on a node (MK8S-394) and the resources created at bootstrap (MK8S-396).
Fix
Stacked on #26, so the diff here is the last commit only. I'd mostly like eyes on the scheme note in
agent/DESIGN.md("Pulling and extraction") and onopeninagent/internal/puller/puller.go.imagecachectl importtake--plain-http. It marks the registry insecure (name.Insecure), which is the library's own switch for this.agent/DESIGN.mdsays it.--ca-fileand--insecure-skip-tls-verify: it's for a registry without TLS, so a certificate setting next to it is a mistake.Test
go test -race ./...with envtest,go vet,golangci-lintaftercache clean(Go 1.26.0)HTTP response to HTTPS client), pulled with it, inpullerand throughimagecachectl import--ca-fileor--insecure-skip-tls-verifyimagecachectlnames both flags, the manager exits onErrTLSmake -C agent test-e2eon kindOut of scope
README.md,agent/README.md,DESIGN.md,agent/DESIGN.md,CONTRIBUTING.md, whichever owns it.agent/DESIGN.md. Not applicable.Relates-to: MK8S-445