Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate compressedEndpoint property into extension charts #13236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jordojordo
Copy link
Member

@jordojordo jordojordo commented Jan 29, 2025

Summary

Fixes #13200

Note:
I will provide a custom image of rancher/rancher which includes the functionality for the new CRD for a UIPlugin resource.

This PR introduces support for compressed UI plugin endpoints and enhances Helm chart configuration to dynamically set plugin endpoints based on the build environment (GitHub or ECI).

Occurred changes and/or fixed issues

  • Added validation for compressedEndpoint alongside endpoint in plugin resource checks.
  • Updated Helm charts to configure endpoint and compressedEndpoint via values, allowing dynamic URL generation.
  • Refactored the helmpatch script to automate endpoint configuration for GitHub and container builds.
  • Added .tgz packaging for extensions to support compressed plugin delivery.
  • Removed manual Helm chart patching in favor of environment-driven configuration.

Technical notes summary

  • Validation Logic: Plugins now require either endpoint or compressedEndpoint (previously only endpoint was enforced).
  • Helm Configuration:
    • endpoint and compressedEndpoint are derived from build context (e.g., GitHub URLs use raw.githubusercontent.com, while container builds use service URLs).
    • compressedEndpoint is automatically set as .tgz.
  • Build Scripts:
    • The publish script now generates a .tgz archive for compressed plugin delivery.
    • The helmpatch script dynamically updates Helm chart values using environment variables (e.g., GITHUB_BUILD, IMAGE_PREFIX).

Areas or cases that should be tested

You can use my forks of the Neuvector manager-ext and Harvester ui-extension as cluster repositories to test. I have published the following for tests:

  • Neuvector neuvector-ui-extension version: 3.0.1
    • ECI build image can be found here: jordonleach/manager-ext:2.0.0
  • Harvester harvester version: 2.0.0
    • ECI build image can be found here: jordonleach/harvester-ui-extension:tagname:2.0.0

Note:
Each helm chart for the above extensions have both the endpoint and compressedEndpoint properties.
I have tested each helm chart with the custom Rancher v2.10 version as well as v2.10.2 and v2.9.6.

  1. Plugin Loading:
  • Verify plugins load correctly with both endpoint and compressedEndpoint configurations.
  • Test in Airgap and online environments.
  1. Helm Chart Configuration:
  • Confirm endpoint and compressedEndpoint values are correctly populated in GitHub and container builds.
  1. Compressed Artifacts:
  • Ensure .tgz files are generated and accessible at the specified compressedEndpoint.
  1. Backwards compatibility:
  • Ensure charts with both compressedEndpoint and endpoint properties defined can install on older versions of rancher (v2.10, v2.9)

Areas which could experience regressions

  • Plugin Compatibility: Existing plugins without compressedEndpoint may fail if validation logic incorrectly rejects valid - configurations.
  • Helm Upgrades: Ensure chart upgrades do not break existing deployments relying on the old endpoint structure.
  • Build Pipelines: Verify environment variables (e.g., GITHUB_SOURCE, IMAGE_PREFIX) are correctly set in CI/CD workflows.

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

…tor publishing script to use values.yaml for endpoints
@jordojordo jordojordo added this to the v2.11.0 milestone Jan 29, 2025
@jordojordo jordojordo requested a review from aalves08 January 29, 2025 21:20
@jordojordo jordojordo self-assigned this Jan 29, 2025
@aalves08 aalves08 requested review from nwmac and removed request for aalves08 January 30, 2025 13:49
@jordojordo jordojordo marked this pull request as ready for review January 30, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extensions: Test the ability for the extensions operator to handle extension assets as tgz
1 participant