Skip to content

Commit e0368c6

Browse files
authored
chore(version): set version to 4.1.0-dev (#135)
1 parent 6da964f commit e0368c6

File tree

3 files changed

+3
-217
lines changed

3 files changed

+3
-217
lines changed

README.md

Lines changed: 0 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -86,220 +86,6 @@ yarn run start-console
8686

8787
The OpenShift Console running the plugin will be available at http://localhost:9000
8888

89-
# OpenShift Console Plugin Template
90-
91-
This project is a minimal template for writing a new OpenShift Console dynamic
92-
plugin.
93-
94-
[Dynamic plugins](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)
95-
allow you to extend the
96-
[OpenShift UI](https://github.com/openshift/console)
97-
at runtime, adding custom pages and other extensions. They are based on
98-
[webpack module federation](https://webpack.js.org/concepts/module-federation/).
99-
Plugins are registered with console using the `ConsolePlugin` custom resource
100-
and enabled in the console operator config by a cluster administrator.
101-
102-
Using the latest `v1` API version of `ConsolePlugin` CRD, requires OpenShift 4.12
103-
and higher. For using old `v1alpha1` API version us OpenShift version 4.10 or 4.11.
104-
105-
For an example of a plugin that works with OpenShift 4.11, see the `release-4.11` branch.
106-
For a plugin that works with OpenShift 4.10, see the `release-4.10` branch.
107-
108-
[Node.js](https://nodejs.org/en/) and [yarn](https://yarnpkg.com) are required
109-
to build and run the example. To run OpenShift console in a container, either
110-
[Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io) and
111-
[oc](https://console.redhat.com/openshift/downloads) are required.
112-
113-
## Getting started
114-
115-
After cloning this repo, you should update the plugin metadata such as the
116-
plugin name in the `consolePlugin` declaration of [package.json](package.json).
117-
118-
```json
119-
"consolePlugin": {
120-
"name": "console-plugin-template",
121-
"version": "0.0.1",
122-
"displayName": "My Plugin",
123-
"description": "Enjoy this shiny, new console plugin!",
124-
"exposedModules": {
125-
"ExamplePage": "./components/ExamplePage"
126-
},
127-
"dependencies": {
128-
"@console/pluginAPI": "*"
129-
}
130-
}
131-
```
132-
133-
The template adds a single example page in the Home navigation section. The
134-
extension is declared in the [console-extensions.json](console-extensions.json)
135-
file and the React component is declared in
136-
[src/components/ExamplePage.tsx](src/components/ExamplePage.tsx).
137-
138-
You can run the plugin using a local development environment or build an image
139-
to deploy it to a cluster.
140-
141-
## Development
142-
143-
### Option 1: Local
144-
145-
In one terminal window, run:
146-
147-
1. `yarn install`
148-
2. `yarn run start`
149-
150-
In another terminal window, run:
151-
152-
1. `oc login` (requires [oc](https://console.redhat.com/openshift/downloads) and an [OpenShift cluster](https://console.redhat.com/openshift/create))
153-
2. `yarn run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))
154-
155-
This will run the OpenShift console in a container connected to the cluster
156-
you've logged into. The plugin HTTP server runs on port 9001 with CORS enabled.
157-
Navigate to <http://localhost:9000/example> to see the running plugin.
158-
159-
#### Running start-console with Apple silicon and podman
160-
161-
If you are using podman on a Mac with Apple silicon, `yarn run start-console`
162-
might fail since it runs an amd64 image. You can workaround the problem with
163-
[qemu-user-static](https://github.com/multiarch/qemu-user-static) by running
164-
these commands:
165-
166-
```bash
167-
podman machine ssh
168-
sudo -i
169-
rpm-ostree install qemu-user-static
170-
systemctl reboot
171-
```
172-
173-
### Option 2: Docker + VSCode Remote Container
174-
175-
Make sure the
176-
[Remote Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
177-
extension is installed. This method uses Docker Compose where one container is
178-
the OpenShift console and the second container is the plugin. It requires that
179-
you have access to an existing OpenShift cluster. After the initial build, the
180-
cached containers will help you start developing in seconds.
181-
182-
1. Create a `dev.env` file inside the `.devcontainer` folder with the correct values for your cluster:
183-
184-
```bash
185-
OC_PLUGIN_NAME=console-plugin-template
186-
OC_URL=https://api.example.com:6443
187-
OC_USER=kubeadmin
188-
OC_PASS=<password>
189-
```
190-
191-
2. `(Ctrl+Shift+P) => Remote Containers: Open Folder in Container...`
192-
3. `yarn run start`
193-
4. Navigate to <http://localhost:9000/example>
194-
195-
## Docker image
196-
197-
Before you can deploy your plugin on a cluster, you must build an image and
198-
push it to an image registry.
199-
200-
1. Build the image:
201-
202-
```sh
203-
docker build -t quay.io/my-repository/my-plugin:latest .
204-
```
205-
206-
2. Run the image:
207-
208-
```sh
209-
docker run -it --rm -d -p 9001:80 quay.io/my-repository/my-plugin:latest
210-
```
211-
212-
3. Push the image:
213-
214-
```sh
215-
docker push quay.io/my-repository/my-plugin:latest
216-
```
217-
218-
NOTE: If you have a Mac with Apple silicon, you will need to add the flag
219-
`--platform=linux/amd64` when building the image to target the correct platform
220-
to run in-cluster.
221-
222-
## Deployment on cluster
223-
224-
A [Helm](https://helm.sh) chart is available to deploy the plugin to an OpenShift environment.
225-
226-
The following Helm parameters are required:
227-
228-
`plugin.image`: The location of the image containing the plugin that was previously pushed
229-
230-
Additional parameters can be specified if desired. Consult the chart [values](charts/openshift-console-plugin/values.yaml) file for the full set of supported parameters.
231-
232-
### Installing the Helm Chart
233-
234-
Install the chart using the name of the plugin as the Helm release name into a new namespace or an existing namespace as specified by the `plugin_console-plugin-template` parameter and providing the location of the image within the `plugin.image` parameter by using the following command:
235-
236-
```shell
237-
helm upgrade -i my-plugin charts/openshift-console-plugin -n plugin__cryostat-plugin --create-namespace --set plugin.image=my-plugin-image-location
238-
```
239-
240-
NOTE: When deploying on OpenShift 4.10, it is recommended to add the parameter `--set plugin.securityContext.enabled=false` which will omit configurations related to Pod Security.
241-
242-
NOTE: When defining i18n namespace, adhere `plugin__<name-of-the-plugin>` format. The name of the plugin should be extracted from the `consolePlugin` declaration within the [package.json](package.json) file.
243-
244-
## i18n
245-
246-
The plugin template demonstrates how you can translate messages in with [react-i18next](https://react.i18next.com/). The i18n namespace must match
247-
the name of the `ConsolePlugin` resource with the `plugin__` prefix to avoid
248-
naming conflicts. For example, the plugin template uses the
249-
`plugin__cryostat-plugin` namespace. You can use the `useTranslation` hook
250-
with this namespace as follows:
251-
252-
```tsx
253-
conster Header: React.FC = () => {
254-
const { t } = useTranslation('plugin__cryostat-plugin');
255-
return <h1>{t('Hello, World!')}</h1>;
256-
};
257-
```
258-
259-
For labels in `console-extensions.json`, you can use the format
260-
`%plugin__cryostat-plugin~My Label%`. Console will replace the value with
261-
the message for the current language from the `plugin__cryostat-plugin`
262-
namespace. For example:
263-
264-
```json
265-
{
266-
"type": "console.navigation/section",
267-
"properties": {
268-
"id": "admin-demo-section",
269-
"perspective": "admin",
270-
"name": "%plugin__cryostat-plugin~Plugin Template%"
271-
}
272-
}
273-
```
274-
275-
Running `yarn i18n` updates the JSON files in the `locales` folder of the
276-
plugin template when adding or changing messages.
277-
278-
## Linting
279-
280-
This project adds prettier, eslint, and stylelint. Linting can be run with
281-
`yarn run lint`.
282-
283-
The stylelint config disallows hex colors since these cause problems with dark
284-
mode (starting in OpenShift console 4.11). You should use the
285-
[PatternFly global CSS variables](https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables)
286-
for colors instead.
287-
288-
The stylelint config also disallows naked element selectors like `table` and
289-
`.pf-` or `.co-` prefixed classes. This prevents plugins from accidentally
290-
overwriting default console styles, breaking the layout of existing pages. The
291-
best practice is to prefix your CSS classnames with your plugin name to avoid
292-
conflicts. Please don't disable these rules without understanding how they can
293-
break console styles!
294-
295-
## Reporting
296-
297-
Steps to generate reports
298-
299-
1. In command prompt, navigate to root folder and execute the command `yarn run cypress-merge`
300-
2. Then execute command `yarn run cypress-generate`
301-
The cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory
302-
30389
## References
30490

30591
- [Console Plugin SDK README](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backend",
3-
"version": "0.0.1",
3+
"version": "4.1.0-dev",
44
"description": "",
55
"main": "server.js",
66
"scripts": {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cryostat-openshift-console-plugin",
3-
"version": "0.0.1",
3+
"version": "4.1.0-dev",
44
"description": "OpenShift Console plugin for Cryostat",
55
"private": true,
66
"license": "Apache-2.0",
@@ -108,7 +108,7 @@
108108
},
109109
"consolePlugin": {
110110
"name": "cryostat-plugin",
111-
"version": "0.0.1",
111+
"version": "4.1.0-dev",
112112
"displayName": "Cryostat OpenShift Console Plugin",
113113
"description": "OpenShift Console plugin for Cryostat",
114114
"exposedModules": {

0 commit comments

Comments
 (0)