Fix migration script to wrap symmetric-key in key-type container

The migration script was incorrectly placing symmetric-key directly
under the symmetric-key node, but according to the YANG schema, it
should be wrapped in a key-type container. This fixes the libyang
error: "Node 'cleartext-key' not found as a child of 'symmetric-key'
node" when migrating from v1.5 to v1.7.

Co-authored-by: troglobit <183517+troglobit@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-29 22:19:57 +00:00
co-authored by troglobit
parent ce136a5399
commit 46f25d7fd4
@@ -1,5 +1,5 @@
#!/bin/sh
# Rename cleartext-key to symmetric-key
# Rename cleartext-key to symmetric-key and wrap in key-type container
file=$1
temp=${file}.tmp
@@ -8,10 +8,12 @@ jq '
if .["ietf-keystore:keystore"]?."symmetric-keys"?."symmetric-key" then
.["ietf-keystore:keystore"]."symmetric-keys"."symmetric-key" |= map(
if ."infix-keystore:cleartext-key" then
# Rename cleartext-key to symmetric-key
# Rename cleartext-key to symmetric-key and wrap in key-type
."infix-keystore:cleartext-key" as $key_value |
del(."infix-keystore:cleartext-key") | . + {
"infix-keystore:symmetric-key": $key_value
"key-type": {
"infix-keystore:symmetric-key": $key_value
}
}
else
.