baremetal: add docker_insecure_registries for metalbox to deploy play…#2265
Merged
baremetal: add docker_insecure_registries for metalbox to deploy play…#2265
Conversation
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- You’re unconditionally overwriting
play['vars']['docker_insecure_registries']in three places; if other registries might already be defined, consider appending/merging instead of replacing the list. - The same
docker_insecure_registries = ['metalbox:5001']block is duplicated in three branches; consider extracting a small helper or consolidating the common logic to reduce repetition and keep future changes in one place. - You’re adding
metalbox:5001while the hosts entry usesmetalbox.osism.xyz; double-check that Docker will actually resolvemetalboxin this context or consider aligning the hostname with the one configured inhosts_additional_entries.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You’re unconditionally overwriting `play['vars']['docker_insecure_registries']` in three places; if other registries might already be defined, consider appending/merging instead of replacing the list.
- The same `docker_insecure_registries = ['metalbox:5001']` block is duplicated in three branches; consider extracting a small helper or consolidating the common logic to reduce repetition and keep future changes in one place.
- You’re adding `metalbox:5001` while the hosts entry uses `metalbox.osism.xyz`; double-check that Docker will actually resolve `metalbox` in this context or consider aligning the hostname with the one configured in `hosts_additional_entries`.
## Individual Comments
### Comment 1
<location path="osism/commands/baremetal.py" line_range="305-307" />
<code_context>
play["vars"]["hosts_additional_entries"] = {
"metalbox.osism.xyz": metalbox_ip
}
+ play["vars"]["docker_insecure_registries"] = [
+ "metalbox:5001"
+ ]
if (
"netplan_parameters" in node.extra
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid overwriting any existing `docker_insecure_registries` that might already be present.
If `play["vars"]` may already define `docker_insecure_registries` (from other logic or config), this will overwrite it. Instead, merge with any existing list and only add `"metalbox:5001"` if it isn’t already present.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines
+305
to
+307
| play["vars"]["docker_insecure_registries"] = [ | ||
| "metalbox:5001" | ||
| ] |
There was a problem hiding this comment.
issue (bug_risk): Avoid overwriting any existing docker_insecure_registries that might already be present.
If play["vars"] may already define docker_insecure_registries (from other logic or config), this will overwrite it. Instead, merge with any existing list and only add "metalbox:5001" if it isn’t already present.
…book Sets docker_insecure_registries to [metalbox:5001] alongside the existing metalbox.osism.xyz hosts entry so deployed nodes can pull from the metalbox registry over HTTP. Extracts the metalbox vars setup into a small _apply_metalbox_vars helper so the three call sites in BaremetalDeploy and BaremetalDump share one implementation. AI-assisted: Claude Code Signed-off-by: Christian Berendt <berendt@osism.tech>
osfrickler
approved these changes
May 6, 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.
…book
Sets docker_insecure_registries to [metalbox:5001] alongside the existing metalbox.osism.xyz hosts entry so deployed nodes can pull from the metalbox registry over HTTP.
AI-assisted: Claude Code