Skip to content

Commit

Permalink
Merge pull request #41 from ocadotechnology/added-tolerations-for-ds-…
Browse files Browse the repository at this point in the history
…and-ss-fix

fix: tolerations should be list of client.V1Toleration type
  • Loading branch information
YuraBeznos authored Mar 26, 2019
2 parents 5294403 + 3affd37 commit a7a31a8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mirroroperator/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def watch_registry_mirrors(self):


def safely_eval_env(env_var):
return ast.literal_eval(os.environ.get(env_var)) if env_var is not None else None
return ast.literal_eval(os.environ.get(env_var)) if os.environ.get(env_var) is not None else None


if __name__ == '__main__':
Expand Down
5 changes: 4 additions & 1 deletion mirroroperator/registrymirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def __init__(self, event_type, namespace, hostess_docker_registry,

self.ss_ds_labels = kwargs["ss_ds_labels"] or ""
self.ss_ds_template_labels = kwargs["ss_ds_template_labels"] or ""
self.ss_ds_tolerations = kwargs["ss_ds_tolerations"] or ""
self.ss_ds_tolerations = []
if kwargs["ss_ds_tolerations"] is not None:
for t in kwargs["ss_ds_tolerations"]:
self.ss_ds_tolerations.append(client.V1Toleration(**t))
self.image_pull_secrets = kwargs["image_pull_secrets"] or ""
self.ca_certificate_bundle = kwargs["ca_certificate_bundle"]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setUp(self):
"hostess_docker_tag": None,
"ss_ds_labels": {"test":"test_labels"},
"ss_ds_template_labels": {"test":"test_pod_labels"},
"ss_ds_tolerations": {"test": "test_taints"},
"ss_ds_tolerations": [{"key": "some.tol.era/tion", "operator": "Exists"}],
"image_pull_secrets": None,
"docker_certificate_secret": 'aaa',
"ca_certificate_bundle": 'bbb',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_regmirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setUp(self):
"hostess_docker_tag": 2,
"ss_ds_labels":{"test":"test_labels"},
"ss_ds_template_labels":{"test": "test_pod_labels"},
"ss_ds_tolerations": {"test": "test_taints"},
"ss_ds_tolerations": [{"key": "some.tol.era/tion", "operator": "Exists"}],
"image_pull_secrets": None,
"docker_certificate_secret": VALID_SECRET,
"ca_certificate_bundle": None,
Expand Down

0 comments on commit a7a31a8

Please sign in to comment.