Preserve file extension in destination config files #1631
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.
Fixes #1630
Summary
This PR fixes an issue where destination config files always used the
.ymlextension, even when the base config file used.yaml. Now the destination file preserves the same extension as the base config file.Changes
Core Fix
lib/kamal/configuration.rb: Modifieddestination_config_filemethod to preserve the base file's extension instead of hardcoding.ymlTest Coverage
test/configuration_test.rb: Added tests to verify both.ymland.yamlextensions work correctly with destinations.yamlversions of existing test files (deploy_for_dest.yaml,deploy_for_dest.world.yaml)Behavior Changes
Before
kamal deploy --config-file my-app.yaml -d staging # Looked for: my-app.staging.yml ❌After
Backward Compatibility
✅ Fully backward compatible - existing
.ymlconfig files continue to work exactly as before. Only affects users who want to use.yamlextensions consistently.Test Plan
.yamlextension preservation.ymlextension still works (backward compatibility)The fix is minimal, focused, and maintains full backward compatibility while providing the expected behavior for users who prefer
.yamlextensions.