Skip to content

fix: only render set PDB field to fix schema validation#4511

Merged
markmandel merged 4 commits intoagones-dev:mainfrom
nicknikolakakis:fix/4507-pdb-schema-validation
Apr 15, 2026
Merged

fix: only render set PDB field to fix schema validation#4511
markmandel merged 4 commits intoagones-dev:mainfrom
nicknikolakakis:fix/4507-pdb-schema-validation

Conversation

@nicknikolakakis
Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / Why we need it:

The PDB templates in controller.yaml, extensions-deployment.yaml, ping.yaml, and service/allocation.yaml unconditionally render both minAvailable and maxUnavailable fields. When only one is configured (the default sets minAvailable: 1), the other renders as an empty/null value, violating the PDB oneOf schema constraint.

This wraps each field in a conditional so only the field with a value is included in the rendered manifest.

Which issue(s) this PR fixes:

Fixes #4507

Special notes for your reviewer:

Verified with helm template:

  • Default values: only minAvailable: 1 rendered (no empty maxUnavailable)
  • With maxUnavailable set and minAvailable unset: only maxUnavailable rendered
  • With both set: existing mutual-exclusivity check + JSON schema validation both reject it

The PDB templates unconditionally rendered both minAvailable and
maxUnavailable fields, even when one was empty. This violates the
PDB schema which requires exactly one of the two fields. Wrap each
field in a conditional so only the field with a value is rendered.

Fixes agones-dev#4507

Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com>
@github-actions github-actions bot added kind/bug These are bugs. size/S labels Apr 12, 2026
@nicknikolakakis
Copy link
Copy Markdown
Contributor Author

Hi, the agones-dev-pull-request-build (agones-images) check failed but I can't access the Cloud Build logs. Could a maintainer take a look and let me know if there's something I need to fix, or if this just needs approval to run on a fork?

Also, I'd like to join the agones-discuss mailing list to access build logs - is https://groups.google.com/forum/#!forum/agones-discuss still the right link?

@Sivasankaran25
Copy link
Copy Markdown
Collaborator

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 1505a049-137c-4587-8ffc-8f8b1047a0ab

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Remove empty maxUnavailable fields from the generated install.yaml
to match the corrected Helm templates.

Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com>
@Sivasankaran25
Copy link
Copy Markdown
Collaborator

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 05912e0e-70d4-4e0b-9d51-a8552f79be7e

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@markmandel
Copy link
Copy Markdown
Member

Hi, the agones-dev-pull-request-build (agones-images) check failed but I can't access the Cloud Build logs. Could a maintainer take a look and let me know if there's something I need to fix, or if this just needs approval to run on a fork?

Also, I'd like to join the agones-discuss mailing list to access build logs - is https://groups.google.com/forum/#!forum/agones-discuss still the right link?

Is the link failing for you? Works fine for me.

@markmandel
Copy link
Copy Markdown
Member

You'll need to run make gen-install to regenerate the index.yaml - that's what the test failure is.

Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com>
@markmandel markmandel added the area/operations Installation, updating, metrics etc label Apr 12, 2026
@markmandel
Copy link
Copy Markdown
Member

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 934e0363-9492-4021-9bb7-b0e9bd2eba5a

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/4511/head:pr_4511 && git checkout pr_4511
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.58.0-dev-cff5818

@markmandel markmandel enabled auto-merge (squash) April 13, 2026 02:43
@lacroixthomas
Copy link
Copy Markdown
Collaborator

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 2debae6d-8163-453a-a546-bb7753b4983a

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/4511/head:pr_4511 && git checkout pr_4511
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.58.0-dev-6f7ced5

@markmandel markmandel merged commit dde9dab into agones-dev:main Apr 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/operations Installation, updating, metrics etc kind/bug These are bugs. size/M size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agones helm chart creates PDB manifest that does not properly match the PDB schema

5 participants