-
Notifications
You must be signed in to change notification settings - Fork 97
Read resources from multiple files #258
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: carmal891 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 |
|
Hi @carmal891. 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. |
88cd652 to
4c8175c
Compare
4c8175c to
6605bd4
Compare
6605bd4 to
b92cee2
Compare
| if len(allFiles) > 0 { | ||
| for _, inputFile := range allFiles { | ||
| fmt.Fprintf(os.Stdout, "=== File: %s ===\n", inputFile) | ||
| gatewayResources, notificationTablesMap, err := i2gw.ToGatewayAPIResources(cmd.Context(), pr.namespaceFilter, inputFile, pr.providers, pr.getProviderSpecificFlags()) |
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.
My understanding here is this implementation is that the following would be more or less equivalent (i forget the specific flag names)
i2gw print --input-file a.yaml b.yaml c.yaml
and
i2gw print --input-file a.yaml
i2gw print --input-file b.yaml
i2gw print --input-file c.yaml
I'm not super familiar with Ingress merging semantics, but could this not mean that we have duplicate resources in the output (maybe with slightly different names).
Ideally, the same set of kubernetes resources should create the same output regardless of which file each resources lives in.
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.
Thanks for highlighting this. I got your point. So duplicate resource check should happen amongst the set of yaml files when provided as a set like i2gw print --input-file a.yaml b.yaml c.yaml
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.
Its more like
i2gw print --input-file a.yaml b.yaml c.yaml
and
i2gw print --input-file <(cat a.yaml b.yaml c.yaml)
should be equivalent.
| cmd.Flags().StringSliceVar(&pr.inputPaths, "input-file", []string{}, | ||
| `Path to manifest file(s) or directory(s). When set, the tool will read ingresses from the specified files or all YAML files in directories. Supported files are yaml and json.`) | ||
|
|
||
| cmd.Flags().BoolVar(&pr.recursive, "recursive", false, |
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 one is more personal, but I think we can omit this path since users can already do -input-file manifest-dir/**/*.{yaml,yml,json}, but if this is a common enough pattern in other places I'm happy to include.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Read resources from multiple files
Which issue(s) this PR fixes:
Fixes #106
Does this PR introduce a user-facing change?: