-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Does the order in which the patches are defined matter? #727
Comments
@sheldonkwok The patches are not applied in order. If there are several patches for the same object and one of the patch need to be applied last, this can be achieved by organizing the patches into different base/overlays. The patch to be applied last is put in an overlay while other patches are put in a base. |
Thank you! |
FWIW, order now maintained within particular kustomizations - so it could matter. |
What disadvantage(s) would applying the patches in order have? The scenario I am trying to implement is:
If the patches are applied in a "random" order, the second patch would fail if applied prior to #1. |
There are two notions of ordering. First, there's an implicit ordering in a depth-first traversal of overlays and bases. A base is always "inflated" before being considered in an overlay, so patches at the bottom are applied first. This is what one would expect. Second, in a given kustomization file, there are list fields describing patches
For the latter two fields, it's simple: In the case of If there are multiple patches targeting a deployment named Bob in one kust file, they are applied to each other, in the given order (i.e. patch 1 is applied to patch 0, then patch 2 is applied to the result of that, etc.), before being applied to the target as one patch. Order matters, because, for example, one patch could insert into a pod's container list, while another patch could replace the pod's container list. |
I'm trying to create an overrides patch to be applied last. It works a majority of the time but sometimes fails. This is leading me to believe that patches are not applied in order.
The text was updated successfully, but these errors were encountered: