ROX-33021: Add better DX to develop plugin against sensor-proxy#19463
ROX-33021: Add better DX to develop plugin against sensor-proxy#19463
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 067fd75. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19463 +/- ##
==========================================
- Coverage 49.37% 49.32% -0.05%
==========================================
Files 2713 2722 +9
Lines 204977 205171 +194
==========================================
- Hits 101207 101201 -6
- Misses 96242 96438 +196
- Partials 7528 7532 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // Default to `/proxy/central` if not set | ||
| 'process.env.ACS_PROXY_BASE_PATH': JSON.stringify(process.env.ACS_PROXY_BASE_PATH), |
There was a problem hiding this comment.
Since it is no longer recommended or necessary to bypass the proxy and route directly to central, there is no need to ever modify this base path.
Description
Adds a script that exposes
sensor-proxyvia LoadBalancer, a NetworkPolicy to allow external traffic, and a CronJob to auto-cleanup these resources after a short period of time. This script is called automatically when starting a local OpenShift console container for development against the console plugin.Why do we want this
This allows plugin developers to start the console in dev mode and connect to an OpenShift cluster via the production network path, instead of directly to a publicly exposed central with a hard coded API token.
Benefits:
sensor-proxy(using the API token results in incorrect data when simulating a plugin response)start-ocp-console.shscript, without the need for additional env vars and configurationUser-facing documentation
Testing and quality
Automated testing
How I validated my change
Verify that
./scripts/start-ocp-console.shstarts the local Console correctly and loads the dev version of the dynamic plugin.Verify that data visible in the console plugin is correctly scoped to the cluster and namespace it belongs to.
Verify that the resources are created correctly, and are automatically cleaned up after the time limit with: