Commit Graph

67 Commits

Author SHA1 Message Date
jregan
3af5a8afea Make resource, resmap public. 2019-10-20 10:51:20 -07:00
Jeffrey Regan
e5c8b5ec8f Start api directory, which will become a module. 2019-10-17 14:01:20 -07:00
jregan
07d2500ee3 Make types package public. 2019-10-16 16:41:43 -07:00
Jeffrey Regan
4e9d42fae7 Move kv loader code to public package. 2019-10-15 16:52:03 -07:00
Jeffrey Regan
41a008e9a3 Start pluglib, a set of public, plugin specific functions. 2019-10-14 19:43:55 -07:00
Jeffrey Regan
baa0296a12 Reduce size of pgmconfig package 2019-10-03 18:22:05 -07:00
Nicolas Lamirault
334a64676f Fix: documentation link for plugins
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
2019-09-27 09:22:35 +02:00
Richard Marshall
ac9424fa3e tests: Add unit tests for update resource options 2019-09-26 08:41:41 -07:00
Richard Marshall
79fbe7c4cc Support resource generator options in exec plugins 2019-09-26 08:41:41 -07:00
jregan
2050afdeb4 Ease doing custom configuration of builtin plugins. 2019-09-13 14:45:36 -07:00
jregan
bc303c4629 in plugin executor remove unnecessary code and improve error messages 2019-08-19 20:23:07 -07:00
Ace Eldeib
c2cc93a009 fix: tempfile(?) 2019-07-19 17:38:24 -07:00
Ace Eldeib
af29855802 fix: windows builds 2019-07-19 12:58:06 -07:00
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