Skip to content

Commit 7026666

Browse files
committed
version 0.0.12
1 parent 87391d4 commit 7026666

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

function/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"""The version of the function."""
1717

1818
# This is set at build time, using "hatch version"
19-
__version__ = "0.0.11"
19+
__version__ = "0.0.12"

function/fn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def RunFunction(
4545

4646
composite = req.observed.composite.resource
4747
name_prefix = composite["metadata"]["name"]
48-
endpoint = composite["spec"]["endpoint"]
48+
fqdn = composite["spec"]["endpoint"]
4949
cmds = composite["spec"]["cmds"]
5050

5151
environment = resource.struct_to_dict(
@@ -57,11 +57,12 @@ async def RunFunction(
5757
basic_auth = secret.get("data", {}).get("basicAuth", "") if secret else ""
5858

5959
jsonrpc_cfg = {
60-
"endpoint": endpoint,
60+
"fqdn": fqdn,
6161
"port": port,
6262
"scheme": scheme,
6363
"basicAuth": basic_auth,
6464
"insecureSkipTLSVerify": insecure_skip_tls_verify,
65+
"basePath": "/command-api",
6566
}
6667

6768
jsonrpc_observe_params = {
@@ -183,7 +184,7 @@ def construct_resource_request(ops: dict, config: dict) -> dict:
183184
"Authorization": [f"Basic {config['basicAuth']}"],
184185
},
185186
"payload": {
186-
"baseUrl": f"{config['scheme']}://{config['endpoint']}:{config['port']}",
187+
"baseUrl": f"{config['scheme']}://{config['fqdn']}:{config['port']}{config['basePath']}",
187188
"body": ops["create"],
188189
},
189190
"mappings": [

tests/test_fn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def test_run_function_generates_request(self) -> None:
143143
payload = spec["payload"]
144144
self.assertEqual(
145145
payload["baseUrl"],
146-
"http://ceos01.default.svc.cluster.local:6021",
146+
"http://ceos01.default.svc.cluster.local:6021/command-api",
147147
)
148148

149149
# JSON-RPC payload

0 commit comments

Comments
 (0)