-
Notifications
You must be signed in to change notification settings - Fork 97
feat(conversion): enable best-effort output and silence usage on errors #263
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Cna59 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 |
|
|
|
Welcome @Cna59! |
|
Hi @Cna59. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
f444c88 to
7d35cb9
Compare
| } | ||
|
|
||
| gatewayResources, notificationTablesMap, err := i2gw.ToGatewayAPIResources(cmd.Context(), pr.namespaceFilter, pr.inputFile, pr.providers, pr.getProviderSpecificFlags()) | ||
| if err != nil { |
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.
This enables best-effort conversion and allows users to see what could be converted
| // Convert plain ingress resources to gateway resources, ignoring all | ||
| // provider-specific features. | ||
| ir, errs := common.ToIR(ingressList, storage.ServicePorts, c.implementationSpecificOptions) | ||
| if len(errs) > 0 { |
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.
This enables best-effort conversion and allows users to see what could be converted
Etc..
|
If you do not want the "best-effort" output i can recreate a pull request with only the "silence usage on errors" |
|
Tested and it's work's usefull to be able to have an output even if there is "error" ! |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR improves the error handling behavior of the
ingress2gateway printcommand to support best-effort conversion:--outputformat flag.Previously, when encountering errors (e.g., unsupported
ImplementationSpecificpathType), the command would:After this change, the command:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: Yes
Testing
To test this PR, use the following command with a file containing both valid and invalid resources:
Test Input (best-effort-input.yaml)
Expected Output
The command should output valid converted Gateway and HTTPRoute resources in YAML format, followed by error messages: