Commit Graph

42 Commits

Author SHA1 Message Date
jregan
5de0673db1 Push json transform code down to plugin. 2019-06-30 17:30:52 -07:00
Jeffrey Regan
a60d99fdc9 Fix 972 2019-06-27 17:37:12 -07:00
Takuro Wada
f11d083b0a Apply goimports 2019-06-25 11:05:56 +09:00
Takuro Wada
f1a5a7703c Update Copyright to shorter one 2019-06-25 11:05:43 +09:00
Takuro Wada
6ed70add4a Add Delete function to patch pkg 2019-06-24 21:14:26 +09: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
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
5e054c9d31 Add originalName field to resource. 2019-06-12 16:30:03 -07:00
jregan
0e4f9acb6e Rename ErrorIfNotEqual to ErrorIfNotEqualSets 2019-06-06 20:20:48 -07:00
Jeffrey Regan
4162dbc2d8 Maintain resources in order loaded. 2019-06-06 15:55:57 -07:00
Jeffrey Regan
b28aaae66b Break a bad dep. 2019-05-22 07:39:36 -07: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
rohitsardesai83
b67d713bc0 Remove dependency on ghodss/yaml 2019-04-25 23:47:01 +05:30
Jeffrey Regan
8991bcb399 Collect existing internal pkgs under one roof. 2019-04-23 11:53:50 -07:00
Jingfang Liu
78cbff16ef improve error message in json patch transformer 2019-03-04 16:43:24 -08:00
jregan
d4d993a53c Add more resid test coverage. 2019-02-16 14:26:43 -08:00
jregan
0f30c09cbf Delete extraneous copyright. 2019-02-16 11:52:12 -08:00
k8s-ci-robot
8f701a0041 Merge pull request #565 from zoncoen/name-suffix-3
Update docs, examples, comments, and test data for nameSuffix
2018-11-29 08:13:42 -08:00
zoncoen
59df8a0dda update docs, examples, comments 2018-11-29 22:29:52 +09:00
jregan
4f9d00c021 Enforce relocatabile kustomizations. 2018-11-22 09:07:05 -08:00
Benjamin Elder
76ba38cec5 make k8sdeps.NewFactory() importable 2018-10-25 17:21:58 -07:00
Jingfang Liu
d33d154e14 split k8sdeps package into sub packages 2018-10-11 11:30:46 -07:00
Jingfang Liu
96091dfcf5 remove decoder interface since it is only used inside k8sdeps 2018-10-10 11:08:23 -07:00
Jeff Regan
30814302af Fix some minor naming mistakes. (#434)
* Fix some minor naming mistakes.

* Fix some minor naming mistakes.
2018-10-08 15:58:44 -07:00
jregan
4eb2757847 Further isolate unstructured with factories. 2018-10-08 11:52:38 -07:00
jregan
0f5a39f328 Hide unstructured.Unstructured behind interface. 2018-10-08 11:12:06 -07:00
David Schweikert
3d4bf3abbf for yaml-formatted JSON6902 patches, convert first to json, then use the same code as for json-formatted JSON6902 patches 2018-10-05 22:53:26 +02:00
Jeffrey Regan
c9887e8c15 WIP residPackage 2018-10-05 12:58:48 -07:00
David Schweikert
279826f6d6 error out if patchesJson6902 target can't be found, fixes #335 2018-10-03 21:53:45 +02:00
jregan
c9aff4c47a Spelling nits. 2018-10-01 10:56:35 -07:00
jregan
6d935b6a4a Fix some Go nits. 2018-09-28 18:08:36 -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
Jingfang Liu
81b5cf65d6 remove inline json patch format 2018-09-06 11:18:19 -07:00
Jingfang Liu
d782abb214 Update patch factory and add multi transformer with checking conflicts 2018-09-04 09:13:26 -07:00
Jeffrey Regan
340cb2b385 Remove unnecessary import aliases. 2018-08-31 17:20:03 -07:00
Jingfang Liu
cedf215445 add PatchJson6902Factory to make transformer 2018-08-31 10:21:58 -07:00
Jingfang Liu
7f0e9e3a6a Add patchJson6902 transformer 2018-08-30 15:34:42 -07:00
Jingfang Liu
b713d5a1cc change patches to patchesStrategicMerge in tests and examples 2018-08-28 09:40:34 -07:00
Jingfang Liu
3d9d4bd36f address comments 2018-08-27 15:44:42 -07:00