This PR intends to move the loader api to
internal. Only the necessary methods which
are needed for the api have been put into
`pkg/loader.go`.
Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
This PR is an effort towards internalizing public APIs.
It moves some of the builtinconstants to internal/
Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
* Add accumulateResources error tests for local files.
Add tests demonstrating accumulateResources errors when the resource is
a local file. Works to address #4807.
* Improve readability
This change provides a common test util for a mutation tracker stub.
This is intended to reduce the duplicated boilerplate as additional
filters implement the TrackableFilter interface.
* Move api/filesys to kyaml/filesys
* Add deprecated version of api/filesys with aliases to new code
* Use new kyaml/filesys package and update dependencies
* Migrate to kyaml/filesys and update dependencies
* Skip tests that break on Windows
On MacOS /var is a symlink for /private/var and we can end up having the
loader having a /private/var path while the TMPDIR has a /var path which
triggers a panic.
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
* Make fsNode handle correctly consecutive reads and writes
* Check for directories in ReadFile and add some error checks
* Update comment
* Improved docs and added better test
* Move test into its own file protected by built constraint
* Use manual test since iotest.TestReader is only available in Go 1.16
The apimachinery code path, in its final marshalling
for output, calls Marshall
https://github.com/go-yaml/yaml/blob/v2/yaml.go#L199
This code path (via apimachinery Unstructured types)
has no JSON schema tags
https://yaml.org/spec/1.2/spec.html#id2803311
so it adds quotes to values that smell like
booleans and ints (e.g. `false` becomes `"false"`).
The kyaml code path, OTOH, uses such tags,
so generally does not quote ints and booleans.
This PR isolates this difference in behavior to
one set of tests (using data fields in configmaps
in api/krusty/configmaps_test.go) so that
they don't confuse other tests that cover
completely different behaviors.
This PR
- defines a patch conflict detector interface,
- extracts implementations of the interface from the
merginator code, making the merginator code
independent of --enable_kyaml.
- injects those implementations into kustomize
as a function of --enable_kyaml.
So, instead of using different merginators to combine
resmaps, this pr allows the use of a single patch merge
code path that uses different conflict detectors.
So instead of debating how to merge, we're now only
considering whether to warn on conflict detection
in one transformer.
This PR is in service of #3304, eliminating seven
instances where --enable_kyaml was consulted. These
were cases where conflict detection wasn't an issue
(but merging patches was).