feat(api): add validation and defaults for WebServer CRD#227
Open
Baigsufiyan wants to merge 3 commits intoweb-servers:mainfrom
Open
feat(api): add validation and defaults for WebServer CRD#227Baigsufiyan wants to merge 3 commits intoweb-servers:mainfrom
Baigsufiyan wants to merge 3 commits intoweb-servers:mainfrom
Conversation
This commit improves the API contract by: - Adding Kubebuilder markers for ImageStream and Source URL validation. - Implementing safe defaults for S2I build references (master branch, root context). - Enforcing mandatory readiness probes to ensure deployment stability. - Updating samples to reflect best practices for JBoss Web Server on OpenShift.
87528e7 to
5d170ad
Compare
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.
This PR adds basic validation and default values to the WebServer CRD.
Some fields in the spec could previously accept empty or malformed input,
which could later cause issues during S2I builds or deployment. The goal
here is to catch those cases earlier at the CRD validation level.
Changes:
SourceRepositoryURLMinLengthchecks for required fieldsSourceRepositoryRef-> "master"ContextDir-> "."make manifestsv1alpha1_webserver.yamlexample to match the updated schemaI verified the generated schema under
config/crd/bases/and checked thatthe updated example CR passes validation with the new rules.