oc patch console - zhuje/openshift-wiki GitHub Wiki

If you are still doing the patching of the console, I was updating the monitoring-plugin as well to do the same thing for the helm deployment and found the tracing repo had this script in it, which doesn't override whichever other ones are up, only adds to the list [1]

existingPlugins=$(oc get consoles.operator.openshift.io cluster -o json | jq -c '.spec.plugins // []')
mergedPlugins=$(jq --argjson existingPlugins "${existingPlugins}" --argjson consolePlugin '["NEW_PLUGIN_NAME_HERE"]' -c  -n '$existingPlugins + $consolePlugin | unique')
patchedPlugins=$(jq --argjson mergedPlugins $mergedPlugins -n -c  '{ "spec": { "plugins": $mergedPlugins } }')
oc patch consoles.operator.openshift.io cluster --patch $patchedPlugins  --type=merge

[1]https://redhat-internal.slack.com/archives/D06HXJALYTA/p1727883138535509