No Test for Configuration more specific than default #4811
Labels
kind/test-coverage
Categorizes issue or PR as related to a gap in or problem with our test coverage.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
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:configurations
are covered by default configurations, but more specific than defaultAccording 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
orapi/krusty
that follows a similar setup in #4722.A few comments, say above
MergeConfig()
, thesortFields()
call, and thesortFields()
definition, to explain their purpose would also be very helpful.The text was updated successfully, but these errors were encountered: