Skip to content

Commit

Permalink
Remove API ingress and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jardon committed Mar 10, 2022
1 parent 770885c commit 109111f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ storage:
location: /data
minimum-size: 10G
requires:
ingress:
console-ingress:
interface: ingress
schema: https://raw.githubusercontent.com/canonical/operator-schemas/master/ingress.yaml
versions: [v1]
12 changes: 2 additions & 10 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,15 @@ def _with_console_address(self, minio_args):
return [*minio_args, "--console-address", ":" + console_port]

def _configure_ingress(self, interfaces):
if interfaces["ingress"]:
interfaces["ingress"].send_data(
if interfaces["console-ingress"]:
interfaces["console-ingress"].send_data(
{
"prefix": "/",
"rewrite": "/",
"service": f"{self.model.app.name}-console",
"port": self.model.config["console-port"],
}
)
interfaces["ingress"].send_data(
{
"prefix": "/",
"rewrite": "/",
"service": f"{self.model.app.name}",
"port": self.model.config["port"],
}
)


def _gen_pass() -> str:
Expand Down
11 changes: 10 additions & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def test_install_with_all_inputs(harness):
)

# ingress
ingress_relation_name = "ingress"
ingress_relation_name = "console-ingress"
relation_version_data = {"_supported_versions": "- v1"}
ingress_rel_id = harness.add_relation(
ingress_relation_name, f"{ingress_relation_name}-subscriber"
Expand Down Expand Up @@ -368,3 +368,12 @@ def test_install_with_all_inputs(harness):
"--console-address",
":9001",
]
data = yaml.safe_load(harness.get_relation_data(os_rel_id, "minio")["data"])
assert data == {
"access-key": "test-access-key",
"namespace": None,
"port": 9000,
"secret-key": "test-secret-key",
"secure": False,
"service": "minio",
}

0 comments on commit 109111f

Please sign in to comment.