Commit Graph

25 Commits

Author SHA1 Message Date
jregan
78cdff6d09 Remove kv plugins from docs. 2019-05-22 21:13:45 -07:00
jregan
fe67bcdb8b Cut more ties to k8sdeps
Add tests for all the plugins.
2019-05-22 14:17:36 -07:00
Jeff Regan
f864c912ad Merge pull request #1101 from monopole/breakDeps
Break a bad dep.
2019-05-22 07:48:51 -07:00
Jeffrey Regan
b28aaae66b Break a bad dep. 2019-05-22 07:39:36 -07:00
Jeffrey Regan
79906d73d0 Add builtin namespace transformer plugin 2019-05-21 13:56:36 -07:00
Jeffrey Regan
9b6f8f0c74 Format generated code. 2019-05-21 11:35:41 -07:00
Jeffrey Regan
0df5883853 Add builtin JSON patch transformer 2019-05-20 15:38:46 -07:00
jregan
aafc23a615 Add annotation transformer. 2019-05-19 19:04:29 -07:00
jregan
45901219b7 Add builtin label transformer. 2019-05-19 18:20:18 -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
621bb7c6c5 Add builtin NameTransformer plugin. 2019-05-16 12:34:08 -07:00
Jeffrey Regan
939de0cdbe Dogfood the plugin framework.
This PR:

* provides a code generator that converts
  kustomize Go plugins to normal code, i.e.
  the plugin appears as
    t := builtin.NewImageTagTransformer()
  instead of
    p := plugin.Open("imagetagtransformer.so")
    s := p.Lookup(someSymbol)
    t, ok = s.(Transformer)

* converts the main processing thread in
  kusttarget.go to use those factory calls to run
  builtin generators and transformer before
  calling user-supplied plugins,

* as an example, provides an imagetag transformer
  plugin, converting a legacy transformer to
  builtin plugin form with its own isolated test.
  This test can be expanded by moving more code
  into it, but that can be done in a later PR.

Writing core functionality as plugins assures a
maintained plugin authoring and testing framework,
assures modularity, provides meaningful plugin
examples, and gives us a means to make informed
choices on which kustomize packages to publish
(and which to move to internal/).  The code
generator allows all this without losing "go get
sigs.k8s.io/kustomize" functionality.

TODO:

  1) Convert remaining legacy transformers to
     plugins (patch SMP/JSON, name prefix/suffix,
     labels/annos) with their own tests.  The
     generators are already done; this PR wires
     them up, and all tests & examples pass.

  2) Push code down into the plugins, as the first
     pass at conversion writes plugins as thin
     layers over calls into code under the mess
     that is pkg/.  Once this is done, we can
     reasonably move all the packages that aren't
     imported by plugins to internal/.

This PR could be split in two, one to merge the
the generator, and the second to merge the
ImageTagTransformer plugin and its wiring into the
main flow.

The latter PR could then serve as an example for
converting the remaining transformers.
2019-05-16 10:07:28 -07:00
Kubernetes Prow Robot
c6476d16e7 Upgrade version of minecraft used in tests. 2019-05-16 10:06:24 -07:00
Jeffrey Regan
5614649d14 Standalone service generator test 2019-05-13 12:30:51 -07:00
Jeffrey Regan
44ac9a9f44 Standalone ChartInflator plugin test. 2019-05-13 11:42:31 -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
Jeffrey Regan
7295a9b32e Fix some nits. 2019-05-07 17:56:48 -07:00
Jeffrey Regan
2d70526eab Add ConfigMapGenerator and test. 2019-05-07 17:25:43 -07:00
Jeffrey Regan
2825888ffd Add test for builtin secretgenerator plugin. 2019-05-07 16:16:07 -07:00
Jeffrey Regan
529db0493b Introduce envs field. 2019-05-06 14:35:48 -07:00
Jeffrey Regan
cd9572e0bb hey 2019-04-26 15:48:41 -07:00
jregan
cfb0c5efad Make plugin dir match Go conventions. 2019-04-25 20:30:10 -07:00