Commit Graph

672 Commits

Author SHA1 Message Date
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
Jian Qiu
8f413f523c Add name reference of storageClass 2019-05-22 14:43:15 +08:00
Jeffrey Regan
79906d73d0 Add builtin namespace transformer plugin 2019-05-21 13:56:36 -07:00
Jeffrey Regan
f621543d9c Cleanup kusttarget. 2019-05-21 11:40:23 -07:00
Kubernetes Prow Robot
e801b3a75d Merge pull request #1090 from monopole/prune
replace ambiguous parameters regarding prune
2019-05-21 11:40:08 -07:00
jregan
a352ff3923 True and false are mysterious. 2019-05-21 10:58:43 -07:00
Jian Qiu
5e33ac4a09 Allow nil label and annotaion
This fix is to allow value of lable or annoation to be nil
2019-05-21 13:55:19 +08:00
jregan
b92ee25696 Fix some nits. 2019-05-20 19:56:07 -07:00
Jeff Regan
a2d4423630 Merge pull request #1037 from jnewland/patch-2
Apply LimitRange resources before workloads
2019-05-20 18:27:15 -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
Benjamin Fuller
efcf8757b0 Update order of resources to include psps
Add pod security policy to list of order after service account but before the roles that would use them
2019-05-14 11:38:17 -06:00
Karen Bradshaw
c836de5ca8 update error msg 2019-05-14 13:03:24 -04:00
Karen Bradshaw
2aa7e30aff minimize test 2019-05-14 12:35:30 -04:00
Karen Bradshaw
c724cb7178 add test for empty patch file 2019-05-14 10:54:28 -04:00
Jeff Regan
858c7493df Merge pull request #1070 from monopole/deleteUnused
Delete some code.
2019-05-13 12:42:59 -07:00
Jeffrey Regan
5614649d14 Standalone service generator test 2019-05-13 12:30:51 -07:00
Jeffrey Regan
9a4cb6c991 Delete unused code. 2019-05-13 12:15:30 -07:00
Jeff Regan
2a090e9118 Merge pull request #1071 from monopole/standaloneChartInflatorTest
Standalone ChartInflator plugin test.
2019-05-13 12:09:57 -07:00
Jeffrey Regan
44ac9a9f44 Standalone ChartInflator plugin test. 2019-05-13 11:42:31 -07:00
Jeff Regan
95e4cc1aec Merge pull request #1057 from narg95/feature/remove_resource
add remove resource subcommand
2019-05-13 10:11:33 -07:00
Jeff Regan
fa4dc14c97 Update all.go 2019-05-13 10:01:55 -07:00
Kubernetes Prow Robot
69f59bfb2a Merge pull request #1068 from yujunz/patch-1
Fix typo
2019-05-13 08:50:21 -07:00
Kubernetes Prow Robot
eb2bdc3105 Merge pull request #1063 from narg95/fix_replace_image
allow set image without tag
2019-05-13 08:48:14 -07:00
Yujun Zhang
e079c20ceb Fix typo 2019-05-13 16:46:41 +08: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
Nestor
e4159d9411 allow to set image without a tag 2019-05-10 17:35:15 +02:00
Nestor
ca6228b526 add remove resource subcommand 2019-05-08 15:34:29 +02:00
Jeffrey Regan
7295a9b32e Fix some nits. 2019-05-07 17:56:48 -07:00
Jeff Regan
607eb13a52 Merge pull request #1050 from monopole/morePluginTests
Add ConfigMapGenerator and test.
2019-05-07 17:35:41 -07:00
Jeffrey Regan
2d70526eab Add ConfigMapGenerator and test. 2019-05-07 17:25:43 -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