Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Retain original config file format #56

Merged
merged 1 commit into from Nov 4, 2016

Conversation

karalabe
Copy link
Contributor

Previously a trash --update overwrote any existing config file without retaining its original format (#46). This had the unfortunate side effect that an original yaml config file was swapped out with a flat conf type. A proposal to fix this was done in #50, but adding a new flag is a redundant operation since the code already knows what the original format was. This PR ensures that the original config file format (yaml or conf) is retained inside the Conf struct, allowing to serialize back to the same format on a dump.

Another bug was that trash recreated a new config structure from scratch on update, overwriting the old struct before the package metadata (version, external repo) could be extracted, losing all such information. A proposal was opened in #51 to fix this, but it doesn't play nice with other internal/private fields in the Conf struct. This PR offers an alternative solution by not recreating the original config struct, just its Imports field. This was all private metadata is preserved, including the importMap containing the import meta fields.

@imikushin
Copy link
Contributor

LGTM

@imikushin imikushin merged commit 2f8cbee into rancher:master Nov 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants