You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
init.sh now generates plugin.yaml (via helm template)
and copies pages/index.html into backend/static/ so
the running Go backend serves the landing page locally.
Also adds helm prerequisite check, extracts PLUGIN_NAME
variable, simplifies README dev setup docs, and adds
CRC host mapping for macOS containers.
Co-Authored-By: Claude <noreply@anthropic.com>
-[Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io)
49
51
- An [OpenShift cluster](https://console.redhat.com/openshift/create)
50
52
- Github [*Personal Access Token*](https://github.com/settings/personal-access-tokens) with *administration*, *content* and *workflow* write permissions in all repositories
51
53
-[inotify-tools](https://github.com/inotify-tools/inotify-tools) (optional, enables Go backend auto-recompile on file changes)
52
54
53
-
### Option 1: Local
55
+
### Setup
54
56
55
-
In one terminal window, run:
57
+
1.`oc login` to your OpenShift cluster
58
+
2.`yarn install`
59
+
3.`./init.sh`
56
60
57
-
1.`yarn install`
58
-
2.`yarn run start`
61
+
This builds the pages assets (plugin.yaml, landing page), compiles the Go backend, starts the webpack dev server, and launches the OpenShift console in a container. Navigate to <http://localhost:9000> to see the running plugin.
59
62
60
-
In another terminal window, run:
63
+
To stop the dev environment:
61
64
62
-
1.`oc login` (requires [oc](https://console.redhat.com/openshift/downloads) and an [OpenShift cluster](https://console.redhat.com/openshift/create))
63
-
2.`yarn run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))
64
-
65
-
This will run the OpenShift console in a container connected to the cluster
66
-
you've logged into. The plugin HTTP server runs on port 9001 with CORS enabled.
67
-
Navigate to <http://localhost:9000/example> to see the running plugin.
68
-
69
-
#### Running start-console with Apple silicon and podman
70
-
71
-
If you are using podman on a Mac with Apple silicon, `yarn run start-console`
72
-
might fail since it runs an amd64 image. You can workaround the problem with
73
-
[qemu-user-static](https://github.com/multiarch/qemu-user-static) by running
74
-
these commands:
75
-
76
-
```bash
77
-
podman machine ssh
78
-
sudo -i
79
-
rpm-ostree install qemu-user-static
80
-
systemctl reboot
65
+
```shell
66
+
./init.sh --stop
81
67
```
82
68
83
-
### Option 2: Docker + VSCode Remote Container
69
+
To use random ports (useful when defaults are already in use):
extension is installed. This method uses Docker Compose where one container is
88
-
the OpenShift console and the second container is the plugin. It requires that
89
-
you have access to an existing OpenShift cluster. After the initial build, the
90
-
cached containers will help you start developing in seconds.
91
-
92
-
1. Create a `dev.env` file inside the `.devcontainer` folder with the correct values for your cluster:
93
-
94
-
```bash
95
-
OC_PLUGIN_NAME=console-functions-plugin
96
-
OC_URL=https://api.example.com:6443
97
-
OC_USER=kubeadmin
98
-
OC_PASS=<password>
71
+
```shell
72
+
./init.sh --randomize-ports
99
73
```
100
74
101
-
2.`(Ctrl+Shift+P) => Remote Containers: Open Folder in Container...`
102
-
3.`yarn run start`
103
-
4. Navigate to <http://localhost:9000/example>
75
+
### Viewing GitHub Pages locally
76
+
77
+
The landing page served at [functions-dev.github.io/ocp-console-plugin](https://functions-dev.github.io/ocp-console-plugin/) is built from `pages/index.html` and the Helm chart. The `init.sh` script generates these assets into `backend/static/` automatically, so the running backend serves them at <http://localhost:8080>.
Worked on: Add error state for copy-to-clipboard buttons on landing page
5
+
## 2026-06-16 | Session: PR #36 - GitHub Pages local dev + clipboard fix (SRVOCF-843)
6
+
Worked on: Local GitHub Pages dev support, clipboard copy error handling, PR review feedback
7
7
Completed:
8
-
- Added error handling for navigator.clipboard API unavailability (e.g. non-HTTPS contexts)
9
-
- Added .catch() handler for clipboard.writeText promise rejection
10
-
- Added error state styling (.copy-error class) with red color, X icon, and "Copy failed" hover label
11
-
- Applied error handling to both install command and YAML copy buttons
12
-
Left off: Branch pr/fix-catch ready for review.
8
+
- Added error handling for clipboard copy buttons: .catch() on writeText, error state styling (.copy-error class with red color, X icon, "Copy failed" label)
9
+
- GitHub Pages local dev: build_pages in init.sh, README simplification, CRC host mapping, .gitignore updates
10
+
- Extracted PLUGIN_NAME local variable in build_pages() to replace hardcoded strings
11
+
- Moved helm prerequisite check from check_prerequisites() into build_pages() (only needed there)
12
+
- Added features.json entry for SRVOCF-843, set "passes": true
13
+
- All 14 suites, 126 tests passing, webpack builds clean
14
+
Left off: Changes ready to commit and push for merge.
0 commit comments