Explorar el Código

CONSOLE-3349: Update plugin template with ConsolePlugin v1 API changes

Jakub Hadvig hace 3 años
padre
commit
cc9bd2326a
Se han modificado 2 ficheros con 15 adiciones y 8 borrados
  1. 7 2
      README.md
  2. 8 6
      charts/openshift-console-plugin/templates/consoleplugin.yaml

+ 7 - 2
README.md

@@ -1,8 +1,7 @@
 # OpenShift Console Plugin Template
 
 This project is a minimal template for writing a new OpenShift Console dynamic
-plugin. It requires OpenShift 4.11. For an example of a plugin that works with
-OpenShift 4.10, see the `release-4.10` branch.
+plugin.
 
 [Dynamic plugins](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)
 allow you to extend the
@@ -12,6 +11,12 @@ at runtime, adding custom pages and other extensions. They are based on
 Plugins are registered with console using the `ConsolePlugin` custom resource
 and enabled in the console operator config by a cluster administrator.
 
+Using the latest `v1` API version of `ConsolePlugin` CRD, requires OpenShift 4.12
+and higher. For using old `v1alpha1` API version us OpenShift version 4.10 or 4.11.
+
+For an example of a plugin that works with OpenShift 4.11, see the `release-4.11` branch.
+For a plugin that works with OpenShift 4.10, see the `release-4.10` branch.
+
 [Node.js](https://nodejs.org/en/) and [yarn](https://yarnpkg.com) are required
 to build and run the example. To run OpenShift console in a container, either
 [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io) and

+ 8 - 6
charts/openshift-console-plugin/templates/consoleplugin.yaml

@@ -1,4 +1,4 @@
-apiVersion: console.openshift.io/v1alpha1
+apiVersion: console.openshift.io/v1
 kind: ConsolePlugin
 metadata:
   name: {{ template "openshift-console-plugin.name" . }}
@@ -7,8 +7,10 @@ metadata:
     {{- include "openshift-console-plugin.labels" . | nindent 4 }}
 spec:
   displayName: {{ default (printf "%s Plugin" (include "openshift-console-plugin.name" .)) .Values.plugin.description }}
-  service:
-    name: {{ template "openshift-console-plugin.name" . }}
-    namespace: {{ .Release.Namespace }}
-    port: {{ .Values.plugin.port }}
-    basePath: {{ .Values.plugin.basePath }}
+  backend:
+    type: Service
+    service:
+      name: {{ template "openshift-console-plugin.name" . }}
+      namespace: {{ .Release.Namespace }}
+      port: {{ .Values.plugin.port }}
+      basePath: {{ .Values.plugin.basePath }}