Commit Graph

54 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
7872405379 Merge pull request #1336 from richardmarshall/fix_test_flags
Remove go testing flags from kustomize help
2019-07-15 13:13:24 -07:00
Jingfang Liu
31ab347da2 refactor the strategic merge patch transformer toward moving it to a plugin (#1340) 2019-07-11 10:22:56 -07:00
Richard Marshall
095333ffb1 Update references to NewEnvForTest 2019-07-10 20:43:50 -07:00
Richard Marshall
0d8d9e2f2b Move plugin EnvForTest manager into new package
Move the EnvForTest manager into an independent package that is not
imported by any non-test code. Previously this code was directly
embedded in the plugins package resulting in testing flags being exposed
in the main kustomize binary.
2019-07-10 17:16:05 -07:00
jregan
cc0fffc67b Fix some random Go nits. 2019-06-25 20:46:56 -07:00
Seth Pollack
9cc2c90a4b allow reuse of plugins 2019-06-24 21:09:13 -04:00
jregan
19c8e23425 Hack for local testing of isolated plugins. 2019-06-23 18:04:20 -07:00
jregan
a7df00c07a Starting v3 release for plugin developers.
[doc]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher

Per this Go modules [doc] a repo or branch that's
already tagged v2 or higher should increment the major
version (e.g. go to v3) when releasing their first Go
module-based packages.

At the moment, the kustomize repo has these top level
packages in the sigs.k8s.io/kustomize module:

 - `cmd` - holds main program for kustomize

	 Conceivably someone can depend on this
	 package for integration tests.

 - `internal` - intentionally unreleased subpackages

 - `k8sdeps` - an adapter wrapping k8s dependencies

	 This exists only for use in pre-Go-modules kustomize-into-kubectl
	 integration and won't live much longer (as everything involved is
	 switching to Go modules).

 - `pkg` - kustomize packages for export

	 This should shrink in later versions, since
	 the surface area is too large, containing
	 sub-packages that should be in 'internal'.

 - `plugin` - holds main programs for plugins

This PR changes the top level go.mod file from

```
module sigs.k8s.io/kustomize
```

to

```
module sigs.k8s.io/kustomize/v3
```

and adjusts all import statements to
reflect the change.
2019-06-23 15:05:59 -07:00
Ian Howell
b8423d0f5f Fixed unit test failures when GOROOT was unset 2019-06-20 16:37:20 -05:00
Jeffrey Regan
3a01a63a01 Simplify code base.
- In ResMap, drop concept of internal Id to Resource
   map.  The ResMap is now (just) a list, allowing only
   very particular edits.

 - Resources should now be maintained in the order
   loaded.  A later PR can adjust tests to remove the
   internal legacy sorting, and confirm order-out is
   predictable from order-in.  The PR would suppress
   the sort in tests, and reorder the output to make
   all tests pass again, and confirm that the new order
   matched depth-first input traversal.  The FromMap
   fixture function was removed from all test inputs to
   establish a predictable input order.

 - Resources now have two 'Ids', OriginalId and
   CurrentId.  The former is fixed as
   GVK-name-namespace at load time, the latter changes
   during transformations.  The latter can be used to
   narrow name references when the former maps to
   multiple resources.  We allow bases to be loaded
   more than once in a build (a diamond pattern), so
   the OriginalId is not unique across the resources
   set.  The CurrentId is (and must be) unique, but is
   constantly mutating.  Failing to make this
   distinction clear, and attempting to maintain a
   mapping from a single mutating Id to a resource was
   making the code too complex.

 - Drop prefix/suffix from ResId - the ResId is now
   immutable.  A later PR can remove the distinction
   with ItemId.

 - This PR increases coverage of ResMap is since this
   is a large refactor.  Higher level tests didn't need
   much change outside reordering of results at the
   resource level.
2019-06-17 10:50:45 -07:00
Jeffrey Regan
0fa2d9c32c Add --reorder flag. 2019-06-11 12:52:53 -07:00
Jeffrey Regan
6d309b52a5 Introduce stacked transformers. 2019-06-07 16:16:58 -07:00
Jeffrey Regan
449175e3a6 Add a sorting plugin. 2019-06-07 15:06:12 -07:00
Jeffrey Regan
c63ebbdfc4 Preserve order when merging. 2019-06-06 20:01:39 -07:00
Jeffrey Regan
4162dbc2d8 Maintain resources in order loaded. 2019-06-06 15:55:57 -07:00
Jingfang Liu
b4dbac1b84 add validation transformer 2019-05-30 10:10:16 -07:00
jregan
47c965481f Reduce k8ds deps 2019-05-27 15:37:03 -07:00
Jeffrey Regan
6a10654618 Delete the KV plugin code. 2019-05-24 16:49:16 -07:00
jregan
5653ae69e4 One plugin per dir. 2019-05-19 17:32:02 -07:00
Jeffrey Regan
3a85fcd365 Simplify some of the plugin testing code. 2019-05-17 16:13:55 -07:00
Jeffrey Regan
5614649d14 Standalone service generator test 2019-05-13 12:30:51 -07:00
Jeffrey Regan
2e71a3b862 Convert plugins to accept bytes instead of unstruct. 2019-05-12 12:58:56 -07:00
jregan
4df576869f Add SedTransformerTest 2019-05-12 11:32:33 -07:00
Jingfang Liu
61d46c26b8 fix the boilerplate copyright header (#1064) 2019-05-10 10:20:20 -07:00
Kubernetes Prow Robot
e29261033f Merge pull request #1048 from Liujingfang1/transformer
fix the bug for setting annotations when triggering transformers
2019-05-07 17:14:34 -07:00
Jingfang Liu
9390860288 fix the bug for setting annotations when triggering transformers 2019-05-07 16:54:20 -07:00
Jeff Regan
c6764ab31f Merge pull request #1047 from monopole/pluginTests
Add test for builtin secretgenerator plugin.
2019-05-07 16:34:17 -07:00
Jeffrey Regan
2825888ffd Add test for builtin secretgenerator plugin. 2019-05-07 16:16:07 -07:00
Kubernetes Prow Robot
34e8de3fc8 Merge pull request #1045 from Liujingfang1/transformer
pass resources to transformer plugin all together
2019-05-07 15:50:34 -07:00
Jingfang Liu
86f0f9a435 address comments 2019-05-07 15:43:36 -07:00
Jeffrey Regan
bcc7412ef2 Make kusttestharness shareable. 2019-05-07 14:23:33 -07:00
Jingfang Liu
c1e2b27c60 pass resources to transformer plugin all together 2019-05-07 13:42:28 -07:00
Jeffrey Regan
529db0493b Introduce envs field. 2019-05-06 14:35:48 -07:00
Jeff Regan
ac3ea4d6f3 Merge pull request #1014 from rohitsardesai83/replace_ghodss_yaml_with_sigsk8sio_yaml_dep
Remove dependency on ghodss/yaml
2019-04-26 09:50:51 -07:00
jregan
cfb0c5efad Make plugin dir match Go conventions. 2019-04-25 20:30:10 -07:00
rohitsardesai83
b67d713bc0 Remove dependency on ghodss/yaml 2019-04-25 23:47:01 +05:30
Jingfang Liu
fc8063f752 pass loader root to exec plugins 2019-04-24 12:09:25 -07:00
Jeffrey Regan
8991bcb399 Collect existing internal pkgs under one roof. 2019-04-23 11:53:50 -07:00
Jeffrey Regan
1545e07dd6 Add a plugin loader test. 2019-04-22 15:00:32 -07:00
jregan
76a3179868 Simplify plugin loader code.
* use one place to build plugin file names,
 * use one loader instance,
 * test for plugin enabled flag in just one place to
   avoid errors and reduce if statements,
 * don't return private objects,
 * factor goplugin loading to a method,
 * fix a related test that was commented out.
2019-04-22 10:13:40 -07:00
Jeffrey Regan
a914570240 Fix some comment nits. 2019-04-19 09:26:54 -07:00
Jeffrey Regan
2545ea1019 Helm chart generator exec plugin 2019-04-17 19:07:20 -07:00
Jingfang Liu
fb9e00bf33 add the unstructured to ENV of exec plugins 2019-04-16 13:12:42 -07:00
Jingfang Liu
f6e01cfda7 add support for exec plugins 2019-04-16 09:26:38 -07:00
Jingfang Liu
e5d730e1fe address comments 2019-04-09 15:42:08 -07:00
Jingfang Liu
ba43ecbcb7 add goplugin for exec generators and transformers 2019-04-09 13:13:21 -07:00
Kubernetes Prow Robot
ee68a9c450 Merge pull request #957 from monopole/justTheFactsMaam
Define a plugin compiler.
2019-04-08 18:33:04 -07:00
jregan
175c754f61 Define a plugin compiler. 2019-04-08 18:05:31 -07:00
jregan
ffc16d51e0 Add secret generator. 2019-04-06 18:38:22 -07:00
jregan
b32e041bfe Remove some duped code. 2019-04-06 16:14:12 -07:00