Skip to content

Feature/gce infra#336

Merged
k8s-ci-robot merged 8 commits intokubernetes-sigs:mainfrom
chakravardhan:feature/gce-infra
Feb 19, 2026
Merged

Feature/gce infra#336
k8s-ci-robot merged 8 commits intokubernetes-sigs:mainfrom
chakravardhan:feature/gce-infra

Conversation

@chakravardhan
Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds support for a new provider-specific flag --gce-gateway-class-name to the GCE emitter.

Currently, the GCE provider defaults to standard GatewayClasses (e.g., gke-l7-global-external-managed or gke-l7-rilb) based on the input Ingress class. This change allows users to override the GatewayClassName field in all generated Gateways when using the gce emitter, which is useful for migration testing or custom Gateway deployments.

If the flag is unset, the emitter preserves the default classes determined by the provider.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Added `--gce-gateway-class-name` flag to GCE emitter to allow overriding the output GatewayClassName.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 5, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 5, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @chakravardhan. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 5, 2026
Comment thread pkg/i2gw/emitter.go Outdated

type EmitterConf struct {
// TODO: add fields as needed.
ProviderSpecificFlags map[string]map[string]string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I realize that a lot of the flags weren't built with emitters in mind, but is there any way to not have ProviderSpecificFlags in the Emitter configuration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

otherwise this PR lgtm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've completely removed ProviderSpecificFlags from the EmitterConf.

To solve the --gce-gateway-class-name issue, I moved the flag registration from the GCE Emitter to the GCE Provider. The provider now extracts this flag directly from its own configuration (ProviderConf) and applies the GatewayClass override into the Intermediate Representation (IR) during the initial convertToIR translation phase instead.

This keeps the Emitters perfectly clean and completely agnostic of any provider-specific CLI flags

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 5, 2026
@chakravardhan chakravardhan force-pushed the feature/gce-infra branch 2 times, most recently from 0f71686 to a6c5cb0 Compare February 5, 2026 20:20
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 6, 2026
Comment thread pkg/i2gw/providers/gce/ir_converter.go Outdated
var gatewayClassName string
if c.conf != nil && c.conf.ProviderSpecificFlags != nil {
if flags, ok := c.conf.ProviderSpecificFlags["gce"]; ok {
if val, ok := flags[GatewayClassNameFlag]; ok && val != "" {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So if no value is supplied for the flag it will be a no-op?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with Beka, can we do some validation here to make sure that the flag value is valid?

If the value is non-nil, it should be one of the valid class names here: https://docs.cloud.google.com/kubernetes-engine/docs/how-to/gatewayclass-capabilities (not an empty string either).

I'm not totally sure if we should be doing validation further up the stack for ProviderSpecificFlags, but it doesn't look like any other provider is doing that right now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, Added a validation logic in ir_converter.go right where we first extract the flag payload from the ProviderSpecificFlags map.

Comment thread pkg/i2gw/providers/gce/utils.go
Comment thread pkg/i2gw/providers/gce/ir_converter.go Outdated
var gatewayClassName string
if c.conf != nil && c.conf.ProviderSpecificFlags != nil {
if flags, ok := c.conf.ProviderSpecificFlags["gce"]; ok {
if val, ok := flags[GatewayClassNameFlag]; ok && val != "" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with Beka, can we do some validation here to make sure that the flag value is valid?

If the value is non-nil, it should be one of the valid class names here: https://docs.cloud.google.com/kubernetes-engine/docs/how-to/gatewayclass-capabilities (not an empty string either).

I'm not totally sure if we should be doing validation further up the stack for ProviderSpecificFlags, but it doesn't look like any other provider is doing that right now.

Comment thread pkg/i2gw/providers/gce/utils.go
Comment thread pkg/i2gw/providers/gce/ir_converter.go
@spencerhance
Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 10, 2026
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2026
@spencerhance
Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2026
@chakravardhan
Copy link
Copy Markdown
Contributor Author

/lgtm

@LiorLieberman , Can I get approval on this PR? Thanks!

@Stevenjin8
Copy link
Copy Markdown
Contributor

/approve

@Stevenjin8
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 19, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bexxmodd, chakravardhan, spencerhance, Stevenjin8

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 19, 2026
@k8s-ci-robot k8s-ci-robot merged commit a5c78d8 into kubernetes-sigs:main Feb 19, 2026
4 checks passed
rajashish pushed a commit to rajashish/ingress2gateway1 that referenced this pull request Feb 23, 2026
* feat(gce): implement GatewayClassName override logic

* style: gofmt changes

* refactor: Move GatewayClassNameFlag from Emitter to Provider

* Add test case for gatewayclassname flag

* feat: Add validation for gce-gateway-class-name flag

* fix: remove duplicate validation block

* refactor: simplify gateway-class-name flag validation block

* fix(gce): fixing converter test according to upstream changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants