test(admission): add CRD validation integration test#3877
Merged
robobario merged 1 commit intoMay 6, 2026
Merged
Conversation
robobario
commented
May 5, 2026
| @@ -125,7 +125,7 @@ spec: | |||
| name: | |||
| description: A unique name for this filter instance. | |||
| type: string | |||
| pattern: "[a-z0-9A-Z]([a-z0-9A-Z_.\\-]{0,251}[a-z0-9A-Z])?" | |||
| pattern: "^[a-z0-9A-Z]([a-z0-9A-Z_.\\-]{0,251}[a-z0-9A-Z])?$" | |||
Member
Author
There was a problem hiding this comment.
tests showed up that the pattern matched names like -starts-with-hyphen
robobario
commented
May 5, 2026
f6a260e to
bde3740
Compare
tombentley
reviewed
May 6, 2026
Member
tombentley
left a comment
There was a problem hiding this comment.
Looks good, but I had one question.
Adds CustomResourceValidationIT following the same pattern as the operator's validation test. The test validates KroxyliciousSidecarConfig CRD schema enforcement by applying YAML scenarios against a live Kubernetes cluster. Test coverage: - Required fields (spec.targetBootstrapServers) - Pattern validations (metadata.name, filterDefinitions, plugins) - Numeric constraints (port ranges, nodeIdRange minimums) - Enum validations (pullPolicy) - Length constraints (maxLength on names) - Status subresource schema (Kubernetes condition structure) Infrastructure: - AdmissionTestUtils: Kubernetes client utilities - TestFiles: YAML scenario file discovery (duplicated from operator) Test uses direct Fabric8 client calls (serverSideApply) rather than JOSDK, consistent with existing admission module patterns. Also fixes CRD schema issues: - Anchors filter name pattern to prevent partial matches Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Robert Young <robertyoungnz@gmail.com>
bde3740 to
877b9da
Compare
|
|
0783f0d
into
kroxylicious:epic/admission-web-hook
30 checks passed
tombentley
pushed a commit
that referenced
this pull request
May 8, 2026
Adds CustomResourceValidationIT following the same pattern as the operator's validation test. The test validates KroxyliciousSidecarConfig CRD schema enforcement by applying YAML scenarios against a live Kubernetes cluster. Test coverage: - Required fields (spec.targetBootstrapServers) - Pattern validations (metadata.name, filterDefinitions, plugins) - Numeric constraints (port ranges, nodeIdRange minimums) - Enum validations (pullPolicy) - Length constraints (maxLength on names) - Status subresource schema (Kubernetes condition structure) Infrastructure: - AdmissionTestUtils: Kubernetes client utilities - TestFiles: YAML scenario file discovery (duplicated from operator) Test uses direct Fabric8 client calls (serverSideApply) rather than JOSDK, consistent with existing admission module patterns. Also fixes CRD schema issues: - Anchors filter name pattern to prevent partial matches Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Robert Young <robertyoungnz@gmail.com>
robobario
added a commit
that referenced
this pull request
May 11, 2026
Adds CustomResourceValidationIT following the same pattern as the operator's validation test. The test validates KroxyliciousSidecarConfig CRD schema enforcement by applying YAML scenarios against a live Kubernetes cluster. Test coverage: - Required fields (spec.targetBootstrapServers) - Pattern validations (metadata.name, filterDefinitions, plugins) - Numeric constraints (port ranges, nodeIdRange minimums) - Enum validations (pullPolicy) - Length constraints (maxLength on names) - Status subresource schema (Kubernetes condition structure) Infrastructure: - AdmissionTestUtils: Kubernetes client utilities - TestFiles: YAML scenario file discovery (duplicated from operator) Test uses direct Fabric8 client calls (serverSideApply) rather than JOSDK, consistent with existing admission module patterns. Also fixes CRD schema issues: - Anchors filter name pattern to prevent partial matches Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Robert Young <robertyoungnz@gmail.com>
robobario
added a commit
that referenced
this pull request
May 11, 2026
Adds CustomResourceValidationIT following the same pattern as the operator's validation test. The test validates KroxyliciousSidecarConfig CRD schema enforcement by applying YAML scenarios against a live Kubernetes cluster. Test coverage: - Required fields (spec.targetBootstrapServers) - Pattern validations (metadata.name, filterDefinitions, plugins) - Numeric constraints (port ranges, nodeIdRange minimums) - Enum validations (pullPolicy) - Length constraints (maxLength on names) - Status subresource schema (Kubernetes condition structure) Infrastructure: - AdmissionTestUtils: Kubernetes client utilities - TestFiles: YAML scenario file discovery (duplicated from operator) Test uses direct Fabric8 client calls (serverSideApply) rather than JOSDK, consistent with existing admission module patterns. Also fixes CRD schema issues: - Anchors filter name pattern to prevent partial matches Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Robert Young <robertyoungnz@gmail.com>
robobario
added a commit
that referenced
this pull request
May 11, 2026
Adds CustomResourceValidationIT following the same pattern as the operator's validation test. The test validates KroxyliciousSidecarConfig CRD schema enforcement by applying YAML scenarios against a live Kubernetes cluster. Test coverage: - Required fields (spec.targetBootstrapServers) - Pattern validations (metadata.name, filterDefinitions, plugins) - Numeric constraints (port ranges, nodeIdRange minimums) - Enum validations (pullPolicy) - Length constraints (maxLength on names) - Status subresource schema (Kubernetes condition structure) Infrastructure: - AdmissionTestUtils: Kubernetes client utilities - TestFiles: YAML scenario file discovery (duplicated from operator) Test uses direct Fabric8 client calls (serverSideApply) rather than JOSDK, consistent with existing admission module patterns. Also fixes CRD schema issues: - Anchors filter name pattern to prevent partial matches Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Robert Young <robertyoungnz@gmail.com>
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.



Type of change
Description
Adds CustomResourceValidationIT following the same pattern as the operator's validation test. The test validates KroxyliciousSidecarConfig CRD schema enforcement by applying YAML scenarios against a live Kubernetes cluster.
Test coverage:
Infrastructure:
Test uses direct Fabric8 client calls (serverSideApply) rather than JOSDK, consistent with existing admission module patterns.
Also fixes CRD schema issues:
Assisted-by: Claude Sonnet 4.5 noreply@anthropic.com
Contributes towards #3890
Checklist
Please go through this checklist and make sure all applicable tasks have been done
Assisted-by:trailer (see DEV_GUIDE.md).