feat: Implement CRD version validation at server startup, providing warnings and update instructions for outdated CRDs#3355
Open
Aias00 wants to merge 8 commits intoalibaba:mainfrom
Open
Conversation
…arnings and update instructions for outdated CRDs
There was a problem hiding this comment.
Pull request overview
This PR implements CRD (Custom Resource Definition) version validation at server startup to detect outdated or missing CRDs and provide actionable warnings with update instructions. The feature helps prevent runtime issues by validating that required Higress CRDs are installed with the correct versions and schemas before the server starts.
Changes:
- Added CRD version validation logic that checks for required CRDs, their versions, and schema fields
- Integrated validation into server startup with formatted warning messages and update instructions
- Added comprehensive unit tests for validation helper functions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| pkg/kube/crd_version.go | Implements core CRD validation logic including version checking and schema field validation |
| pkg/kube/crd_version_test.go | Provides unit tests for validation helper functions and CRD definition verification |
| pkg/bootstrap/server.go | Integrates CRD validation into server startup sequence with user-friendly warning output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…factor CRD version helper tests.
…gress into feat/crd_version_check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
Implement CRD version validation at server startup, providing warnings and update instructions for outdated CRDs
fixes: #2278
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
Ⅵ. AI Coding Tool Usage Checklist (if applicable)
Please check all applicable items:
For new standalone features (e.g., new wasm plugin or golang-filter plugin):
design/directory in the plugin folderdesign/directoryFor regular updates/changes (not new plugins):
AI Coding Prompts (for regular updates)
AI Coding Summary