Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug for overriding rock environment variables #28

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ def _update(self, event): # noqa: C901
return

context = {}
context.update(
{convert_env_var(key): value for key, value in self.config.items() if key not in ["environment"]}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Why not key != "environment"? Did you meant to do something else here?

E: I see that this line just changed places. Still, if you (or the author) can tell why it is written this way that would be nice.

Copy link
Collaborator

Choose a reason for hiding this comment

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

All config variables on the charm are being converted into environment variables to be injected into the workload container, with the exception of the environment config which is a yaml-based config for configuring secrets introduced in #22 .

)
try:
self._validate(event)
environment_config = self.config.get("environment")
Expand All @@ -277,9 +280,6 @@ def _update(self, event): # noqa: C901
if value:
context.update({key: value})

context.update(
{convert_env_var(key): value for key, value in self.config.items() if key not in ["environment"]}
)
context.update({"TWC_PROMETHEUS_PORT": PROMETHEUS_PORT})

pebble_layer = {
Expand Down
Loading