From 4114aa0c12012950febdc3814d3e757c0b436e37 Mon Sep 17 00:00:00 2001 From: David Fernandez Date: Mon, 13 Apr 2026 15:19:57 -0300 Subject: [PATCH] fix(postgres-k8s): add entrypoint/entrypoint and NP_API_KEY bridge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add entrypoint/entrypoint script that delegates to handle-service-agent. The service_definition_agent_association module hardcodes the channel cmdline as entrypoint/entrypoint but the service only had handle-service-agent at root, causing "no such file or directory" on every service action. - Add NP_API_KEY → NULLPLATFORM_API_KEY bridge in handle-service-agent. np-agent exposes NP_API_KEY but np CLI expects NULLPLATFORM_API_KEY. Without this bridge, np service-action exec fails to authenticate. Co-Authored-By: Claude Sonnet 4.6 --- databases/postgres/k8s/entrypoint/entrypoint | 4 ++++ databases/postgres/k8s/handle-service-agent | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 databases/postgres/k8s/entrypoint/entrypoint diff --git a/databases/postgres/k8s/entrypoint/entrypoint b/databases/postgres/k8s/entrypoint/entrypoint new file mode 100755 index 0000000..3deab82 --- /dev/null +++ b/databases/postgres/k8s/entrypoint/entrypoint @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +SCRIPT_DIR="$(dirname "$(realpath "$0")")" +exec "$SCRIPT_DIR/../handle-service-agent" "$@" diff --git a/databases/postgres/k8s/handle-service-agent b/databases/postgres/k8s/handle-service-agent index 531b912..6b011a9 100755 --- a/databases/postgres/k8s/handle-service-agent +++ b/databases/postgres/k8s/handle-service-agent @@ -3,7 +3,12 @@ WORKING_DIRECTORY="$(dirname "$(realpath "$0")")" cd "$WORKING_DIRECTORY" || exit 1 +# Bridge: np-agent exposes NP_API_KEY, but np CLI expects NULLPLATFORM_API_KEY +if [ -n "${NP_API_KEY:-}" ] && [ -z "${NULLPLATFORM_API_KEY:-}" ]; then + export NULLPLATFORM_API_KEY="$NP_API_KEY" +fi + echo "Starting handle agent service" -np service-action exec --live-output --live-report --debug +np service-action exec --live-output --live-report --debug exit $? \ No newline at end of file