Skip to content
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

Optimize package organization to reduce antctl binary size #6037

Merged
merged 1 commit into from
Mar 29, 2024

Commits on Mar 28, 2024

  1. Optimize package organization to reduce antctl binary size

    As a client, antctl needs to know some well-known resource names and
    the structs of the API responses. However, the code placement makes
    antctl import a lot of packages which are supposed to be consumed by
    server side code, e.g.  antrea-controller, antrea-agent.
    
    This patch refactors relevant packages, extracts well-known resources
    names and API structs to separate common packages, mostly apis packages.
    It reduces antctl binary size by 10MB, from 55MB to 45MB. The placement
    also makes it more explicit that these constants and structs are API
    related and should be changed more carefully.
    
    The major changes are as follows:
    1. Move well-known CRD resource names to types.go files which declare
       these CRD structs.
    2. Move other well-known resource names to package pkg/apis.
    3. Move structs of API responses to package apis of components which
       provide the corresponding APIs.
    
    Signed-off-by: Quan Tian <[email protected]>
    tnqn committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    4078c98 View commit details
    Browse the repository at this point in the history