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

Make ordering configurable #4019

Merged

Commits on Dec 2, 2022

  1. api: Add new types for customizeable resource ordering

    Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    76ee60d View commit details
    Browse the repository at this point in the history
  2. plugins: Implement SortOrderTransformer plugin

    Implement the SortOrderTransformer plugin. This plugin allows the user
    to customize the order that kustomize will output resources in.
    
    The API for the plugin is the following:
    
    sortOptions:
      order: legacy | fifo
      legacySortOptions:
        orderFirst:
        - {GVK}
        orderLast:
        - {GVK}
    
    Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    1b2fd3c View commit details
    Browse the repository at this point in the history
  3. plugins: Add boilerplate and generate code for new SortOrderTransformer

    Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    8e0fc12 View commit details
    Browse the repository at this point in the history
  4. build: Add option to denote if the reorder flag was set by the user

    We want to take different actions if the reorder flag was set by the
    user or filled by the default value. Thus, we propagate this information
    from build to the krusty options.
    
    Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    88f80cd View commit details
    Browse the repository at this point in the history
  5. api/krusty: Ensure sort ordering works with CLI flag and kustomization

    Sort order can be defined in two places:
    - (new) kustomization file
    - (old) CLI flag
    We want the kustomization file to take precedence over the CLI flag.
    
    Eventually, we may want to move away from having a CLI flag altogether:
    kubernetes-sigs#3947
    
    Case 1: Sort order set in kustomization file AND in CLI flag.
    Print a warning and let the kustomization file take precedence.
    
    Case 2: Sort order set in CLI flag only or not at all.
    Follow the CLI flag (defaults to legacy) and reorder at the end.
    
    Case 3: Sort order set in kustomization file only.
    Simply build the kustomization.
    
    Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    6143039 View commit details
    Browse the repository at this point in the history
  6. krusty: Add e2e test for SortOrderTransformer

    Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    202768f View commit details
    Browse the repository at this point in the history
  7. plugins: Purge LegacyOrderTransformer

    Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    a05b8fb View commit details
    Browse the repository at this point in the history
  8. Update go.work.sum

    Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    4e0cb79 View commit details
    Browse the repository at this point in the history
  9. review: Make review changes

    Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com>
    yanniszark committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    e581778 View commit details
    Browse the repository at this point in the history