-
Notifications
You must be signed in to change notification settings - Fork 9
Deprecate ExternalHostname string in favor of External structure #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate ExternalHostname string in favor of External structure #113
Conversation
There was a problem hiding this 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 deprecates the ExternalHostname string field in the FrontProxySpec in favor of a new structured External configuration that provides more flexibility for configuring external access to front-proxy instances.
- Add new
Externalstructure with hostname, port, and optional private hostname/port fields for both FrontProxy and RootShard specs - Deprecate
ExternalHostnamefield with CEL validation to prevent simultaneous use of old and new fields - Update kubeconfig and certificate generation logic to prioritize the new External configuration
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontproxy_types.go | Adds new External field and deprecates ExternalHostname with CEL validation |
| rootshard_types.go | Extends ExternalConfig with optional PrivateHostname and PrivatePort fields |
| kubeconfig/secret.go | Updates kubeconfig generation to use new External configuration |
| frontproxy/certificates.go | Updates certificate generation to include private hostnames in DNS SANs |
| controller/kubeconfig/controller.go | Passes FrontProxy object through controller chain |
| rootshard/kubeconfigs.go | Adds support for private hostname/port in RootShard kubeconfig generation |
| Various generated files | Auto-generated code updates for new fields and deepcopy methods |
| CRD files | Updates to CustomResourceDefinition schemas for new fields |
| run-e2e-tests.sh | Adds health probe bind address configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| dnsNames = append(dnsNames, r.rootShard.Spec.External.Hostname) | ||
| if r.rootShard.Spec.External.PrivateHostname != "" { | ||
| dnsNames = append(dnsNames, r.rootShard.Spec.External.PrivateHostname) | ||
| } | ||
|
|
||
| // DEPRECATED: keep support for the deprecated ExternalHostname field for now | ||
| // to not break existing front-proxy installations. | ||
| if r.frontProxy.Spec.ExternalHostname != "" { | ||
| dnsNames = append(dnsNames, r.frontProxy.Spec.ExternalHostname) | ||
| } else { | ||
| dnsNames = append(dnsNames, r.rootShard.Spec.External.Hostname) |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic doesn't handle the new External.Hostname field. When using the new External configuration, the hostname from External.Hostname should be added to dnsNames, but this code only adds the deprecated ExternalHostname or falls back to rootShard hostname.
| dnsNames = append(dnsNames, r.rootShard.Spec.External.Hostname) | |
| if r.rootShard.Spec.External.PrivateHostname != "" { | |
| dnsNames = append(dnsNames, r.rootShard.Spec.External.PrivateHostname) | |
| } | |
| // DEPRECATED: keep support for the deprecated ExternalHostname field for now | |
| // to not break existing front-proxy installations. | |
| if r.frontProxy.Spec.ExternalHostname != "" { | |
| dnsNames = append(dnsNames, r.frontProxy.Spec.ExternalHostname) | |
| } else { | |
| dnsNames = append(dnsNames, r.rootShard.Spec.External.Hostname) | |
| if r.rootShard.Spec.External.Hostname != "" { | |
| dnsNames = append(dnsNames, r.rootShard.Spec.External.Hostname) | |
| } | |
| if r.rootShard.Spec.External.PrivateHostname != "" { | |
| dnsNames = append(dnsNames, r.rootShard.Spec.External.PrivateHostname) | |
| } | |
| // Add the new External.Hostname field from the frontProxy spec if set | |
| if r.frontProxy.Spec.External != nil && r.frontProxy.Spec.External.Hostname != "" { | |
| dnsNames = append(dnsNames, r.frontProxy.Spec.External.Hostname) | |
| } | |
| // DEPRECATED: keep support for the deprecated ExternalHostname field for now | |
| // to not break existing front-proxy installations. | |
| if r.frontProxy.Spec.ExternalHostname != "" { | |
| dnsNames = append(dnsNames, r.frontProxy.Spec.ExternalHostname) |
| // New flow: | ||
| if frontProxy.Spec.External.Hostname != "" { | ||
| serverURL = fmt.Sprintf("https://%s:%d", frontProxy.Spec.External.Hostname, frontProxy.Spec.External.Port) | ||
| } else { | ||
| // Old flow: | ||
| serverURL = fmt.Sprintf("https://%s:%d", rootShard.Spec.External.Hostname, rootShard.Spec.External.Port) | ||
| } |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing fallback to deprecated ExternalHostname field. The logic should check for the deprecated ExternalHostname when External.Hostname is empty, before falling back to rootShard configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its ok. ExternalHostname was never used here
|
/retest |
|
/retest ? |
Trying locally, as these looks like old flakes |
|
/retest |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/retest still flaky but different flaky, I guess. |
|
/retest |
1 similar comment
|
/retest |
|
/retest |
Signed-off-by: Mangirdas Judeikis <[email protected]> On-behalf-of: SAP <[email protected]>
76fcccf to
d0d2a7c
Compare
|
/retest |
d0d2a7c to
b14dbd3
Compare
embik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
|
LGTM label has been added. Git tree hash: f06199360dfe2d1c5e16b8879696e0a336073f06
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
This PR deprecates the
ExternalHostnamestring field in theFrontProxySpecin favor of a new structuredExternalconfiguration that provides more flexibility for configuring external access to front-proxy instances.Key Changes
API Changes
FrontProxySpec.ExternalHostnamefield with deprecation noticeFrontProxySpec.Externalstructure of typeExternalConfigwith the following fields:Hostname(required): External hostname for the front-proxyPort(required): External port for the front-proxyPrivateHostname(optional): Internal hostname for kcp component communicationPrivatePort(optional): Internal port for kcp component communicationRootShard.Spec.Externalwith optionalPrivateHostnameandPrivatePortfields for internal access patternsExternalHostnameand newExternal.hostnamefieldsImplementation Updates
FrontProxy.Spec.Externalconfiguration over deprecated fieldFrontProxyobject through kubeconfig controller chain for proper external configuration resolutionBackward Compatibility
The deprecated
ExternalHostnamefield is maintained for backward compatibility. Existing configurations will continue to work, but users are encouraged to migrate to the newExternalstructure.What Type of PR Is This?
/kind api-change
/kind deprecation
/kind feature
Related Issue(s)
Fixes #
Release Notes