Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiling-J committed May 24, 2021
1 parent 3bf6ea3 commit 52ca944
Show file tree
Hide file tree
Showing 4 changed files with 475 additions and 691 deletions.
4 changes: 2 additions & 2 deletions pharos/jinja.py
Expand Up @@ -7,8 +7,8 @@ def to_yaml(value):


class JinjaEngine:
def __init__(self, client, internal=False):
loader = client.settings.jinja_loader
def __init__(self, client, internal=False, loader=None):
loader = loader if loader else client.settings.jinja_loader
if internal:
loader = PackageLoader("pharos", "templates")
elif not loader:
Expand Down
1 change: 1 addition & 0 deletions pharos/managers.py
Expand Up @@ -75,6 +75,7 @@ def get_queryset(self):
filterset = {self.to_field: selector}
if not self.skip_owner:
filterset["owner"] = self.owner
filterset['namespace'] = self.owner.namespace
return self._queryset_class(
model=self.model,
using=self._client,
Expand Down
2 changes: 1 addition & 1 deletion pharos/models.py
Expand Up @@ -104,12 +104,12 @@ def sync(self, template, variable, dry_run=False):
if dry_run:
return

self.objects.using(self._client)._create_variable_crd()
try:
self.variable.delete(name=self.variable_name)
except api_exceptions.NotFoundError:
pass

self.objects.using(self._client)._create_variable_crd()
PharosVariable.objects.using(self._client).create(
"variables.yaml",
{"name": self.variable_name, "value": variable},
Expand Down

0 comments on commit 52ca944

Please sign in to comment.