kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

No Test for Configuration more specific than default

Open annasong20 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

We document the functionality of the kustomize field configurations, but we lack test coverage and comments for the following case:

According to the documentation, in such a case, the more specific user-specified configuration should replace the more generic default and the transformer should not be applied to field specs that fall under the latter, but not the first.

See issue #4722 for reference.

FYI: We believe the code that implements the intended behavior is in accumulateTarget(). This method call appends the user-specified config to the list of configs, but then moves it to the beginning via sort. Thus, when this list of configs is merged with an empty list, the latter, more generic default config is marked as redundant and not included in the final configs here.

Describe the solution you'd like

We should have at least 1 test covering such a case. As stated above, because the code that implements this behavior is located here, the solution will probably be an integration test under kusttarget_test.go or api/krusty that follows a similar setup in #4722.

A few comments, say above MergeConfig(), the sortFields() call, and the sortFields() definition, to explain their purpose would also be very helpful.

annasong20 avatar Sep 28 '22 21:09 annasong20

/triage accepted

KnVerey avatar Sep 28 '22 21:09 KnVerey

/assign

ChristopherFry avatar Nov 23 '22 17:11 ChristopherFry

/close

Addressed by #4882.

annasong20 avatar Dec 07 '22 17:12 annasong20

@annasong20: Closing this issue.

In response to this:

/close

Addressed by #4882.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 07 '22 17:12 k8s-ci-robot