git-gate: ExtraHosts on bottle.git entries #12
Reference in New Issue
Block a user
Delete Branch "git-gate-extra-hosts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to #11.
bottle.gitentries take an optionalExtraHosts: { hostname: ip }map that the docker backend surfaces as--add-hoston the gate sidecar. This is for upstreams whose default container DNS doesn't resolve to the reachable IP (e.g. a Tailscale-only host whose public A record points elsewhere): the gate's/etc/hostsgets the override while the agent'sinsteadOfrewrite still keys off the original hostname, soUpstreamURLs in the manifest stay human-readable.These commits were authored against the
git-gatebranch but missed the push before #11 merged, so this PR lands them on main as the same three commits cherry-picked. Covered by new unit tests for manifest parsing (default empty, valid map, type / value rejections) and the aggregator that merges per-entry maps and dies on same-host different-IP conflicts.Optional `ExtraHosts: { hostname: ip }` map per git entry. The docker backend will surface these to the gate sidecar via --add-host so the gate can resolve upstreams whose default container DNS doesn't point at the reachable IP (e.g. Tailscale-only hosts with a public DNS A record pointed elsewhere). The agent-side insteadOf rewrite still keys off the original hostname, so the manifest's Upstream URL stays human-readable.