-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add velero plugin configuration schema and validation #3169
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
base: main
Are you sure you want to change the base?
feat: add velero plugin configuration schema and validation #3169
Conversation
ccb27c9 to
0db3432
Compare
|
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer: Airgap Installer (may take a few minutes before the airgap bundle is built): Happy debugging! |
Add support for configuring custom Velero plugins in the Embedded Cluster
Config CRD. This is the first PR in a series to enable vendors to extend
EC's disaster recovery capabilities with specialized backup plugins.
Changes:
- Add VeleroExtensions and VeleroPlugin types to ConfigSpec.Extensions
- Regenerate CRD schema to include velero.plugins field with validation
- Implement plugin validation in lint validator:
- Validate image format (OCI reference format)
- Detect duplicate plugin images
- Check for required fields
- Add unit tests for validation logic
The new configuration structure allows vendors to specify custom Velero
plugins as OCI images that will be injected as initContainers into the
Velero deployment. Image references support both explicit registry paths
and short names that will use EC's proxy registry.
Example configuration:
extensions:
velero:
plugins:
- image: myvendor/velero-plugin:v1.0.0
This sets the foundation for PR 2 which will implement the Helm values
generation to actually inject these plugins into the Velero deployment.
Refs: SC-131045
Signed-off-by: Evans Mungai <[email protected]>
7a3670b to
d3986cc
Compare
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
| return errors | ||
| } | ||
|
|
||
| // validateImageFormat validates that an image string follows a valid OCI image reference format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a standard regex used by tools like docker that we can just use instead of reimplementing this from scratch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is. I changed this implementation to use oras library for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the comment below about basic validation irrelevant / inaccurate now then?
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
| } | ||
|
|
||
| return nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Image Validation Fails Documented Short Names
The validateImageFormat function rejects short image names like velero-plugin-postgres:v1.0.0, but the documentation in config_types.go and CRD schemas explicitly states these formats are valid and will use the proxy registry. The registry.ParseReference call requires at least a repository component (e.g., repo/image), making it incompatible with the documented support for short names. This creates a mismatch where users following the documented examples will encounter validation errors.
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
What this PR does / why we need it:
Add support for configuring custom Velero plugins in the Embedded Cluster Config CRD. This is the first PR in a series to enable vendors to extend EC's disaster recovery capabilities with specialized backup plugins.
Changes:
The new configuration structure allows vendors to specify custom Velero plugins as OCI images that will be injected as initContainers into the Velero deployment. Image references support both explicit registry paths and short names that will use EC's proxy registry.
Example configuration:
This sets the foundation for #3177 which will implement the Helm values generation to actually inject these plugins into the Velero deployment.
Which issue(s) this PR fixes:
Ref: sc-131045
Does this PR require a test?
Does this PR require a release note?
Does this PR require documentation?