Skip to content

feat(autoscaler)!: Remove caBundle requirement for HTTPS URLs#4332

Merged
lacroixthomas merged 2 commits intoagones-dev:mainfrom
markmandel:feature/trusted-certs
Nov 19, 2025
Merged

feat(autoscaler)!: Remove caBundle requirement for HTTPS URLs#4332
lacroixthomas merged 2 commits intoagones-dev:mainfrom
markmandel:feature/trusted-certs

Conversation

@markmandel
Copy link
Copy Markdown
Collaborator

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix
/kind release

What this PR does / Why we need it:

BREAKING CHANGE: HTTPS webhook and WASM URLs no longer require caBundle when configured. The impact of this is that HTTPS URLs for a webhook or wasm package that are served via a trusted certificate authority will be processed successfully. This is particularly important for Wasm based autoscaling, as WASM packages will likely be served from Cloud storage providers, via HTTPS which is not controlled by the end user.

The caBundle field is now only required for URLs using custom or self-signed certificates, as they will fail when being called from the Fleet Autoscaler.

This simplifies configuration for standard HTTPS endpoints while maintaining security for custom certificate scenarios.

Changes:

  • Updated URL validation logic to allow HTTPS without caBundle
  • Modified HTTP client to be stored per Fleet Autoscaler, allowing for a custom http client per Fleet Autoscaler
  • Updated tests to verify new behavior
  • Adjusted validation error messages

Which issue(s) this PR fixes:

Work on #4080

Special notes for your reviewer:

This will also make things easier if people want to host webhooks on a functions as a service, or serverless platform for ease of use -- since they often won't control the certificates in those environments.

BREAKING CHANGE: HTTPS webhook and WASM URLs no longer require caBundle
when configured. The impact of this is that HTTPS URLs for a webhook
or wasm package that are served via a trusted certificate authority
will be processed successfully. This is particularly important for
Wasm based autoscaling, as WASM packages will likely be served from
Cloud storage providers, via HTTPS which is not controlled by the end
user.

The caBundle field is now only required for URLs using custom or
self-signed certificates, as they will fail when being called from
the Fleet Autoscaler.

This simplifies configuration for standard HTTPS endpoints
while maintaining security for custom certificate scenarios.

Changes:
- Updated URL validation logic to allow HTTPS without caBundle
- Modified HTTP client to be stored per Fleet Autoscaler,
  allowing for a custom http client per Fleet Autoscaler.
- Updated tests to verify new behavior
- Adjusted validation error messages
@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/breaking Breaking change labels Nov 12, 2025
@github-actions github-actions bot added kind/feature New features for Agones size/M labels Nov 12, 2025
@markmandel markmandel added the area/operations Installation, updating, metrics etc label Nov 12, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a breaking change to remove the requirement for caBundle when using HTTPS URLs in Fleet Autoscaler webhook and WASM configurations. It allows HTTPS URLs to use system-trusted certificate authorities while maintaining the option to provide custom certificates via caBundle for self-signed or custom certificates.

  • Removed validation requiring caBundle for HTTPS URLs
  • Modified HTTP client to be stored per Fleet Autoscaler instance with appropriate TLS configuration
  • Updated buildURLFromConfiguration to handle both trusted and custom certificate scenarios

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/apis/autoscaling/v1/fleetautoscaler.go Removed validation that required CABundle for HTTPS URLs
pkg/apis/autoscaling/v1/fleetautoscaler_test.go Updated test to expect no validation errors for HTTPS without caBundle
pkg/fleetautoscalers/fleetautoscalers.go Refactored to store HTTP client per Fleet Autoscaler, moved TLS configuration setup, and updated function signatures
pkg/fleetautoscalers/fleetautoscalers_test.go Added comprehensive tests for URL configuration building with various scenarios
pkg/fleetautoscalers/controller.go Added httpClient field to fasState and cleanup logic for idle connections

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 220 to 223
scheme := "http"
if w.CABundle != nil {
scheme = "https"

if err := setCABundle(w.CABundle); err != nil {
return nil, err
}
}
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The scheme variable is only used for Service configurations (line 250) but not for URL configurations. When a URL is provided (lines 225-231), it's parsed directly using url.ParseRequestURI(*w.URL), which preserves the URL's original scheme. This makes lines 220-223 misleading, as they suggest the scheme depends on CABundle presence, but this only applies to Service configurations, not URLs.

Consider moving the scheme determination to the Service configuration block (after line 232) to make it clear it only applies to Service configurations, or add a comment explaining this distinction.

Copilot uses AI. Check for mistakes.
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 0826182b-ff14-4034-af99-5be46ecc6c44

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/4332/head:pr_4332 && git checkout pr_4332
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.54.0-dev-e030347

@lacroixthomas
Copy link
Copy Markdown
Collaborator

Looks all good ! 👌🏼

@lacroixthomas lacroixthomas enabled auto-merge (squash) November 19, 2025 21:52
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 168edc25-6249-4c31-8f24-8fe3357be382

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/4332/head:pr_4332 && git checkout pr_4332
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.54.0-dev-4564ab3

@lacroixthomas lacroixthomas merged commit 5c5d373 into agones-dev:main Nov 19, 2025
4 checks passed
@markmandel markmandel deleted the feature/trusted-certs branch November 22, 2025 23:46
mnthe pushed a commit to mnthe/agones that referenced this pull request Mar 23, 2026
…-dev#4332)

BREAKING CHANGE: HTTPS webhook and WASM URLs no longer require caBundle
when configured. The impact of this is that HTTPS URLs for a webhook
or wasm package that are served via a trusted certificate authority
will be processed successfully. This is particularly important for
Wasm based autoscaling, as WASM packages will likely be served from
Cloud storage providers, via HTTPS which is not controlled by the end
user.

The caBundle field is now only required for URLs using custom or
self-signed certificates, as they will fail when being called from
the Fleet Autoscaler.

This simplifies configuration for standard HTTPS endpoints
while maintaining security for custom certificate scenarios.

Changes:
- Updated URL validation logic to allow HTTPS without caBundle
- Modified HTTP client to be stored per Fleet Autoscaler,
  allowing for a custom http client per Fleet Autoscaler.
- Updated tests to verify new behavior
- Adjusted validation error messages

Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>
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 area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/breaking Breaking change kind/feature New features for Agones size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants