Here is my first input (recorded as bash var $services)
{"key": "movies-wikibase-jobrunner","subPath": "LocalSettings.php","cm": "movies-wikibase-jobrunner-localsettings-override-php"}{"key": "movies-wikibase-wdqs-frontend","subPath": "wdqs_front_index.html","cm": "movies-wikibase-wdqs-frontend-index-html"}I'd like to use subPath to update deployment.json.I tried to pass subPath as a bash argument to jq but nothing works
cat deployment.json | jq -r --arg services $services '((.spec.template.spec.containers[].volumeMounts[]? )) |= {mountPath: .mountPath, name: (.key, subPath: $services|select(.key=="movies-wikibase-wdqs-frontend").subPath})'How can I achieve this, and is this the good way?