feat(conversion): enable best-effort output and silence usage on errors#263
feat(conversion): enable best-effort output and silence usage on errors#263Cna59 wants to merge 1 commit intokubernetes-sigs:mainfrom
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. DetailsNeeds 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. DetailsInstructions 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.
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.
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" ! |
|
I'm very supportive of this. |
|
/ok-to-test |
|
@Cna59 we're in the middle of a refactor, but now that I'm a maintainer, I'll leave some more detailed thoughts Right now, we have these errors and we have some notifications. Its not clear when we should use one over another. I'm inclined to say that conversion errors should always be treated as notifications (and thus allow conversion). Would love to hear your thoughts. |
|
PR needs rebase. DetailsInstructions 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. |
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: