Commit Graph

24 Commits

Author SHA1 Message Date
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
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
Jeffrey Regan
44ac9a9f44 Standalone ChartInflator plugin test. 2019-05-13 11:42:31 -07:00
jregan
4df576869f Add SedTransformerTest 2019-05-12 11:32:33 -07:00
Jeffrey Regan
76d370a8f2 Chart last mile example 2019-04-29 13:53:51 -07:00
Jeffrey Regan
2545ea1019 Helm chart generator exec plugin 2019-04-17 19:07:20 -07:00
Jingfang Liu
f6e01cfda7 add support for exec plugins 2019-04-16 09:26:38 -07:00
Jeffrey Regan
e191ff53dd Switch to vgo 2019-04-11 22:25:37 -07:00
Jingfang Liu
ba43ecbcb7 add goplugin for exec generators and transformers 2019-04-09 13:13:21 -07:00
Ryan Cox
261d64ec1d port to golangci and make travisci improvements 2018-10-09 00:58:34 -07:00
Jeffrey Regan
f931e15653 Add varcheck to presubmit. 2018-08-23 10:17:37 -07:00
Jeffrey Regan
564b0d6827 Fix cluster of silly Go nits. 2018-07-18 17:45:17 -07:00
Oleg Atamanenko
f557841e54 Enable unparam linter and fix issues 2018-06-18 14:49:57 -04:00
Oleg Atamanenko
6fd0330b80 Add gometalinter to pre-commit hook
Enable varcheck and fix found issues

Add ineffassign to list of checks and fix found issues

Added nakedret and fixed found issues

Add interfacer check and fix found issue

Add lll and fix found issues

Add deadcode linter, remove unused code
2018-06-14 20:55:20 -04:00
Jeff Regan
4f3f76addd Merge pull request #78 from uthark/gocyclo
Fixed gocyclo warnings and added pre-commit hook
2018-06-10 11:11:48 -07:00
Oleg Atamanenko
5c8d82aed0 Fixed gocyclo warnings and added pre-commit hook 2018-06-09 23:43:42 -04:00
Oleg Atamanenko
c994130005 Fix go lint error and add golint checks to a pre-commit hook 2018-06-09 23:05:26 -04:00
Jeffrey Regan
8afba0b56c Document constants package. 2018-05-31 13:42:03 -07:00
Ahmet Alp Balkan
7086e4f974 demos --> examples
examples/ is pretty standard whereas demos/ isn't. So I just refactored that.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-05-25 10:07:46 -07:00
Jeffrey Regan
fea19d0f00 fixStuffDueToKubectlDeletion 2018-05-15 13:42:14 -07:00
Jeff Regan
735d04d05e Update pre-commit.sh
Install the program for sake of demos.
2018-05-11 14:59:09 -07:00
Jeffrey Regan
83b3eb9d54 Bulk move from k8s.io/kubectl 2018-05-11 14:07:15 -07:00
Jeffrey Regan
e01ba34e8d Isolated content of bin 2018-05-11 14:01:20 -07:00