Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions operator/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ handle_private_key() {
}

post_pubkey_to_dappmanager() {
PUBLIC_KEY=$(jq -r '.pubKey' "${PRIVATE_KEY_FILE}")
# The field name varies by keystore format/version: pubKey, publicKey or pubkey
PUBLIC_KEY=$(jq -r '(.pubKey // .publicKey // .pubkey // empty)' "${PRIVATE_KEY_FILE}")

# If the PUBLIC_KEY is empty, try extracting using the '.publicKey' field (for previous SSV versions)
if [ -z "$PUBLIC_KEY" ] || [ "$PUBLIC_KEY" = "null" ]; then
PUBLIC_KEY=$(jq -r '.publicKey' "${PRIVATE_KEY_FILE}")
if [ -z "${PUBLIC_KEY}" ]; then
echo "[ERROR] Public key not found in ${PRIVATE_KEY_FILE}. Fields present: $(jq -c 'keys' "${PRIVATE_KEY_FILE}")"
return 0
fi

curl --connect-timeout 5 \
Expand Down
Loading