Commit Graph

27 Commits

Author SHA1 Message Date
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
ed03818e20 This commit enhances the UnstructAdapter
* Added support for arbitrary data types rather than just strings
* Added support for integer index-able arrays
* Improve code coverage for kunstruct
  - kunstruct around 90%
  - helper at 100%
* Update expansion.Expand method to preserve the original type of the variable
* Ensure the int field such .spec.replicas can be used
  as a source in a first Deployment or as destination of a variable (in the
  second Deployment variable).
2019-06-18 13:43:01 -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
jregan
11bb176a3f Push suffix/prefix code to plugin. 2019-06-11 19:37:06 -07:00
Jeffrey Regan
4162dbc2d8 Maintain resources in order loaded. 2019-06-06 15:55:57 -07:00
Jingfang Liu
61d46c26b8 fix the boilerplate copyright header (#1064) 2019-05-10 10:20:20 -07:00
Jeffrey Regan
ff6cd3ca55 Report unused variables. 2019-02-26 21:04:36 -08:00
Nestor
8c93f7ba74 add support for varref in maps values 2019-02-14 08:02:32 +01:00
Jingfang Liu
d8585334cc minor fix: incorrect apiVersion and add NoOpTransformer for vars (#757) 2019-02-04 09:44:33 -08:00
Andrew Lavery
1d263d24dd replaceVars returns nil on nil input, not error
includes  an integration test for 'null' args inputs
2019-01-30 15:40:53 -08:00
jregan
54d6cf7087 Simplify refvar transformer. 2018-12-16 09:27:58 -08:00
mooncake
538aaaf217 Fix typos: expectd->expected, cluser->cluster
Signed-off-by: mooncake <xcoder@tenxcloud.com>
2018-11-11 00:14:25 +08:00
Jeffrey Regan
d9f9a51e55 Fix names/doc in transformation config code. 2018-10-12 13:36:22 -07:00
Jingfang Liu
c33a97fcf2 move transformerconfig package to transformers/config 2018-10-10 15:12:32 -07:00
jregan
0f5a39f328 Hide unstructured.Unstructured behind interface. 2018-10-08 11:12:06 -07:00
Jingfang Liu
078c90cabe remove hard coded pathconfig 2018-09-28 09:28:39 -07:00
Jeffrey Regan
fb355eb320 Introduce gvk package to isolate apimachinery schema. 2018-09-26 15:02:38 -07:00
Jingfang Liu
64fdb8d760 change github.com/kubernetes-sigs to sigs.k8s.io (#343)
* change github.com/kubernetes-sigs to sigs.k8s.io

* change go_import_path in .travis.yml
2018-09-12 12:41:38 -07:00
Maximilian Gaß
2a06a174e8 Add CronJob to refvars transformer 2018-06-26 12:20:52 +02:00
Jingfang Liu
ad3cd47c25 Add variable reference to pod command,args,env 2018-06-19 11:25:58 -07:00
Jingfang Liu
09ab2bb5c0 Add variable reference to container env 2018-06-14 13:38:58 -07:00
Jingfang Liu
46e8fd7065 Add variable reference support for args 2018-06-11 13:57:34 -07:00
Jingfang Liu
1f8e56a210 Add wordpress example for demonstrating variable reference 2018-06-08 11:49:42 -07:00
jregan
a42c72b2e0 Reduce indirection. 2018-06-07 21:53:55 -07:00
Jingfang Liu
95f568b857 add comments in refvar transformer
Refactor change
2018-06-06 14:42:18 -07:00
Jingfang Liu
1a28f3a391 Address comments: add unit tests, defaulting and update comment 2018-06-06 10:21:15 -07:00
Jingfang Liu
526ba2df0c add varialber reference support 2018-06-06 09:30:12 -07:00