-
Notifications
You must be signed in to change notification settings - Fork 3.2k
hubble, policy: shuffle types to reduce imports #32378
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
Conversation
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.
Hah. I had to actually force-disable that check in |
/test |
I gave up and just fixed the struct literals; we use bot |
/test |
1 similar comment
/test |
The "leaf" type pkg/hubble/api/v1 inadvertently imported pkg/policy, which has a large set of imports. This causes a few problems, most notably the hubble CLI binary to have a huge number of unnecessary imports. This also means a large set of the codebase must build on all architectures, unnecessarily to boot. So, this commit has two changes: 1. Lift the policy Key type in to its own package. Since this is referenced **everywhere**, use a type alias to keep our sanity. 2. Move the hubble EndpointInfo interface out of the API type, since it's not really relevant to the API package. This reduces the number of local imports from 196 to 57. A nice cleanup. Signed-off-by: Casey Callendrello <cdc@isovalent.com>
/test |
The "leaf" type
pkg/hubble/api/v1
inadvertently importedpkg/policy
, which has a large set of imports. This causes a few problems, most notably the hubble CLI binary to have a huge number of unnecessary imports. This also means a large set of the codebase must build on all architectures, unnecessarily to boot.So, this commit has two changes:
Lift the policy Key type in to its own package. Since this is referenced everywhere, use a type alias to keep our sanity.
Move the hubble EndpointInfo interface out of the API type, since it's not really relevant to the API package.
This reduces the number of local imports in the hubble binary from 196 to 57. A nice cleanup.