Commit Graph

64 Commits

Author SHA1 Message Date
Katrina Verey
71bf0d5d14 Update full linter list and enable some easily resolved new ones 2022-03-31 11:37:26 -04:00
Sam Dowell
e3160373f0 test: add testutil for mutation tracker
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.
2022-01-28 21:25:34 +00:00
Natasha Sarkar
91f74e8d16 replace Resource.options with annotations (#4061) 2021-07-23 18:19:05 -07:00
Francesc Campoy
7fae7d1bd6 Move api/filesys to kyaml/filesys (#3997)
* 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
2021-06-16 11:42:00 -07:00
Jeff Regan
9557888b32 Merge pull request #3889 from sylr/fix-tests-macos
Fix api tests on MacOS
2021-05-13 15:22:18 -07:00
Sylvain Rabot
a8dacdaffc Fix api tests on MacOS
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>
2021-05-11 20:02:56 +02:00
monopole
01ddeb476d Introduce resmap.ApplyFilter. 2021-05-10 20:47:57 -07:00
monopole
c8dddac5b9 Move resid package from api to kyaml 2021-04-30 20:39:32 -07:00
Jeff Regan
8ef9f75de7 Merge pull request #3839 from monopole/harnessMkDir
Add testharness mkdir function.
2021-04-23 11:10:22 -07:00
monopole
cf3a125940 Add testharness mkdir function. 2021-04-23 11:09:34 -07:00
Francesc Campoy
225bae8491 Make fsNode handle correctly consecutive reads and writes (#3820)
* 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
2021-04-22 16:50:01 -07:00
monopole
240cda089a Add flag --enable-helm 2021-04-12 13:40:21 -07:00
Jeff Regan
aeba50488b Merge pull request #3792 from monopole/nits
Fix nits, add internal GetRoot func.
2021-04-12 07:53:00 -07:00
monopole
9c43518a15 Fix nits, add internal GetRoot func. 2021-04-12 07:51:01 -07:00
monopole
3af1ae4159 Enhance test harness. 2021-04-11 18:14:30 -07:00
Katrina Verey
3255c73c71 Loader FS and empty env fix 2021-03-24 18:44:29 -07:00
Katrina Verey
e77c284924 Do no require exec/go plugin home to use fn plugins 2021-03-23 10:47:16 -07:00
monopole
6f6d41f17f Remove dead merge conflict code. 2021-03-17 06:35:30 -07:00
monopole
b553997447 Make more high level build methods public. 2021-02-12 10:58:20 -08:00
Kubernetes Prow Robot
4345cd2ade Merge pull request #3534 from KnVerey/starlark_genformer
Fix function/exec transformer plugin ability to add/remove resources
2021-02-04 19:54:51 -08:00
Katrina Verey
f927cf0b8e Regression test for inability to add resources in function-based transfomer 2021-02-04 13:01:09 -08:00
Natasha Sarkar
f71854a0c8 Refactored resource to store all previous names and namespaces 2021-02-03 12:01:09 -08:00
monopole
2cb972de3b Rename id annotations to build annotations. 2021-01-15 06:43:13 -08:00
monopole
bb41d018b5 Add more tests and explain some strange quotes. 2021-01-13 15:49:12 -08:00
Natasha Sarkar
bd4580d73a Manage name changes (prefix/suffix) via YAML annotations rather than via in-memory-only fields. 2021-01-11 13:08:45 -08:00
jregan
1426137883 Isolate scalar quoting oddities to one test set.
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.
2020-12-23 17:08:25 -08:00
jregan
c32a809dbd Fix formatting nit with enableKyaml 2020-12-17 11:21:46 -08:00
jregan
f66e5bb923 Extract conflict detection to it's own interface.
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).
2020-12-06 08:38:45 -08:00
jregan
a5f3d5c823 Use DepProvider in tests to access kyaml impls. 2020-11-21 14:49:44 -08:00
jregan
f051acb83c Clean up option construction. 2020-08-23 12:06:48 -07:00
jregan
1d91401772 Simplify use of the Merginator. 2020-08-22 08:07:57 -07:00
Donny Xia
af057a95c5 Refactor refvartransformer with kyaml 2020-07-24 13:23:35 -07:00
jregan
33e68c0f97 Removing YAMLSupport==false code path.
This continues work on the master and v3.8.* branches
to eliminate apimachinery dependence.
2020-07-10 19:06:26 -07:00
Kubernetes Prow Robot
cedcf3ac04 Merge pull request #2168 from pgpx/feature-kustomizationpatch
Implement "kind: Component" to support composition
2020-06-03 10:32:11 -07:00
Paul Martin
93b0b1b0b1 Refactored Compontent tests to be table-driven 2020-05-28 23:02:32 +01:00
jregan
b4f9e9ae56 Make plugin utils package. 2020-05-22 18:17:36 -07:00
jregan
2c615d78a2 Remove static cling in plugin development flow. 2020-04-20 08:29:01 -07:00
jregan
1653a70693 Plugin loader improvements. 2020-04-18 18:29:10 -07:00
Morten Torkildsen
cabaccb9fd Better support for testing tranformers with kyaml support 2020-04-02 17:00:34 -07:00
Jeffrey Regan
2be48ca96a Function to set labels. 2020-03-27 17:53:28 -07:00
Jeffrey Regan
caa71a73fe Get rid of the fake loader. 2019-12-05 10:50:42 -08:00
Jeffrey Regan
e9ab3da164 Fix some nits in the crawler and elsewhere. 2019-12-03 10:44:44 -08:00
Jeff Regan
fd5db20a48 Update harness.go 2019-12-02 18:47:07 -08:00
Jeffrey Regan
861c86a70a Simplify plugin tests. 2019-12-02 17:12:59 -08:00
Jeffrey Regan
382c330f5b Consolidate test harness to one package. 2019-12-02 12:29:10 -08:00
jregan
1f85ce454d More tests/examples. 2019-11-30 11:32:08 -08:00
jregan
d98af3f06a Add PrintPluginEnv plugin. 2019-11-30 09:58:11 -08:00
jregan
038c070626 Simplify and document plugin test harness. 2019-11-29 07:30:42 -08:00
jregan
02c0c2692f Make repo more relocatable on developer's workstation. 2019-11-11 08:03:58 -08:00
jregan
41a8bd208d Remove more k8sdeps from external API. 2019-11-06 20:43:26 -08:00