Skip to content

Conversation

@elevran
Copy link
Contributor

@elevran elevran commented Dec 4, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:
Allows definition of command line flags in declarative and centralized manner.
Previously split between cmd/epp/runner/runner.go and pkg/epp/server/runserver.go and handling of deprecation was manual.

Which issue(s) this PR fixes:
Fixes #1932

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Etai Lev Ran <elevran@gmail.com>
Signed-off-by: Etai Lev Ran <elevran@gmail.com>
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Dec 4, 2025
@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit f4b8637
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/69319671e9fa1b00087d6abb
😎 Deploy Preview https://deploy-preview-1947--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: elevran
Once this PR has been reviewed and has the lgtm label, please assign kfswain for approval. For more information see the Code Review Process.

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

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 4, 2025
@elevran
Copy link
Contributor Author

elevran commented Dec 4, 2025

/cc @ahg-g @kfswain @nirrozenbaum for early feedback. See #1932 for some additional context.
Is this reasonable (need and approach)?

If so, follow up commits on this PR (or I can split into smaller for easier review) can

  • optionally move options.go to pkg/common and leave only cli_flags.go in pkg/epp?
  • remove flag definitions and defaults (assuming no cut-n-paste errors on my end) from runner and runserver
  • runner.go to use pass []flags to options.AddFlags instead of creating flags directly
  • remove functions that are no longer needed (e.g., checking deprecated in runner, setting defaults from command line in datalayer/metrics, etc.)


// GetStringFlagValue retrieves the current value (default or set) of a string flag
// by name from the specified FlagSet (or flag.CommandLine if nil).
func GetStringFlagValue(fs *flag.FlagSet, name string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use generics here and have only one function?

That will also cover integers and other types....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's certainly possible and would genralize and simplify the code somewhat.
Wanted to keep initial code simpler as mostly looking for feedback on whether this is useful before investing more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. 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.

Simplify CLI option handling

3 participants