Skip to content

Fix proxy host overrides in destination configs - #1896

Closed
cookesan wants to merge 1 commit into
basecamp:mainfrom
cookesan:allow-proxy-hosts-destination-override
Closed

Fix proxy host overrides in destination configs#1896
cookesan wants to merge 1 commit into
basecamp:mainfrom
cookesan:allow-proxy-hosts-destination-override

Conversation

@cookesan

Copy link
Copy Markdown
Contributor

Summary

  • Allows destination config files to replace proxy.host with proxy.hosts, or the reverse, without leaving both keys in the merged config.
  • Preserves the validation error for configs that set both keys in the same proxy config.
  • Adds regression coverage for both destination override directions.

Fixes #1832.

Testing

  • bundle _2.6.5_ exec ruby -Itest test/configuration/proxy_test.rb in a ruby:3.4 container
  • bundle _2.6.5_ exec ruby -Itest test/configuration/validation_test.rb in a ruby:3.4 container
  • git diff --check

Copilot AI review requested due to automatic review settings June 27, 2026 21:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a config-merge edge case where destination-specific config files can switch between proxy.host and proxy.hosts (in either direction) without leaving both keys present in the merged proxy config, while keeping the existing validation behavior for configs that explicitly set both keys.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Adjust config file loading to remove the superseded proxy.host/proxy.hosts key from the already-loaded config when a later file overrides with the alternate key.
  • Add regression tests covering both override directions (hosthosts and hostshost) via destination config files.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/kamal/configuration.rb Removes replaced proxy.host/proxy.hosts keys during destination config merges to avoid invalid merged configs.
test/configuration/proxy_test.rb Adds regression coverage for destination overrides switching between host and hosts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cookesan

Copy link
Copy Markdown
Contributor Author

Superseded by #1903, which covers the same destination override behavior and adds the role-level cases.

@cookesan cookesan closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR (Kamal::ConfigurationError): proxy: Specify one of 'host' or 'hosts', not both

2 participants