Skip to content

Commit

Permalink
ci: iterate on hub.existingSecret test
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Feb 21, 2021
1 parent a868655 commit 3987f1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion ci/test-hub-existing-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: test-hub-existing-secret
type: Opaque
stringData:
ConfigurableHTTPProxy.auth_token: fff999
JupyterHub.cookie_secret: fff999
CryptKeeper.keys: fff999
values.yaml: |
Expand Down
2 changes: 1 addition & 1 deletion dev-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ hub:
print(f"MYSQL_PWD={os.environ.get('MYSQL_PWD', None)}")
print(f"PGPASSWORD={os.environ.get('PGPASSWORD', None)}")
print()
print(f"ConfigurableHTTPProxy.auth_token={get_secret_value('ConfigurableHTTPProxy.auth_token', None)}")
print(f"CONFIGPROXY_AUTH_TOKEN={os.environ.get('CONFIGPROXY_AUTH_TOKEN', None)}")
print(f"JupyterHub.cookie_secret={get_secret_value('JupyterHub.cookie_secret', None)}")
print(f"CryptKeeper.keys={get_secret_value('CryptKeeper.keys', None)}")
print()
Expand Down
5 changes: 3 additions & 2 deletions tests/test_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,11 @@ def test_load_existing_secret():
else:
k8s_secret_exist = False
match = re.compile(r".*hub.existingSecret=(?P<ref>[\S]*).*", re.DOTALL).match(
"f\nfhub.existingSecret=\nf"
hub_logs
)
if match:
k8s_secret = match.group("ref")
assert k8s_secret, "This should never be found "
c = subprocess.run(["kubectl", "get", "secret", k8s_secret])
if c.returncode != 0:
pytest.skip(f"k8s Secret '{k8s_secret}' not found")
Expand All @@ -231,7 +232,7 @@ def test_load_existing_secret():
# variables MYSQL_PWD and PGPASSWORD would be setup correctly. But,
# configuring that would make the hub fail to startup without an
# actual database.
assert "ConfigurableHTTPProxy.auth_token=aaa111" in hub_logs
assert "CONFIGPROXY_AUTH_TOKEN=aaa111" in hub_logs
assert "JupyterHub.cookie_secret=fff999" in hub_logs
assert "CryptKeeper.keys=fff999" in hub_logs
assert "singleuser.extraLabels.test-chart-managed-secret=ok" in hub_logs
Expand Down

0 comments on commit 3987f1e

Please sign in to comment.