Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

update processing when no global config #33

Merged
merged 2 commits into from
Apr 1, 2022
Merged

update processing when no global config #33

merged 2 commits into from
Apr 1, 2022

Conversation

siggiskulason
Copy link
Contributor

@siggiskulason siggiskulason commented Mar 30, 2022

  • Now backward compatible, so the following should work:
snap set my-snap env.my-service.service.host=localhost
snap set my-snap apps.my-service.config.service.port=8080
snap set my-snap config.debug=true

Signed-off-by: Siggi Skulason [email protected]


Related to:

- We always created empty .env files for all services if there was no config,
  truncating any existing files with values set by the older env.* config code.
  We now only override the existing files if there is new style config.* configuration,
  otherwise the .env files are left intact for backwards compatibility

- also replaced Info messages with Debug messages

Signed-off-by: Siggi Skulason <[email protected]>
@farshidtz
Copy link
Member

farshidtz commented Mar 30, 2022

Thanks for the fix

We now only override the existing files if there is new style config.* configuration,
otherwise the .env files are left intact for backwards compatibility

Does that mean mixing two namespaces isn't supported?

The following should work:

snap set my-snap env.my-service.service.host=localhost
snap set my-snap apps.my-service.config.service.port=8080
snap set my-snap config.debug=true

always append new settings in .env file

Signed-off-by: Siggi Skulason <[email protected]>
@siggiskulason
Copy link
Contributor Author

Thanks for the fix

We now only override the existing files if there is new style config.* configuration,
otherwise the .env files are left intact for backwards compatibility

Does that mean mixing two namespaces isn't supported?

The following should work:

snap set my-snap env.my-service.service.host=localhost
snap set my-snap apps.my-service.config.service.port=8080
snap set my-snap config.debug=true

I've fixed this now and am testing it. This scenario should now work, with mixed namespaces.

Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I have not tested. But it looks okay.

@siggiskulason siggiskulason merged commit 1093ff4 into canonical:master Apr 1, 2022
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.

Rename ProcessOptions to separate the functionality
2 participants