-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 legacy resource ordering customizable in the kustomization.yaml file #3913
Comments
I think that this new field should replace the Maybe something like this? sortOrder: {legacy,fifo} # expandable e.g. if we want to add a non-legacy option that provides semantically stable ordering but without the release order implications
legacySortOptions: # it's an error if this is present and sortOrder isn't legacy
orderFirst:
- {GVK}
orderLast:
- {GVK} Or just the latter field, and stock legacy ordering would be enabled with @yanniszark wdyt of the above? Are you interested in contributing this field? |
Hi @KnVerey, |
/assign @yanniszark |
Brought here by some problems deploying cert-manager together with some other tools using kustomize. I think this idea of having a logical default ordering, but the ability on a per-kustomization basis to describe a desired ordering based on resource type makes a lot of sense. The main reason I like it is that you can memorialize/document the need for the ordering within your data/files, rather than relying on an external side-effect registered via a CLI flag. In addition, given the existence of CustomResourceDefinitions with their own potential semantics, it's impossible for kustomize to know "everything" it needs to know. |
Extend the kustomization.yaml API with the 'sortOrder' and 'legacySortOptions' fields. Refs kubernetes-sigs#3913 Signed-off-by: Yannis Zarkadas <[email protected]>
Extend the kustomization.yaml API with the 'sortOrder' and 'legacySortOptions' fields. Refs kubernetes-sigs#3913 Signed-off-by: Yannis Zarkadas <[email protected]>
Would it make sense to consolidate it into a single top-level field with nested subfields? Instead of erroring if To that end, we could just call it
vs
Stock legacy ordering would be enabled with
@KnVerey @yanniszark WDYT? |
@natasha41575 IIUC, you are proposing this:
VS apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
sortOptions:
sortOrder: legacy
legacySortOptions:
orderFirst:
- {GVK}
orderLast:
- {GVK} TBF, the second one seems more intuitive to me. @KnVerey what do you think? |
@KnVerey please let us know your thoughts I'm happy with the latter of
It was mostly having two new top-level fields that seemed a bit cluttered to me. |
ping @KnVerey |
That LGTM. I'd suggest dropping |
+1 |
Make orderFirst and orderLast public in preparation of changes to make the resource ordering configurable. Signed-off-by: Yannis Zarkadas <[email protected]> kustomization: Extend with sortOrder and legacySortOptions fields Extend the kustomization.yaml API with the 'sortOrder' and 'legacySortOptions' fields. Refs kubernetes-sigs#3913 Signed-off-by: Yannis Zarkadas <[email protected]> plugins: Extend LegacyOrderTransformer with customizable ordering Signed-off-by: Yannis Zarkadas <[email protected]> plugins: Generate new LegacyOrderTransformer Signed-off-by: Yannis Zarkadas <[email protected]> Fix existing LegacyOrderTransformer invocations Signed-off-by: Yannis Zarkadas <[email protected]> Throw an error if legacySortOptions is set and sortOrder is not legacy Signed-off-by: Yannis Zarkadas <[email protected]> api: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> cmd/config: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> cmd/pluginator: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> kustomize: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> wip Signed-off-by: Yannis Zarkadas <[email protected]>
Make orderFirst and orderLast public in preparation of changes to make the resource ordering configurable. Signed-off-by: Yannis Zarkadas <[email protected]> kustomization: Extend with sortOrder and legacySortOptions fields Extend the kustomization.yaml API with the 'sortOrder' and 'legacySortOptions' fields. Refs kubernetes-sigs#3913 Signed-off-by: Yannis Zarkadas <[email protected]> plugins: Extend LegacyOrderTransformer with customizable ordering Signed-off-by: Yannis Zarkadas <[email protected]> plugins: Generate new LegacyOrderTransformer Signed-off-by: Yannis Zarkadas <[email protected]> Fix existing LegacyOrderTransformer invocations Signed-off-by: Yannis Zarkadas <[email protected]> Throw an error if legacySortOptions is set and sortOrder is not legacy Signed-off-by: Yannis Zarkadas <[email protected]> api: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> cmd/config: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> cmd/pluginator: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> kustomize: Updated dep files after running tests Signed-off-by: Yannis Zarkadas <[email protected]> wip Signed-off-by: Yannis Zarkadas <[email protected]>
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
#4019 is back in active development and getting really close now /remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
Kustomize has a new field called "sortOptions" to sort resources: kubernetes-sigs/kustomize#3913 kubernetes-sigs/kustomize#4019 Document what it does and how to use it. Signed-off-by: Yannis Zarkadas <[email protected]>
Kustomize has a new field called "sortOptions" to sort resources: kubernetes-sigs/kustomize#3913 kubernetes-sigs/kustomize#4019 Document what it does and how to use it. Signed-off-by: Yannis Zarkadas <[email protected]>
Kustomize has a new field called "sortOptions" to sort resources: kubernetes-sigs/kustomize#3913 kubernetes-sigs/kustomize#4019 Document what it does and how to use it. Signed-off-by: Yannis Zarkadas <[email protected]>
Kustomize has a new field called "sortOptions" to sort resources: kubernetes-sigs/kustomize#3913 kubernetes-sigs/kustomize#4019 Document what it does and how to use it. Signed-off-by: Yannis Zarkadas <[email protected]>
Kustomize has a new field called "sortOptions" to sort resources: kubernetes-sigs/kustomize#3913 kubernetes-sigs/kustomize#4019 Document what it does and how to use it. Signed-off-by: Yannis Zarkadas <[email protected]>
Is your feature request related to a problem? Please describe.
Related issue: #3794
TLDR:
kustomization.yaml
file, as described in Kustomize resource ordering regression #3794 (comment)Describe the solution you'd like
Make resource ordering configurable via the
kustomization.yaml
file.The sorter accepts the
orderFirst
andorderLast
arguments, to know which resources to order first and last.Then we need to decide what to call the new field for the sorter in the
kustomization.yaml
file.cc @monopole
The text was updated successfully, but these errors were encountered: