Skip to content

Commit aefa61e

Browse files
committed
fix: don't include env vars in base context
1 parent 5ead25d commit aefa61e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

strong_opx/project/environment.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ def get_context_hooks(self) -> tuple[Callable[["Context"], None], ...]:
5050
)
5151

5252
def create_context(self) -> Context:
53-
context = Context(self.vars)
54-
context["ENVIRONMENT"] = self.name
55-
context["DOCKER_REGISTRY"] = current_docker_registry(self)
53+
context = Context({
54+
"ENVIRONMENT": self.name,
55+
"DOCKER_REGISTRY": current_docker_registry(self)
56+
})
5657

5758
for hook in self.get_context_hooks():
5859
hook(context)
@@ -66,6 +67,7 @@ def vault_secret(self):
6667
@cached_property
6768
def context(self) -> Context:
6869
context = self.base_context.chain()
70+
context.update(self.vars)
6971

7072
var_paths = self.project.vars_config.get_paths(self)
7173
for file_path in var_paths:

strong_opx/providers/docker_registry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ def current_docker_registry(environment: "Environment") -> Optional[AbstractDock
9393
)
9494
if registry_class:
9595
return registry_class(environment)
96+
97+
return None

0 commit comments

Comments
 (0)