Skip to content

feat(k8s-export-openapi): add tests and update removal logic for OpenAPI fields#4649

Open
manumathon wants to merge 1 commit into
agones-dev:mainfrom
manumathon:manu-work-strip
Open

feat(k8s-export-openapi): add tests and update removal logic for OpenAPI fields#4649
manumathon wants to merge 1 commit into
agones-dev:mainfrom
manumathon:manu-work-strip

Conversation

@manumathon

@manumathon manumathon commented Jul 19, 2026

Copy link
Copy Markdown

What type of PR is this?
/kind bug

What this PR does / Why we need it:

  • Introduced a new test file for the k8s-export-openapi script to validate the removal of specific fields from OpenAPI definitions.
  • Updated the removeFields function to retain certain keys (x-kubernetes-patch-strategy, x-kubernetes-patch-merge-key) while removing others.
  • Modified the Makefile to include the new test in the build process.
  • Enhanced YAML templates to include x-kubernetes-patch-strategy and x-kubernetes-patch-merge-key where necessary.

This change improves the testing coverage and ensures compliance with Kubernetes API specifications.

Which issue(s) this PR fixes:

Closes #3112

Did you use AI tools in preparing this PR?:
Yes, I used AI tools to investigate the issue, but I implemented the fix myself. I also used AI to help draft GitHub commit msg.

Special notes for your reviewer:

…API fields

- Introduced a new test file for the k8s-export-openapi script to validate the removal of specific fields from OpenAPI definitions.
- Updated the `removeFields` function to retain certain keys (`x-kubernetes-patch-strategy`, `x-kubernetes-patch-merge-key`) while removing others.
- Modified the Makefile to include the new test in the build process.
- Enhanced YAML templates to include `x-kubernetes-patch-strategy` and `x-kubernetes-patch-merge-key` where necessary.

This change improves the testing coverage and ensures compliance with Kubernetes API specifications.

Signed-off-by: Manu <kiratcodes99@gmail.com>
@markmandel

Copy link
Copy Markdown
Member

/gcbrun

Neat! Let's take it for a spin!

@agones-bot

Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 0f8773f1-c47f-4351-b523-aaddc44d9420

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4649/head:pr_4649 && git checkout pr_4649
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.60.0-dev-a986732

"testing"
)

func TestRemoveFieldsKeepsPatchKeys(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.

This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
This is a stable field but requires that the DynamicResourceAllocation feature gate is enabled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which version of K8s did you generate this against? I'm wondering if it's further forward than what we have in our supported matrix.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using v1.34.1 version.

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.

Add OpenAPI x-kubernetes-patch keys for patching CRDs

3 participants