Hide Forgot
The console doesn't honor the `@console/pluginAPI` version range declared in the plugin manifest. This means console can load incompatible plugins, causing runtime errors and possibly breaking console functionality. https://github.com/openshift/enhancements/blob/master/enhancements/console/dynamic-plugins.md#plugin-manifest-properties Console should inspect the version range and compare it to the OpenShift console version. If the versions don't match, the plugin should not be loaded. Likely this will require operator to pass the version to console on startup. This is important for 4.10 since some operators might need to deliver multiple plugins and enable only the compatible versions as internal APIs have changed from 4.9 to 4.10.
Note that the associated PR also covers resolving dependencies on other plugins, in addition to resolving dependency on Console itself (@console/pluginAPI).
1. update console-demo-plugin manifest dependencies.@console/pluginAPI to semver version "~4.9.0" $ git diff dynamic-demo-plugin/package.json diff --git a/dynamic-demo-plugin/package.json b/dynamic-demo-plugin/package.json index dd0e3a1436..01f985f454 100644 --- a/dynamic-demo-plugin/package.json +++ b/dynamic-demo-plugin/package.json @@ -66,7 +66,7 @@ "projectOverview": "./utils/project-overview" }, "dependencies": { - "@console/pluginAPI": "*" + "@console/pluginAPI": "~4.9.0" }, "disableStaticPlugins": [ "@console/demo-plugin" 2. deploy and enable console-demo-plugin on a 4.12.0-0.nightly-2022-07-21-144610 cluster which has releaseVersion also set to 4.12.0-0.nightly-2022-07-21-144610 $ oc get cm console-config -n openshift-console -o yaml | grep releaseVersion releaseVersion: 4.12.0-0.nightly-2022-07-21-144610 3. monitor the logs in javascript console, we can see error messages: Error while loading plugin console-demo-plugin from /api/plugins/console-demo-plugin/ u: Unmet dependency on Console plugin API: @console/pluginAPI: required ~4.9.0, current 4.12.0-0.nightly-2022-07-21-144610 when `@console/pluingAPI` doesn't match openshift console version, the plugin will not be loaded when we defines some dependencies not existing $ git diff dynamic-demo-plugin/package.json diff --git a/dynamic-demo-plugin/package.json b/dynamic-demo-plugin/package.json index dd0e3a1436..34ff180eda 100644 --- a/dynamic-demo-plugin/package.json +++ b/dynamic-demo-plugin/package.json @@ -66,7 +66,8 @@ "projectOverview": "./utils/project-overview" }, "dependencies": { - "@console/pluginAPI": "*" + "@console/pluginAPI": "=4.12.0-0.nightly-2022-07-21-144610", + "foo": "^1.0.0" }, we can see errors in javascript console: Error while loading plugin console-demo-plugin from /api/plugins/console-demo-plugin/ Error: Dependent plugins are not available: foo
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.12.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:7399