diff --git a/charts/neon-storage-controller/Chart.yaml b/charts/neon-storage-controller/Chart.yaml index e979d73..86c18ab 100644 --- a/charts/neon-storage-controller/Chart.yaml +++ b/charts/neon-storage-controller/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: neon-storage-controller description: Neon storage controller type: application -version: 1.0.2 +version: 1.0.3 appVersion: "0.1.0" kubeVersion: "^1.18.x-x" home: https://neon.tech diff --git a/charts/neon-storage-controller/README.md b/charts/neon-storage-controller/README.md index 9101a1c..e5f4550 100644 --- a/charts/neon-storage-controller/README.md +++ b/charts/neon-storage-controller/README.md @@ -1,6 +1,6 @@ # neon-storage-controller -![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml) +![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml) Neon storage controller diff --git a/charts/neon-storage-controller/scripts/register-storage-controller.py b/charts/neon-storage-controller/scripts/register-storage-controller.py index ef33c17..3debdd9 100644 --- a/charts/neon-storage-controller/scripts/register-storage-controller.py +++ b/charts/neon-storage-controller/scripts/register-storage-controller.py @@ -65,7 +65,7 @@ def get_data(url, token, host=None): def get_pageserver_id(url, token): data = get_data(url, token, HOST) if "node_id" in data: - return data["node_id"] + return int(data["node_id"]) def get_pageserver_version(): @@ -97,7 +97,7 @@ def register(url, token, payload): response = json.loads(resp.read()) log.info(response) if "node_id" in response: - return response["node_id"] + return int(response["node_id"]) if __name__ == "__main__": @@ -132,7 +132,9 @@ def register(url, token, payload): PAYLOAD.update(dict(version=version)) log.info("check if pageserver already registered or not in console") - node_id_in_console = get_pageserver_id(GLOBAL_CPLANE_URL, GLOBAL_CPLANE_JWT_TOKEN) + node_id_in_console = get_pageserver_id( + GLOBAL_CPLANE_URL, GLOBAL_CPLANE_JWT_TOKEN + ) if node_id_in_console is None: log.info("Registering storage controller in console") @@ -150,12 +152,16 @@ def register(url, token, payload): ) log.info("check if pageserver already registered or not in cplane") - node_id_in_cplane = get_pageserver_id(LOCAL_CPLANE_URL, LOCAL_CPLANE_JWT_TOKEN) + node_id_in_cplane = get_pageserver_id( + LOCAL_CPLANE_URL, LOCAL_CPLANE_JWT_TOKEN + ) - if node_id_in_cplane is None: - PAYLOAD.update(dict(node_id=str(node_id_in_console))) + if node_id_in_cplane is None and node_id_in_console is not None: + PAYLOAD.update(dict(node_id=node_id_in_console)) log.info("Registering storage controller in cplane") - node_id_in_cplane = register(LOCAL_CPLANE_URL, LOCAL_CPLANE_JWT_TOKEN, PAYLOAD) + node_id_in_cplane = register( + LOCAL_CPLANE_URL, LOCAL_CPLANE_JWT_TOKEN, PAYLOAD + ) log.info( f"Storage controller registered in cplane with node_id \ {node_id_in_cplane}"