Compare commits

...

3313 Commits

Author SHA1 Message Date
Jeff Regan
42d1f7b792 Update cloudbuild.sh 2020-07-04 09:35:52 -07:00
Jeff Regan
8912c454ff Merge pull request #2692 from monopole/independence
New cloud build scripts.
2020-07-04 09:13:18 -07:00
jregan
d4eb2c9426 New cloud build scripts. 2020-07-04 08:58:17 -07:00
Jeff Regan
d2b95fb09a Merge pull request #2691 from phanimarupaka/IncludeSubstFlag
Hide list-subst behind a flag
2020-07-04 08:44:42 -07:00
Jeff Regan
298b3c8622 Merge pull request #2688 from prachirp/grep-shorthand
Drop grep invert-match shorthand flag
2020-07-04 08:44:29 -07:00
Phani Teja Marupaka
c12e95fe06 Hide list-subst behind a flag 2020-07-03 23:55:29 -07:00
Prachi Pendse
87c7a32ffe Drop grep invert-match shorthand flag to resolve conflict with log level verbosity 2020-07-03 11:43:17 -04:00
Jeff Regan
a7545bdad3 Merge pull request #2686 from monopole/updateBuildStrategy
Update build strategy.
2020-07-02 18:09:31 -07:00
Jeffrey Regan
622a121042 Update build strategy. 2020-07-02 18:08:13 -07:00
Kubernetes Prow Robot
c7bc9d2066 Merge pull request #2676 from phanimarupaka/RemoveCountField
Remove count field, convert error to warning
2020-07-01 11:30:17 -07:00
Phani Teja Marupaka
9567d7ef16 Remove count field, convert error to warning 2020-07-01 10:55:30 -07:00
Jeff Regan
e5b0ceb4e3 Merge pull request #2682 from monopole/release_kustomize_v3_7_0_based_on_api_v0_4_2
Prep to release kustomize 3.7.0 on api v0.4.2
2020-07-01 07:23:15 -07:00
jregan
5fb238a581 Prep to release kustomize 3.7.0 on api v0.4.2 2020-07-01 06:51:53 -07:00
Jeff Regan
3ddc9af6c5 Merge pull request #2680 from monopole/syncEverythingTo_gopkg_in_yaml_v2_v2_3_0
Sync everything to gopkg.in/yaml.v2 v2.3.0 via kyaml v0.3.4
2020-06-30 19:07:33 -07:00
jregan
128e171c20 Sync everything to gopkg.in/yaml.v2 v2.3.0 via kyaml v0.3.4 2020-06-30 18:53:11 -07:00
Jeff Regan
c2681b6fae Merge pull request #2679 from monopole/upgradeKyaml_gopkgyaml_deps
Upgrade to gopkg.in/yaml.v2 v2.3.0
2020-06-30 18:31:21 -07:00
Jeff Regan
ae5c392319 Merge pull request #2678 from monopole/gopkg_in_yaml_v2_v2_3_0
Upgrade to gopkg.in/yaml.v2 v2.3.0
2020-06-30 18:14:18 -07:00
jregan
66bcf84682 Upgrade to gopkg.in/yaml.v2 v2.3.0 2020-06-30 18:06:06 -07:00
jregan
436dada184 Upgrade to gopkg.in/yaml.v2 v2.3.0 2020-06-30 17:45:43 -07:00
Jeff Regan
a689e0c2b4 Merge pull request #2675 from monopole/kyaml_v0_3_3
Switch kustomize to kyaml v0.3.3
2020-06-30 17:45:30 -07:00
jregan
30ae7183a4 Switch kustomize to kyaml v0.3.3 2020-06-30 15:46:26 -07:00
Jeff Regan
279a9b673f Merge pull request #2674 from mortent/RemoveKstatus
Remove the kstatus module
2020-06-30 15:10:23 -07:00
Jeff Regan
0ac45c65c9 Merge pull request #2652 from omninonsense/add-sopsgenerator-example
Add link to another Go plugin
2020-06-30 15:09:47 -07:00
Jeff Regan
d7fb813c16 Merge pull request #2666 from viggys/master
configMapGenerator docs content addition for `envs` option
2020-06-30 15:09:12 -07:00
Jeff Regan
83c5c4d1f1 Merge pull request #2661 from trodge/field-not-found-error
Error message for creating setter that matches no fields
2020-06-30 15:08:28 -07:00
Kubernetes Prow Robot
7259d3eb48 Merge pull request #2670 from phanimarupaka/CheckRequiredSetters
Check if required setters are set
2020-06-30 13:34:07 -07:00
Morten Torkildsen
0e44202c20 Remove the kstatus module 2020-06-30 13:27:02 -07:00
Phani Teja Marupaka
0d90b769f1 Check if required setters are set 2020-06-30 13:21:17 -07:00
Jeff Regan
7ad2791072 Merge pull request #2667 from Shell32-Natsu/kpt-function
Improvements for KRM function implementation
2020-06-30 10:47:17 -07:00
Kubernetes Prow Robot
6de94548ba Merge pull request #2669 from monopole/notZero
Fix an index.
2020-06-30 10:34:06 -07:00
Jeff Regan
b1b190227e Merge pull request #2672 from wyyxd2017/hato2
fix k8s api doc
2020-06-30 09:46:15 -07:00
wangyeyu
4ceddaa8f4 kubernetes api 2020-06-30 14:19:27 +08:00
wangyeyu
9e64ac5315 help doc 2020-06-30 14:12:20 +08:00
jregan
f24ec14956 Fix an index. 2020-06-29 17:48:30 -07:00
Donny Xia
98a92a6443 Remove comment from fnexectest.sh 2020-06-29 16:57:49 -07:00
Donny Xia
8bb612889c Improve function invocation 2020-06-29 16:51:56 -07:00
Donny Xia
e3ec184e92 Add unit test for fnplugin 2020-06-29 14:07:48 -07:00
Donny Xia
3019230283 Move functionConfig from items to upper level 2020-06-29 13:35:14 -07:00
Vignesh Subramanian
69adcf9aaf configMapGenerator docs content addition 2020-06-30 00:44:14 +05:30
Donny Xia
8d543d8483 Refactor 2020-06-29 11:12:20 -07:00
Donny Xia
94a55210e1 skeleton for kustomize function 2020-06-29 10:45:37 -07:00
Jeff Regan
441581b745 Merge pull request #2597 from aodinokov/fnplugins
PoC to use kpt functions as kustomize plugins
2020-06-29 10:38:32 -07:00
Thomas Rodgers
a066ba9628 added count to expected output 2020-06-29 10:16:36 -07:00
Thomas Rodgers
3a0dd72c88 added count for list setters 2020-06-29 09:52:18 -07:00
Thomas Rodgers
d4ed285fd1 added count for creating setters 2020-06-29 09:37:18 -07:00
Thomas Rodgers
4cae8cfe9b added error message 2020-06-29 09:37:18 -07:00
Jeff Regan
b044a52a84 Merge pull request #2664 from monopole/upgradeTo_Kyaml_v0_3_2
Upgrade kustomize to kyaml v0.3.2
2020-06-28 12:54:15 -07:00
jregan
5607478d8e Upgrade kustomize to kyaml v0.3.2 2020-06-28 12:36:21 -07:00
Jeff Regan
d60cf8ebc5 Merge pull request #2663 from monopole/smpAttempt
Start supporting strategic merge patch in kyaml/yaml/merge2.
2020-06-28 12:28:03 -07:00
jregan
ef04983392 Start supporting strategic merge patch in kyaml merge2. 2020-06-28 12:12:09 -07:00
Jeff Regan
2153863355 Merge pull request #2660 from monopole/kyaml_0_3_1
Switch to kyaml v0.3.1
2020-06-26 15:58:10 -07:00
jregan
4afab168c5 Switch to kyaml v0.3.1 2020-06-26 15:28:12 -07:00
Jeff Regan
2c52e3a851 Merge pull request #2659 from monopole/schemaTest
Allow multiple patch strategies.
2020-06-26 15:04:12 -07:00
jregan
781e396122 Allow multiple patch strategies. 2020-06-26 14:46:29 -07:00
Jeff Regan
cebb1b31ab Merge pull request #2658 from monopole/volMergeTests
Deployment volume merge tests.
2020-06-26 14:33:49 -07:00
jregan
9137d2a39a Deployment volume merge tests. 2020-06-26 14:19:15 -07:00
Kubernetes Prow Robot
95f4ecd261 Merge pull request #2657 from phanimarupaka/FixCommentsInFunctions
Fix copy comments for Folded style scalar nodes
2020-06-26 12:41:31 -07:00
Phani Teja Marupaka
600d4f2c0b Fix copy comments for Folded style scalar nodes 2020-06-26 12:22:08 -07:00
Jeff Regan
6c4c5cf9ad Merge pull request #2655 from monopole/updatePSMT
Update SMP transformer for kyaml
2020-06-26 11:35:56 -07:00
jregan
5f5b23af58 Update SMP transformer for kyaml 2020-06-26 11:14:02 -07:00
Jeff Regan
ae5a690146 Merge pull request #2654 from monopole/moreKyamlTests
More kyaml list merge tests
2020-06-26 11:03:15 -07:00
jregan
625e011e2b More kyaml list merge tests 2020-06-26 10:58:27 -07:00
Jeff Regan
01ce33b926 Merge pull request #2653 from monopole/apiversionv1
Convert all deployments to v1 to use openapi schema.
2020-06-26 10:58:02 -07:00
jregan
a323d78bbc Convert all deployments to v1 to use openapi schema. 2020-06-26 10:30:02 -07:00
Nino Miletich
69dc34500a docs: add link to another Go plugin 2020-06-26 17:02:00 +01:00
Alexey Odinokov
919bdb84c9 Refactoring to get rid of duplicated code 2020-06-26 04:28:38 +00:00
Alexey Odinokov
178f4e21f0 Added test for exec-based function generator 2020-06-26 04:22:33 +00:00
Alexey Odinokov
d732a6faab Gave up to install docker in pod. Just skipping tests that require docker if there is no binary 2020-06-26 04:22:33 +00:00
Alexey Odinokov
f053ca6a5f little fix 2020-06-26 04:22:33 +00:00
Alexey Odinokov
dfc5c32af5 Added manual start of rootless docker 2020-06-26 04:22:33 +00:00
Alexey Odinokov
80b3f4e00a Added info about user to subgid 2020-06-26 04:22:33 +00:00
Alexey Odinokov
4646bca230 Added info about user to subuid 2020-06-26 04:22:32 +00:00
Alexey Odinokov
57ca8fa321 Do update of repos 2020-06-26 04:22:32 +00:00
Alexey Odinokov
de7fa4bf3a Check what is os release 2020-06-26 04:22:32 +00:00
Alexey Odinokov
af1280ea43 Install uidmap before docker 2020-06-26 04:22:32 +00:00
Alexey Odinokov
0dd191c0f6 Added flag to skip iptables 2020-06-26 04:22:32 +00:00
Alexey Odinokov
e20e126d65 Switched back to rootless docker 2020-06-26 04:22:32 +00:00
Alexey Odinokov
abf862fff1 Added more post-install check for docker 2020-06-26 04:22:32 +00:00
Alexey Odinokov
27cf3981ca Added post-install check for docker 2020-06-26 04:22:32 +00:00
Alexey Odinokov
2c39ff0fa0 Changed to std docker to run fn tests 2020-06-26 04:22:32 +00:00
Alexey Odinokov
afc14afe45 Trying to install rootless docker to run fn tests 2020-06-26 04:22:31 +00:00
Alexey Odinokov
6e91e0667d Disabled tests because we don't have docker installed 2020-06-26 04:22:31 +00:00
Alexey Odinokov
1aca8b8b9e Corrected literal to make lint happy 2020-06-26 04:22:31 +00:00
Alexey Odinokov
448c060084 Added tests for fn-based generators and transformers 2020-06-26 04:22:31 +00:00
Alexey Odinokov
b3951942e3 removed commented import to make linter happy 2020-06-26 04:22:31 +00:00
Alexey Odinokov
b78464c8b1 Made generators work in addition to transformers
Made go fmt to make linter happy
2020-06-26 04:22:31 +00:00
Alexey Odinokov
9bd4f78288 PoC to use kpt functions as kustomize plugins
Closes [1]
In addition removes accidentally committed binary [2]

[1]
https://github.com/GoogleContainerTools/kpt/issues/646

[2]
1644fdd076 (diff-78873bc1f515e5cb644e68f0bcbaba23)
2020-06-26 04:22:31 +00:00
Jeff Regan
85e9fa94b0 Merge pull request #2648 from monopole/moreTests
Add more SMP tests.
2020-06-25 12:27:53 -07:00
jregan
c754927112 Add more SMP tests. 2020-06-25 12:09:53 -07:00
Jeff Regan
8049c57b72 Merge pull request #2623 from Shell32-Natsu/releasing-doc
Releasing doc
2020-06-25 11:04:51 -07:00
Jeff Regan
695ec44bf7 Merge pull request #2636 from jijiew/fmt-test
add test case showing that kustomize/kpt fmt works on yaml file with top-level lists
2020-06-25 11:04:21 -07:00
Jeff Regan
5b394b2079 Merge pull request #2638 from haiyanmeng/mem
Avoid reprocess queries whose range size is 0 and improve memory usage
2020-06-25 10:58:20 -07:00
Jeff Regan
97c2ac77cd Merge pull request #2639 from Shell32-Natsu/knative-back-ref
Add back reference for secret in knative service
2020-06-25 10:57:44 -07:00
Jijie Wei
3183fcc926 simplify the test case 2020-06-25 10:01:15 -07:00
Jijie Wei
0af9ca1266 simplify the test case 2020-06-25 09:59:17 -07:00
Kubernetes Prow Robot
a6111b5c3c Merge pull request #2642 from mortent/FixListSettersErr
Fix failing list setters test
2020-06-24 10:01:18 -07:00
Morten Torkildsen
fdbd1bdbbb Fix failing list setters test 2020-06-23 17:32:21 -07:00
Morten Torkildsen
16baf7a955 Merge pull request #2629 from phanimarupaka/ListSettersNoSet
Tests for List setters should not alter resources
2020-06-23 17:17:30 -07:00
Kubernetes Prow Robot
69aea07c4e Merge pull request #2637 from pwittrock/merge-primitize
Support merging primitive lists
2020-06-23 16:55:18 -07:00
Kubernetes Prow Robot
2250ad3e18 Merge pull request #2635 from phanimarupaka/RequiredSettersForApply
Required setters for apply
2020-06-23 15:19:17 -07:00
Phani Teja Marupaka
c107d1ddff List setters should not alter resources
Remove Dryrun flag
2020-06-23 14:39:03 -07:00
Jijie Wei
f17b893dd2 fmt 2020-06-23 13:16:18 -07:00
Phillip Wittrock
09894d3022 Support merging primitive lists 2020-06-23 12:39:51 -07:00
Donny Xia
fd3e84f701 Add knative API version 2020-06-23 11:58:14 -07:00
Donny Xia
22d5d4d2c1 Add back reference for secret in knative service 2020-06-23 11:48:26 -07:00
Haiyan Meng
145ba0c7ff Avoid reprocess queries whose range size is 0 2020-06-23 11:36:29 -07:00
Haiyan Meng
a83433d5cf Optimize memory usage by avoiding accumulating all the referred
documents into a single stack.
2020-06-23 11:36:29 -07:00
Haiyan Meng
2d496e0efe Update golang to 1.14 2020-06-23 11:25:37 -07:00
Haiyan Meng
171412cc98 Use RWMutex to control the map access
Without RWMutex, we may run into fatal error: concurrent map read and map write.
2020-06-23 11:25:37 -07:00
Phani Teja Marupaka
68ab3b87d9 Required setters for apply 2020-06-22 22:33:21 -07:00
Jijie Wei
e9bd11caaa add test for fmt on yaml file of a list 2020-06-22 22:32:08 -07:00
Kubernetes Prow Robot
a895220743 Merge pull request #2553 from jijiew/deletesetter
Delete setters
2020-06-22 12:15:40 -07:00
Kubernetes Prow Robot
ab2dc7fcb9 Merge pull request #2546 from phanimarupaka/FnSourceJson
Include json files for fn source and sink
2020-06-22 11:00:40 -07:00
Kubernetes Prow Robot
afde29601a Merge pull request #2633 from syed-awais-ali/patch-1
fix typo
2020-06-22 10:34:40 -07:00
Jijie Wei
be0f1a7fcb remove the uncessary conversion 2020-06-22 10:00:22 -07:00
Jijie Wei
99d2994b98 remove empty definition 2020-06-22 09:54:10 -07:00
Syed Awais Ali
94101fb7cc fix typo 2020-06-22 15:59:38 +05:00
Kubernetes Prow Robot
346071897e Merge pull request #2630 from ash2k/ash2k/drop-ghodss-yaml
Drop ghodss/yaml dependency
2020-06-21 10:32:38 -07:00
Mikhail Mazurskiy
0772540214 Drop github.com/ghodss/yaml dependency 2020-06-21 20:35:50 +10:00
Donny Xia
6791688f5f Code review 2020-06-19 19:24:41 -07:00
Phani Teja Marupaka
28307bc435 Simplify parsing 2020-06-19 17:21:13 -07:00
Jijie Wei
29cadfe8b0 modify the doc to simple string, will update the doc later 2020-06-19 16:35:57 -07:00
Kubernetes Prow Robot
68f4f330f5 Merge pull request #2601 from sunny0826/master
zh docs for docsy site
2020-06-19 15:54:40 -07:00
Jeff Regan
507779c9dc force branch fetches in gitrunner 2020-06-19 15:34:55 -07:00
Jeff Regan
062d0f7b75 Merge pull request #2626 from monopole/delegateKunstructured
Delegate to Kunstructured.
2020-06-19 15:29:20 -07:00
jregan
e783af2881 Delegate to Kunstructured. 2020-06-19 15:06:13 -07:00
Jeff Regan
f2da1f621f Merge pull request #2624 from monopole/sortIfc
Sort ifc.go for easier change monitoring during refactor.
2020-06-19 15:06:05 -07:00
jregan
294312f2fc Sort ifc.go for easier change monitoring during refactor. 2020-06-19 14:49:57 -07:00
Jeff Regan
ff79bd0b31 Merge pull request #2613 from Shell32-Natsu/validator
Introduce `validators` field in kustomization file
2020-06-19 14:49:44 -07:00
Jeff Regan
410e300243 Merge pull request #2622 from arrikto/feature-update-components-example
Revamp components example
2020-06-19 14:45:44 -07:00
Phani Teja Marupaka
e994b3b566 E2e test for run with json 2020-06-19 12:33:08 -07:00
Phani Teja Marupaka
b39c522cc1 Suggested changes 2020-06-19 12:33:08 -07:00
Phani Teja Marupaka
dc4bf03da2 Write json files in sink 2020-06-19 12:33:07 -07:00
Phani Teja Marupaka
a158eeaaff Suggested changes 2020-06-19 12:33:07 -07:00
Phani Teja Marupaka
4cd3944860 Include json files for fn source 2020-06-19 12:33:06 -07:00
Donny Xia
79a48a8802 Remove files 2020-06-19 10:52:56 -07:00
Donny Xia
5a33e90f18 Update releasing readme 2020-06-19 10:50:17 -07:00
Ioannis Androulidakis
e77d1a881f Revamp the components example
Standardize on `patchesStrategicMerge` and `patchesJSON6902` instead of
`patches` in kustomization files.

Also, add example commands to create local input files for existing
SecretGenerators.

Signed-off-by: Ioannis Androulidakis <ioannis@arrikto.com>
2020-06-19 14:37:39 +03:00
Ioannis Androulidakis
343b938c73 Remove WIP from components example
Signed-off-by: Ioannis Androulidakis <ioannis@arrikto.com>
2020-06-19 14:37:39 +03:00
Jijie Wei
25186e94af implement new visitor method 2020-06-18 13:49:54 -07:00
Jijie Wei
e4ba898e20 return subst name inerror message 2020-06-18 13:49:53 -07:00
Jijie Wei
22a6017870 update the pr to handle the case when the setter to be deleted is used in substitution 2020-06-18 13:49:52 -07:00
Donny Xia
e62f1adabf Force update local tags 2020-06-18 12:20:08 -07:00
Donny Xia
7e2d3ff5ab Reuse tansformer codes 2020-06-18 12:18:37 -07:00
Kubernetes Prow Robot
fb6830c98a Merge pull request #2617 from phanimarupaka/FixArraySetters
Fix validation for array setters
2020-06-18 12:03:11 -07:00
Phani Teja Marupaka
52e8a701ac Fix validation for array setters 2020-06-18 11:50:02 -07:00
Donny Xia
160485ef19 Add examples to validators 2020-06-17 14:44:59 -07:00
Donny Xia
cea1154cd9 Add exception for "validated-by" label 2020-06-17 14:35:12 -07:00
Donny Xia
4843718a2b Check modification 2020-06-17 14:35:12 -07:00
Donny Xia
a0c1979798 Add validator to kustomization 2020-06-17 14:35:12 -07:00
Kubernetes Prow Robot
8576acf1aa Merge pull request #2612 from mortent/UpdateVersionsForKyamlAndCmdConfig
Update VERSIONS file with latest versions of kyaml and cmd/config
2020-06-17 14:08:05 -07:00
Morten Torkildsen
1e7a764900 Update VERSIONS file with latest versions of kyaml and cmd/config 2020-06-17 13:22:11 -07:00
Kubernetes Prow Robot
9b5ce5002a Merge pull request #2608 from mortent/AllValuesAcceptedAsStringType
Accept all values as string type in validation
2020-06-16 16:10:05 -07:00
Morten Torkildsen
0952421800 Accept all values as string type in validation 2020-06-16 15:54:28 -07:00
Kubernetes Prow Robot
df9af1869f Merge pull request #2605 from phanimarupaka/ArraySettersUX
Avoid manual step for creating array setters
2020-06-16 15:30:05 -07:00
Phani Teja Marupaka
dbb16dcb6d Suggested changes 2020-06-16 15:11:25 -07:00
Jeff Regan
cc8fc99999 Merge pull request #2603 from Shell32-Natsu/doc
Update GO plugin doc
2020-06-16 10:22:36 -07:00
Phani Teja Marupaka
0f0efe2a4c Avoid manual step for creating array setters 2020-06-15 22:34:05 -07:00
Donny Xia
36165d2843 Update GO plugin doc 2020-06-15 14:22:31 -07:00
Kubernetes Prow Robot
3e9276271a Merge pull request #2599 from mortent/FixValidation
Fix validation logic to use yaml parsing instead of json
2020-06-15 11:31:57 -07:00
guoxudong
af7df1448d fix 2020-06-15 14:21:15 +08:00
guoxudong
518147c129 add zh docsy 2020-06-15 13:39:13 +08:00
Kubernetes Prow Robot
a0072a2cf9 Merge pull request #2600 from pwittrock/master
Add more Kustomize contributing docs
2020-06-14 14:17:55 -07:00
Phillip Wittrock
c4518e964f Add more Kustomize contributing docs 2020-06-14 08:26:51 -07:00
Kubernetes Prow Robot
c2eb09cd8f Merge pull request #2593 from pwittrock/master
kustomize docs tweaks
2020-06-13 17:43:55 -07:00
Kubernetes Prow Robot
89b4e7ae02 Merge pull request #2596 from Liujingfang1/master
cleanup binary file
2020-06-13 17:29:55 -07:00
Morten Torkildsen
714ff85806 Fix validation logic to use yaml parsing instead of json 2020-06-13 14:07:05 -07:00
Phillip Wittrock
589ddcb4fa kustomize docs tweaks 2020-06-12 11:22:26 -07:00
Jingfang Liu
3d09b0cb83 cleanup binary file 2020-06-12 11:06:49 -07:00
Kubernetes Prow Robot
3012dd67ac Merge pull request #2592 from pwittrock/master
Fix kustomize docs "move to" links
2020-06-11 21:07:56 -07:00
Phillip Wittrock
60f826fb2d Generate kustomize docs -- update last modified 2020-06-11 20:54:46 -07:00
Phillip Wittrock
5d24062d42 Fix kustomize docs "move to" links 2020-06-11 20:46:25 -07:00
Jeff Regan
d553919dfb Merge pull request #2589 from pierreozoux/patch-1
Fixes markdown.
2020-06-11 16:52:32 -07:00
Jeff Regan
661743c7e5 Merge pull request #2576 from pwittrock/master
Use docsy site for kustomize docs
2020-06-11 11:54:02 -07:00
Jeff Regan
1dc22e3f0d Merge pull request #2579 from pietervincken/re-introduce-shallow-git-clones
Re-introduce shallow git clones for git based remote resources
2020-06-11 11:01:04 -07:00
Pierre Ozoux
808843457a Fixes markdown. 2020-06-11 10:46:29 +02:00
Phillip Wittrock
42497c664f Convert docs to docsy 2020-06-10 14:59:19 -07:00
Kubernetes Prow Robot
88cc78d5b7 Merge pull request #2578 from Liujingfang1/master
Add kustomize build flag --enable_managedby_label
2020-06-09 14:38:04 -07:00
Jeff Regan
9ac9a28db7 Merge pull request #2580 from haiyanmeng/remove-external-ip
Avoid exposing ElasticSearch DB over public IPs
2020-06-09 14:22:53 -07:00
Haiyan Meng
5cf0d887b1 Avoid exposing ElasticSearch DB over public IPs 2020-06-09 13:03:37 -07:00
Pieter Vincken
58c2df2dec fix: add the fetch head in the correct location 2020-06-09 20:22:28 +02:00
Jingfang Liu
1644fdd076 Add kustomize build flag --enable_managedby_label 2020-06-09 11:10:19 -07:00
Pieter Vincken
cd25740b61 fix: solve issues with tags not being loaded 2020-06-09 19:56:04 +02:00
Pieter Vincken
28045399f3 fix: add missing assignment 2020-06-09 16:57:01 +02:00
Pieter Vincken
e630334837 fix: re-add log outputs 2020-06-09 16:56:20 +02:00
Pieter Vincken
b97df057c1 feat: re-introduce shallow git clones
Making full git clones slows down the kustomize build significantly for big repositories.
2020-06-09 16:35:09 +02:00
Kubernetes Prow Robot
546a7386ff Merge pull request #2481 from Liujingfang1/master
support option for adding managed-by label
2020-06-08 13:47:47 -07:00
Jingfang Liu
4b117c4736 support option for adding managed-by label 2020-06-08 13:08:10 -07:00
Kubernetes Prow Robot
bc968d17e3 Merge pull request #2571 from pwittrock/release
Update kustomize to use latest version of cmd/config and cli-utils
2020-06-08 13:03:47 -07:00
Phillip Wittrock
51c2fe9742 Update kustomize to use latest version of cmd/config and cli-utils 2020-06-08 12:46:18 -07:00
Kubernetes Prow Robot
25a38ad2b6 Merge pull request #2573 from pankona/update-go-mod-to-use-go-1-14
Update go.mod to go 1.14
2020-06-08 10:09:49 -07:00
Kubernetes Prow Robot
8046efd261 Merge pull request #2575 from pwittrock/json
Add tests for reading json
2020-06-08 09:37:48 -07:00
Phillip Wittrock
9a4acba118 Add tests for reading json 2020-06-08 08:48:14 -07:00
pankona
d9d67e33e7 Run travis/check-go-mod.sh and make all 2020-06-08 16:25:52 +09:00
pankona
18d6a96f80 Update go.mod to use go 1.14 2020-06-08 16:25:35 +09:00
Kubernetes Prow Robot
458a7c532c Merge pull request #2567 from pwittrock/kubectl-krm
Refactor kustomize config command structure
2020-06-06 09:03:45 -07:00
Phillip Wittrock
701c217791 Refactor kustomize config command structure
- Create cfg, fn, live parent commands
2020-06-06 08:50:41 -07:00
Kubernetes Prow Robot
e042a22d0f Merge pull request #2570 from mortent/FixEmptyStringHandling
Treat empty strings as string type instead of null type
2020-06-05 15:23:46 -07:00
Morten Torkildsen
4fca00014c Treat empty strings as string type instead of null type 2020-06-05 15:04:18 -07:00
Jeff Regan
1c2eaa9d29 Merge pull request #2554 from quiye/ResMap
Fix length checking for ResMap resources
2020-06-05 14:06:37 -07:00
Kubernetes Prow Robot
1f32e89d95 Merge pull request #2560 from yutachaos/feature/added_numberonlytag_test_editset_image
Add test case when image tag is a number
2020-06-05 13:57:46 -07:00
Jeff Regan
b7a379604c Merge pull request #2568 from monopole/addTests
Add kustomize v3.6.1 e2e testing to prow tests
2020-06-05 13:46:14 -07:00
jregan
cea461e8f2 addTests 2020-06-05 13:24:56 -07:00
Kubernetes Prow Robot
73157c7141 Merge pull request #2562 from sunny0826/plugin-guided
add zh doc exec/go plugin
2020-06-05 10:23:44 -07:00
Kubernetes Prow Robot
72dc895c52 Merge pull request #2552 from pwittrock/krm
Write setter definitions to `Krmfile` instead of `kustomization`
2020-06-05 10:01:46 -07:00
Kubernetes Prow Robot
2aca65a126 Merge pull request #2565 from MadVikingGod/fix-windows
Fix windows builds.
2020-06-05 08:57:44 -07:00
Aaron Clawson
ac2e6990c3 Fix windows builds.
This updates golang.org/x/crypto to a version that has reverted the changes made because of a breaking api change in golang.org/x/sys.
2020-06-05 08:55:15 -05:00
guoxudong
8f0900f95e fix 2020-06-05 09:42:05 +08:00
Kubernetes Prow Robot
2549a8c6be Merge pull request #2558 from Shell32-Natsu/statefulset-name-in-hpa
Update StatefulSet ref name in HPA
2020-06-04 11:35:14 -07:00
yutachaos
88ebe1c73e Add test case when image tag is a number 2020-06-04 11:39:44 +09:00
quiye
08922cfe29 Fix length checking for ResMap resources 2020-06-04 08:37:44 +09:00
Kubernetes Prow Robot
952a2ebbf4 Merge pull request #2547 from dan-slinky-ckpd/patch-1
Update set.md examples to use correct field name
2020-06-03 14:08:43 -07:00
Phillip Wittrock
075846c731 Support initializing a directory with a Krmfile 2020-06-03 11:56:59 -07:00
Kubernetes Prow Robot
d531de6774 Merge pull request #2551 from phanimarupaka/NestedSubst
Nested substitutions
2020-06-03 10:56:11 -07:00
Kubernetes Prow Robot
cedcf3ac04 Merge pull request #2168 from pgpx/feature-kustomizationpatch
Implement "kind: Component" to support composition
2020-06-03 10:32:11 -07:00
guoxudong
8ce637a004 add zh doc exec/go plugin 2020-06-03 17:12:47 +08:00
Phani Teja Marupaka
10250286c7 Check for cycles during create-subst 2020-06-01 20:27:13 -07:00
Phani Teja Marupaka
a43d43f2c4 Nested substitutions 2020-06-01 20:27:02 -07:00
Donny Xia
8356979e1f Update StatefulSet ref name in HPA 2020-06-01 16:52:13 -07:00
Morten Torkildsen
46d9a8dc46 Merge pull request #2556 from mortent/releasecmdconf
release cmd/config
2020-06-01 12:52:53 -07:00
Morten Torkildsen
cb3854edaa release cmd/config 2020-06-01 12:33:34 -07:00
Kubernetes Prow Robot
083a266b0b Merge pull request #2555 from mortent/ReleaseKyaml
Release v0.1.13 of kyaml
2020-06-01 11:57:56 -07:00
Morten Torkildsen
d6fdf1c01a Release v0.1.13 of kyaml 2020-06-01 11:42:47 -07:00
Kubernetes Prow Robot
b679e33d47 Merge pull request #2545 from jijiew/addingFlags
Accept `set` value as flag or argument
2020-05-30 08:31:53 -07:00
Jijie Wei
e63b9ef825 update on util and comments 2020-05-29 16:23:10 -07:00
Jijie Wei
4b5b0dfdce rebase 2020-05-29 12:50:03 -07:00
Jijie Wei
572260c0f0 change args to use flags instead, so that values starting with hyphen can be correctly parsed. 2020-05-29 12:45:31 -07:00
Phillip Wittrock
0e5e2648b3 write krm metadata to Krmfile instead of Kustomization 2020-05-29 12:01:01 -07:00
Jeff Regan
144471ce78 Merge pull request #2550 from Shell32-Natsu/releasing-replace
Check replace in go.mod before releasing
2020-05-28 15:52:11 -07:00
Paul Martin
98cb7fc8cd Additional tests around reusing the same bases and components 2020-05-28 23:02:32 +01:00
Paul Martin
ca8e00fc15 Replace 'patch' with 'comp' in test data. 2020-05-28 23:02:32 +01:00
Paul Martin
93b0b1b0b1 Refactored Compontent tests to be table-driven 2020-05-28 23:02:32 +01:00
Paul Martin
34a442bbef Additional tests around reusing the same bases and components 2020-05-28 23:02:31 +01:00
Donny Xia
37918ae745 Check error from ioutil.TempDir in test 2020-05-28 13:02:46 -07:00
Donny Xia
dca164e967 More tests 2020-05-28 12:53:26 -07:00
Donny Xia
8ac2365406 Check replace in go.mod before releasing 2020-05-28 12:34:58 -07:00
Jeff Regan
c1a2bf14da Merge pull request #2548 from Shell32-Natsu/go-getter-doc
Add a note for go-getter
2020-05-28 11:38:24 -07:00
Donny Xia
a7af7df9cb Add a note for go-getter 2020-05-28 10:15:19 -07:00
Dan Slinky @ Cookpad
8d148c7ee4 Update set.md examples to use correct field name 2020-05-28 13:36:12 +01:00
Kubernetes Prow Robot
0b94a1405d Merge pull request #2544 from Shell32-Natsu/add-stringdata-to-encodesecret
Consider stringData when calculate secret hash
2020-05-27 17:22:02 -07:00
Kubernetes Prow Robot
b083187e6a Merge pull request #2509 from phanimarupaka/RefChange
Short hand notation for setters/subst
2020-05-27 14:36:02 -07:00
Donny Xia
4dcf81050e Consider stringData when calculate secret hash 2020-05-27 13:58:28 -07:00
Jeff Regan
c97fa946d5 Merge pull request #2543 from monopole/pinToApiv041
pin CLI to API v0.4.1
2020-05-27 13:44:51 -07:00
jregan
c35f5b0189 pin CLI to API v0.4.1 2020-05-27 13:32:22 -07:00
Jeff Regan
dd4aafe148 Merge pull request #2537 from Shell32-Natsu/fix-clone-hash
Fix git commit hash ignored
2020-05-27 13:22:08 -07:00
Jeff Regan
adb56abd99 Merge pull request #2542 from monopole/pinKustomizeToCmdKubectl_v0_1_0
pin kustomize to cmd/kubectl_v0_1_0
2020-05-27 12:36:44 -07:00
jregan
def978b334 pin kustomize to cmd/kubectl_v0_1_0 2020-05-27 12:20:39 -07:00
Phani Teja Marupaka
f7ca4fa106 Suggested Changes 2020-05-27 11:47:31 -07:00
Jeff Regan
ff7a7937c5 Merge pull request #2541 from monopole/pinToKStatus_v0_0_2
Pin to kstatus/v0.0.2
2020-05-27 11:13:15 -07:00
jregan
90c23026c2 Pin to kstatus/v0.0.2 2020-05-27 10:56:01 -07:00
Donny Xia
e5e4f33ac7 Fix go-getter 2020-05-26 17:42:31 -07:00
Donny Xia
5449dbc775 Fix git commit hash ignored 2020-05-26 14:44:37 -07:00
Kubernetes Prow Robot
52c5a9d380 Merge pull request #2490 from sunny0826/zh-docs
add zh docs plugins-builtions.md
2020-05-26 14:06:42 -07:00
Kubernetes Prow Robot
74d59f87c2 Merge pull request #2536 from Shell32-Natsu/merge-error-message
Improve error message for merge error
2020-05-26 13:54:41 -07:00
Phani Teja Marupaka
98ba8b7491 Change to create setter 2020-05-26 13:39:23 -07:00
Donny Xia
e05404f89c Improve error message for merge error 2020-05-26 10:12:33 -07:00
Jeff Regan
9e40cc177a Merge pull request #2532 from monopole/upgradeToV040
Upgrade CLI to API v0.4.0
2020-05-24 10:41:56 -07:00
jregan
315f7c6e7f Upgrade CLI to API v0.4.0 2020-05-24 10:28:30 -07:00
Jeff Regan
13eedd95f9 Merge pull request #2530 from monopole/deleteRace
Remove race in tests.
2020-05-23 18:22:22 -07:00
jregan
a193129920 Remove race in tests. 2020-05-23 17:51:32 -07:00
Jeff Regan
d2c205b082 Merge pull request #2529 from monopole/addLogging
Add logging.
2020-05-22 19:02:36 -07:00
jregan
02184dbfc5 Add logging. 2020-05-22 18:57:18 -07:00
Jeff Regan
5b1edcdd0e Merge pull request #2528 from monopole/makeInevitablePluginUtilsDir
Make plugin utils package.
2020-05-22 18:25:32 -07:00
jregan
b4f9e9ae56 Make plugin utils package. 2020-05-22 18:17:36 -07:00
Jeff Regan
a17022f7cc Merge pull request #2525 from mcristina422/tools
Add tools package, tidy go mods
2020-05-22 18:11:32 -07:00
Jeff Regan
615f36119e Merge pull request #2526 from mcristina422/patch-2
Add init as an alias to create
2020-05-22 18:02:53 -07:00
Michael Cristina
fd8c63772f Simplify install 2020-05-22 19:52:16 -05:00
Jeff Regan
07cfa207f1 Merge branch 'master' into tools 2020-05-22 17:39:40 -07:00
Jeff Regan
d1a3758c39 Merge pull request #2517 from prachirp/example-versions
Update examples versions
2020-05-22 17:37:40 -07:00
Jeff Regan
7de391e0d6 Merge pull request #2499 from Shell32-Natsu/release_script
Release program
2020-05-22 17:29:45 -07:00
Jeff Regan
c62a83c903 Merge pull request #2520 from pwittrock/actions
Run GitHub actions to test on MacOS and Windows
2020-05-22 17:20:13 -07:00
Jeff Regan
82a05738f0 kustomize api v0.4.0 2020-05-22 17:09:17 -07:00
Jeff Regan
e25651f250 Merge pull request #2527 from monopole/removeFlakyOptimization
Remove flakey test optimization.
2020-05-22 17:08:31 -07:00
jregan
75d8492c51 Remove flakey test optimization. 2020-05-22 16:58:03 -07:00
Michael Cristina
eba34f4071 Add init as an alias to create 2020-05-22 18:46:39 -05:00
Michael Cristina
823847d90a Add tools package, tidy go mods 2020-05-22 13:23:20 -05:00
Kubernetes Prow Robot
80dc4763bf Merge pull request #2522 from arrikto/master
Mark components example as WIP
2020-05-22 08:16:38 -07:00
Alex Pyrgiotis
589f274493 Mark components example as WIP
Since the required implementation for the components example has not
been merged yet, we must inform the users that this example is a work in
progress.

Signed-off-by: Alex Pyrgiotis <apyrgio@arrikto.com>
2020-05-22 08:29:18 +00:00
Phillip Wittrock
f63faca999 Test on windows and mac 2020-05-21 19:08:31 -07:00
Kubernetes Prow Robot
d596330a0a Merge pull request #2511 from pwittrock/windows
Fix cmd/config windows issues
2020-05-21 18:38:38 -07:00
Morten Torkildsen
31a3a08f53 Merge pull request #2519 from mortent/ReleaseCmdConfig
Release cmd/config
2020-05-21 17:59:31 -07:00
Jeff Regan
ffde2c452d Update execPluginGuidedExample.md
fix #2410
2020-05-21 17:48:32 -07:00
Morten Torkildsen
93bfb5b6f6 Release cmd/config 2020-05-21 17:36:24 -07:00
Phillip Wittrock
28c919912a Fix cmd/config windows issues 2020-05-21 16:53:24 -07:00
Jeff Regan
12d5ca68e9 Merge pull request #2516 from prachirp/patch-1
Add Cluster as not namespaceable kind
2020-05-21 15:46:35 -07:00
Prachi Pendse
847d415f50 Update examples versions 2020-05-21 15:30:14 -07:00
Morten Torkildsen
31d70c4ee2 Merge pull request #2515 from mortent/ReleaseKyamlCommand
Release kyaml
2020-05-21 15:01:20 -07:00
Prachi Pendse
06174fb52f Add Cluster as not namespaceable kind
The Cluster object from the clusterregistry api is always cluster scoped.
2020-05-21 14:31:18 -07:00
Morten Torkildsen
276270eb57 Release kyaml 2020-05-21 13:50:37 -07:00
Phani Teja Marupaka
b3f5874978 Short hand notation for set 2020-05-21 11:15:16 -07:00
Donny Xia
4b68425d86 Update readme for releasing 2020-05-21 10:07:51 -07:00
Donny Xia
4d88032e11 Add comments 2020-05-21 10:07:51 -07:00
Donny Xia
909bc25e12 Add tests for modulemeta and moduleversion 2020-05-21 10:07:51 -07:00
Donny Xia
2df3a7fc08 Refactor 2020-05-21 10:07:51 -07:00
Donny Xia
2b0b29aec5 Add flag for running test 2020-05-21 10:07:51 -07:00
Donny Xia
1dced55f60 Improve branch existence check 2020-05-21 10:07:51 -07:00
Donny Xia
68d6b9add6 Remove testing 2020-05-21 10:07:51 -07:00
Donny Xia
44f5093ae3 Add tests 2020-05-21 10:07:51 -07:00
Donny Xia
557cd656ab Finish pushing tag 2020-05-21 10:07:51 -07:00
Donny Xia
650f111e63 Add release command 2020-05-21 10:07:50 -07:00
Donny Xia
81da8f6f99 Update functions names 2020-05-21 10:07:50 -07:00
Donny Xia
32ed552ea6 List latest versions 2020-05-21 10:07:50 -07:00
Donny Xia
0b12f6c73d Add test 2020-05-21 10:07:50 -07:00
Donny Xia
cd3b87e483 Basic structure of releasing program 2020-05-21 10:07:50 -07:00
Jeff Regan
d616c9c315 Merge pull request #2510 from monopole/makeTestMoreRelocatable
Make a test more relocatable.
2020-05-20 17:08:59 -07:00
jregan
006953265f Make a test more relocatable. 2020-05-20 17:00:08 -07:00
Jeff Regan
4c520697fe Merge pull request #2508 from monopole/upgrade_kyaml_v0_1_11
Upgrade to kyaml v0.1.11
2020-05-20 16:00:32 -07:00
jregan
8f5a55f89b Upgrade to kyaml v0.1.11 2020-05-20 15:42:10 -07:00
Jeff Regan
c15fb14ccd Merge pull request #2507 from Liujingfang1/doc
complete TODOs in docs/readme
2020-05-20 15:19:29 -07:00
Jingfang Liu
24711f9fae complete TODOs in docs/readme 2020-05-20 13:33:58 -07:00
Jeff Regan
7db4996638 Merge pull request #2504 from monopole/hackGoSum
Automated fix to hack/go.sum
2020-05-20 09:02:29 -07:00
jregan
8efc528117 Automated fix to hack/go.sum 2020-05-20 08:51:28 -07:00
Jeff Regan
d48952451a Merge pull request #2505 from monopole/nondeterministic
Fix nondeterminstic failure
2020-05-20 08:45:56 -07:00
jregan
cf6fd30c73 Fix nondeterminstic failure 2020-05-20 08:30:30 -07:00
Kubernetes Prow Robot
f206241e2a Merge pull request #2503 from monopole/oops
Beef up test.
2020-05-19 19:16:19 -07:00
jregan
07b679955e Beef up test. 2020-05-19 18:26:37 -07:00
guoxudong
59f8f4ae14 fix 2020-05-20 09:25:31 +08:00
Kubernetes Prow Robot
33d72e9ae6 Merge pull request #2502 from monopole/testKustTarget
Add coverage for kusttarget.Load
2020-05-19 17:40:19 -07:00
jregan
e28af71b6f Add coverage for kusttarget.Load 2020-05-19 17:26:18 -07:00
Kubernetes Prow Robot
b738cc221c Merge pull request #2501 from pwittrock/windows
Address kyaml windows compatibility issues
2020-05-19 16:06:19 -07:00
Phillip Wittrock
f17cec0b3f Address kyaml windows compatibility issues 2020-05-19 15:44:30 -07:00
Paul Martin
ab9d4c7e7b Added test to ensure that individusal files cannot be added to the components list. 2020-05-19 19:26:18 +01:00
guoxudong
7bae481252 fix 2020-05-19 10:19:59 +08:00
Jeff Regan
765a4888df Merge pull request #2438 from apyrgio/feature-components-docs
Kustomize API Proposal: Add an example with components
2020-05-18 16:37:45 -07:00
Jeff Regan
f9822c014f Merge pull request #2468 from wendorf/numeric-common-labels
Test coverage for numeric-looking commonLabels strings
2020-05-18 14:06:23 -07:00
Kubernetes Prow Robot
1e36c1c74f Merge pull request #2496 from phanimarupaka/SchemaFileToOpenAPI
Add schema-path flag to input openAPI for setters
2020-05-18 11:25:36 -07:00
Paul Martin
c5c53011da PoC to add Components to a separate components list (instead of resources)
If this idea is preferred, the code could really do with a refactor (probably using closures to control the behaviour of accumulate directory)
2020-05-18 19:25:29 +01:00
Paul Martin
fdfb58cc3e Require version kustomize.config.k8s.io/v1alpha1 for Component 2020-05-18 19:25:29 +01:00
Paul Martin
1079d8604c Renamed KustomizationPatch to Component 2020-05-18 19:25:29 +01:00
Paul Martin
4454edc14c Implement "kind: KustomizationPatch" to support composition of Kustomize files 2020-05-18 19:25:29 +01:00
Kubernetes Prow Robot
7d5304928b Merge pull request #2495 from phanimarupaka/ValidateListValues
Validate list values against openAPI
2020-05-17 09:49:36 -07:00
Phani Teja Marupaka
bf17177270 Suggested Changes 2020-05-16 22:21:24 -07:00
Phani Teja Marupaka
2320c10463 Validate list values against openAPI 2020-05-16 22:01:11 -07:00
Phani Teja Marupaka
50cba50a8d Add schema-path flag to input openAPI for setters 2020-05-16 18:36:05 -07:00
Kubernetes Prow Robot
2eabe24896 Merge pull request #2480 from mortent/FormattingAnnotation
Add annotation for opting out of formatting
2020-05-15 15:01:37 -07:00
Morten Torkildsen
99b850555d Add annotation for opting out of formatting 2020-05-15 13:43:02 -07:00
Kubernetes Prow Robot
69e3c01cbf Merge pull request #2493 from pwittrock/master
kustomize transformers to create fields if they are null
2020-05-15 13:13:37 -07:00
Phillip Wittrock
77b5a4a215 kustomize transformers to create fields if they are null 2020-05-15 12:30:59 -07:00
Dan Wendorf
214b5bcfb9 Test coverage for numeric-looking commonLabels strings
There is a regression in 72c7db39f2 where
commonLabels that are numeric-looking strings lose their quotation,
changing the value type from string to integer. This will cause the
resource to fail validation.
2020-05-15 12:26:10 -07:00
Alex Pyrgiotis
e1087cdfbc Add a configMapGenerator to the example
Slightly alter the reCAPTCHA component to use a `configMapGenerator`,
instead of patching the base `ConfigMap` as in the rest of the
components, to show that this is supported as well.
2020-05-15 18:00:09 +00:00
Alex Pyrgiotis
844824e8e9 Incorporate the "components" suggestion
Incorporate the suggestion of the separate "components" field, that will
hold references to resources of `Component` kind. Also, add a missing
reference to the base, in the Kustomization files of the variants.
2020-05-15 15:04:17 +00:00
Alex Pyrgiotis
8d8773fc0e Add some missing overlay fields 2020-05-15 15:01:56 +00:00
guoxudong
bf71dce60c add zh docs plugins-builtions.md 2020-05-15 14:44:27 +08:00
Jeff Regan
66e889e4c1 Merge pull request #2489 from monopole/testExamplesAgainstHeadInProw
Test kustomize examples against head in prow presubmit.
2020-05-14 21:44:51 -07:00
jregan
ee2228c5fc Test kustomize examples against head in prow presubmit. 2020-05-14 21:17:13 -07:00
Kubernetes Prow Robot
dd3a79bcf7 Merge pull request #2487 from pwittrock/master
Quote yaml 1.1 non-string values for commonlabels and commonAnnotations
2020-05-14 19:54:59 -07:00
Jeff Regan
84ed659d8c Merge pull request #2488 from monopole/fixMake
Fix verify-kustomize target in Makefile
2020-05-14 19:34:01 -07:00
jregan
fbceeb1770 Fix verify-kustomize target in Makefile 2020-05-14 19:18:25 -07:00
Jeff Regan
a7b58257e1 Merge pull request #2486 from monopole/goModyTidyVerify
Automated ./hack/doGoMod.sh tidy;verify
2020-05-14 19:13:08 -07:00
Phillip Wittrock
b622306ff7 Quote yaml 1.1 non-string values for commonlabels and commonAnnotations 2020-05-14 19:05:41 -07:00
jregan
ee095371b8 Automated ./hack/doGoMod.sh tidy;verify 2020-05-14 18:50:04 -07:00
Jeff Regan
73cb596122 Merge pull request #2484 from monopole/moreLabellerTests
Add more labelling tests.
2020-05-14 18:13:15 -07:00
jregan
d0425791ca Add more labelling tests. 2020-05-14 17:54:13 -07:00
Jeff Regan
bacb9e2249 Merge pull request #2482 from monopole/fixMkdirMinusP
Fix mkdir -p problem in example
2020-05-14 17:35:34 -07:00
Kubernetes Prow Robot
c0c70b26d1 Merge pull request #2483 from pwittrock/master
release kyaml and cmd/config
2020-05-14 17:30:59 -07:00
Phillip Wittrock
6837d1f196 release kyaml and cmd/config 2020-05-14 17:10:01 -07:00
jregan
f247955942 Fix mkdir -p problem in example 2020-05-14 17:07:02 -07:00
Kubernetes Prow Robot
f7f0923375 Merge pull request #2470 from pwittrock/master
Support publishing starlark functions from urls
2020-05-14 14:44:58 -07:00
Kubernetes Prow Robot
d1556837e1 Merge pull request #2478 from phanimarupaka/ValidateSubstitutionsOpenAPI
Validate substitutions against openAPI
2020-05-14 14:20:58 -07:00
Phani Teja Marupaka
7c731f0109 Validate substitutions against openAPI 2020-05-14 14:00:58 -07:00
Kubernetes Prow Robot
ff125b8c6c Merge pull request #2473 from pwittrock/fix
Set common labels and annotations as strings
2020-05-14 12:00:58 -07:00
Kubernetes Prow Robot
9a4927607d Merge pull request #2471 from phanimarupaka/OpenAPIValidations
Validate setters against openAPI
2020-05-14 11:42:23 -07:00
Ioannis Androulidakis
6951623dd0 Rename KustomizationPatch to Component
The main change in this commit is that we rename the
`KustomizationPatch` kind to `Component`, and use the appropriate group
and API version (`kustomize.config.k8s.io/v1alpha1`).
2020-05-14 14:11:47 +00:00
Phani Teja Marupaka
eb7602fe19 Validate setters against openAPI 2020-05-13 21:34:28 -07:00
Jeff Regan
a1def720cc Update valueAdd.md 2020-05-13 17:02:12 -07:00
Phillip Wittrock
0866e2a54b Set common labels and annotations as strings 2020-05-13 16:58:38 -07:00
Jeff Regan
99933bf571 Update valueAdd.md 2020-05-13 16:38:16 -07:00
Kubernetes Prow Robot
b1fbf1958d Merge pull request #2432 from tamalsaha/fix-marshal
Fix MarshalJSON of array
2020-05-13 16:22:22 -07:00
Tamal Saha
e3971ffbff Fix linter warning
Signed-off-by: Tamal Saha <tamal@appscode.com>
2020-05-13 13:34:24 -07:00
Tamal Saha
802d79ae32 Fix MarshalJSON of array
Signed-off-by: Tamal Saha <tamal@appscode.com>
2020-05-13 13:32:19 -07:00
Phillip Wittrock
6ae53cb732 Support publishing starlark functions from urls 2020-05-13 11:36:49 -07:00
Kubernetes Prow Robot
0a8d367633 Merge pull request #2469 from pwittrock/gomod
unpin kyaml for cmd/config
2020-05-13 11:22:27 -07:00
Phillip Wittrock
75cba52f60 unpin kyaml for cmd/config 2020-05-13 11:10:26 -07:00
Alex Pyrgiotis
5884290fff Set API version of KustomizationPatch to v1alpha1
Rename all `KustomizationPatch` instances to
`v1alpha1/KustomizationPatch`, to reflect that it's an alpha feature.
2020-05-13 14:05:30 +00:00
Ioannis Androulidakis
0152dbb0dc Extend example with components
Describe in more detail the solution with stock kustomize variants to
better showcase the benefits of kustomize components.

Plus, revamp certain parts of the example with minor fixes.
2020-05-13 13:58:55 +00:00
Kubernetes Prow Robot
5d7269968a Merge pull request #2456 from sunny0826/zh-docs
Add plugins zh docs
2020-05-12 18:22:26 -07:00
Jeff Regan
a0b997308a Merge pull request #2461 from breun/macports
Add install command for MacPorts user
2020-05-12 15:50:11 -07:00
Kubernetes Prow Robot
aa95c9a773 Merge pull request #2465 from pwittrock/save-comments
Copy comments from function inputs to function outputs.
2020-05-12 15:46:26 -07:00
Phillip Wittrock
5907c9e141 Copy comments from function inputs to function outputs. 2020-05-12 15:07:43 -07:00
Kubernetes Prow Robot
266af31bcb Merge pull request #2463 from pwittrock/master
Migrate examples on to go fn framework
2020-05-12 14:18:21 -07:00
Kubernetes Prow Robot
988afcb82d Merge pull request #2442 from phanimarupaka/AddMaintainer
Add maintainer
2020-05-12 11:16:21 -07:00
Jeff Regan
ec96854186 Merge pull request #2449 from mcristina422/patch-1
add missing required key in example
2020-05-12 10:33:00 -07:00
Jeff Regan
26a6c8e47a Merge pull request #2459 from asadali/change-mutating-webhook-order
Relative Order of Mutating/Validating WebhookConfigs
2020-05-12 10:32:09 -07:00
Phillip Wittrock
d5666c4ff4 Migrate examples on to go fn framework 2020-05-12 10:11:56 -07:00
Nils Breunese
ec43561c2d Add install command for MacPorts user 2020-05-12 18:41:33 +02:00
guoxudong
4faf00b928 Merge branch 'zh-docs' of https://github.com/sunny0826/kustomize into zh-docs 2020-05-12 14:13:55 +08:00
guoxudong
4b78440c59 add zh docs plugins.md 2020-05-12 14:13:12 +08:00
guoxudong
aafe6b0260 fix 2020-05-12 09:17:13 +08:00
Asad Ali
74b45392fc Relative Order of Mutating/Validating WebhookConfigs
MutatingWebhookConfig may have similar dependencies as the
ValidatingWebhookConfig. eg. a k8s cluster service. Therefore, it should
be ordered last as well.

This PR preserves the implicit ordering between CustomResources and the
webhook while introducing a relative order between the two webhooks.
i.e. MutatingWebhook should be created prior to the ValidatingWebhook

The change is an enhancement of #1104
2020-05-11 13:08:07 -07:00
Jeff Regan
f8ef55eeac Update valueAdd.md 2020-05-11 10:56:49 -07:00
Jeff Regan
897e7b6e61 Merge pull request #2458 from monopole/updateBuildScripts
Update build scripts
2020-05-11 09:42:46 -07:00
Jeffrey Regan
70b1cfef4a Update build scripts 2020-05-11 09:40:54 -07:00
Jeff Regan
4c9cc343cd Merge pull request #2457 from monopole/pinToApiV033
Pin kustomize CLI to kustomize API v0.3.3
2020-05-11 08:48:11 -07:00
jregan
5213426f0a Pin kustomize to api v0.3.3 2020-05-11 08:33:23 -07:00
guoxudong
5e22d9fedb fix 2020-05-11 10:44:45 +08:00
guoxudong
a5cdc6c912 fix 2020-05-11 10:38:56 +08:00
guoxudong
6a32d8ac42 add zh docs plugins.md 2020-05-11 10:36:22 +08:00
Jeff Regan
abb9d5a5b1 Merge pull request #2455 from monopole/add6902
Introduce ValueAddTransformer.
2020-05-10 18:23:29 -07:00
jregan
e54455705d ValueAddTransformer 2020-05-10 17:49:46 -07:00
Jeff Regan
c39cf55509 Merge pull request #2454 from monopole/valueAddFilter
add value add filter
2020-05-10 17:12:27 -07:00
jregan
1a89d09f40 add value add filter 2020-05-10 16:59:43 -07:00
Jeff Regan
4ee126c840 Merge pull request #2453 from monopole/defineNamespaceField
Define global const for metadata/namespace field
2020-05-09 18:39:03 -07:00
jregan
39cb87cf2b Define global const for metadata/namespace field 2020-05-09 18:00:26 -07:00
Jeff Regan
3c6d3845ec Merge pull request #2452 from monopole/filePathJoin
Add filesys.InsertPathPart function
2020-05-09 17:39:04 -07:00
jregan
51e3e0ff29 add filesys.InsertPathPart function 2020-05-09 17:21:31 -07:00
Jeff Regan
5c382b3c57 Merge pull request #2451 from monopole/upgradeKyaml
Upgrade to latest kyaml, cmd/config
2020-05-09 16:53:07 -07:00
jregan
065f70705d Upgrade to latest kyaml, cmd/config 2020-05-09 16:31:24 -07:00
Michael Cristina
a3fba0cb07 add missing required key in example 2020-05-09 10:11:14 -05:00
Kubernetes Prow Robot
77fa5c2921 Merge pull request #2447 from pwittrock/release
update cmd/config e2e tests with new go function framework
2020-05-08 09:21:42 -07:00
Phillip Wittrock
cc84eb108d update cmd/config e2e tests with new go function framework 2020-05-08 09:10:15 -07:00
Kubernetes Prow Robot
2409845437 Merge pull request #2446 from pwittrock/release
release kyaml and cmd/config v0.1.10
2020-05-08 09:05:43 -07:00
Phillip Wittrock
83c7c29132 release kyaml and cmd/config v0.1.10 2020-05-08 08:51:54 -07:00
Kubernetes Prow Robot
7a03fe7353 Merge pull request #2445 from pwittrock/release
UX improvements to kyaml/fn/framework
2020-05-08 08:23:42 -07:00
Phillip Wittrock
5bae01fa68 UX improvements to kyaml/fn/framework 2020-05-07 22:03:12 -07:00
Kubernetes Prow Robot
9d6bbfb38a Merge pull request #2437 from phanimarupaka/ValidationSubstName
Avoid Setter and Substitution with same name
2020-05-07 14:09:42 -07:00
Kubernetes Prow Robot
dac97f6aeb Merge pull request #2439 from phanimarupaka/ListSubstitions
List substitutions
2020-05-07 13:55:42 -07:00
phani
1494cd3702 Merge branch 'master' into ListSubstitions 2020-05-07 13:38:18 -07:00
Kubernetes Prow Robot
3dfc76b769 Merge pull request #2436 from pwittrock/exec
Refactor function runtimes into a single package
2020-05-07 13:33:42 -07:00
Phillip Wittrock
dab0f3cf22 Add documentation and simplify framework 2020-05-07 12:51:02 -07:00
Kubernetes Prow Robot
8d5fc2f281 Merge pull request #2397 from sunny0826/docs
Update zh docs
2020-05-07 10:43:09 -07:00
Kubernetes Prow Robot
9b26390d92 Merge pull request #2433 from webwurst/patch-2
Fix typo
2020-05-06 13:33:08 -07:00
Phani Teja Marupaka
7309a5cb06 Suggested Changes 2020-05-06 12:38:12 -07:00
Kubernetes Prow Robot
099b6ff460 Merge pull request #2441 from phanimarupaka/DoNotModifyCM
Do not modify CM and Secrets Generator
2020-05-06 12:21:09 -07:00
Phani Teja Marupaka
eb86d6a2d7 Add maintainer 2020-05-06 10:47:05 -07:00
Phani Teja Marupaka
7d600c1c5a Do not modify CM and Secrets Generator 2020-05-06 09:38:33 -07:00
Phillip Wittrock
259624ac07 run e2e tests in GitHub Actions CI 2020-05-06 08:59:54 -07:00
Phillip Wittrock
d16d1f81b0 add starlark e2e tests 2020-05-06 08:59:54 -07:00
Phillip Wittrock
b3ff51b9bc Add warnings for exec functions 2020-05-06 08:59:54 -07:00
Phillip Wittrock
c9f50745ff e2e tests for functions 2020-05-06 08:59:54 -07:00
Phillip Wittrock
95f0a44fc0 Enable exec functions (Alpha) 2020-05-06 08:59:54 -07:00
Phillip Wittrock
174b2ed62e Refactor starlark runtime ontop of runtimeutil 2020-05-06 08:16:14 -07:00
Phillip Wittrock
594c48d19a Refactor container function runtime into its own package 2020-05-06 08:16:14 -07:00
Phillip Wittrock
096ad8c95c Exec function implementation 2020-05-06 08:16:14 -07:00
Phillip Wittrock
fd70213ca2 Create shared functions filter library 2020-05-06 08:16:14 -07:00
Jeff Regan
212ec66e91 Merge pull request #2440 from kubernetes-sigs/pwittrock-patch-1
Create go.yml
2020-05-06 07:58:45 -07:00
Phillip Wittrock
02235007e1 Create go.yml 2020-05-06 07:52:18 -07:00
Alex Pyrgiotis
6063a6bde8 Add an example with components
Add a WIP example that showcases how components can be used.
2020-05-06 07:44:21 +00:00
Phani Teja Marupaka
6d92608877 List substitutions 2020-05-05 20:51:46 -07:00
Phani Teja Marupaka
e771902a07 Avoid Setter and Substitution with same name 2020-05-05 14:47:28 -07:00
Tobias Bradtke
2ce66c0a85 Fix typo 2020-05-03 01:23:46 +02:00
Kubernetes Prow Robot
f7909fad71 Merge pull request #2429 from pwittrock/framework
Better support for writing functions in go
2020-05-01 12:06:29 -07:00
Kubernetes Prow Robot
5e00158b00 Merge pull request #2430 from monopole/versionBump
kyaml 0.1.8, cmd/config 0.1.7
2020-04-30 16:06:06 -07:00
Jeffrey Regan
218880cdd9 kyaml 0.1.8, cmd/config 0.1.7 2020-04-30 15:51:49 -07:00
Jeff Regan
31e5ab1e6d Merge pull request #2428 from thephw/update-exampe-tests-link-in-docs
Update link to travis pre-commit hook in docs
2020-04-30 15:44:47 -07:00
Jeff Regan
a9e998d27d Merge pull request #2424 from monopole/fixErrorMessage
Improve config failure error message.
2020-04-30 15:41:04 -07:00
Phillip Wittrock
b579bf2b03 Better support for writing functions in go 2020-04-30 13:33:56 -07:00
Patrick Wiseman
cae8fd0013 Update link to travis pre-commit hook in docs 2020-04-30 12:03:47 -04:00
jregan
de9f80c41b Improve config failure error message. 2020-04-29 19:42:56 -07:00
Jeff Regan
085b64cde4 Merge pull request #2423 from justinsb/fix_mergefilter_docs
Fix godocs on MergeFilter
2020-04-29 15:36:29 -07:00
Jeff Regan
0abad97de3 Merge pull request #2419 from phanimarupaka/SettersNameForSubst
Simplify substitutions
2020-04-29 12:46:39 -07:00
Phani Teja Marupaka
a2f2cc6a85 Create setter with marker as name for subst 2020-04-29 12:20:38 -07:00
Justin SB
028811eb97 Fix godocs on MergeFilter
It was copy-pasted from GrepFilter
2020-04-29 14:13:15 -04:00
Jeff Regan
d67c03af12 Merge pull request #2421 from Shell32-Natsu/2392-codeClean
Remove inventory transformer
2020-04-29 11:03:54 -07:00
Jeff Regan
c95a89c1f1 Merge pull request #2422 from muenchdo/test/merge-env-from
add test to demonstrate kubernetes-sigs/kustomize#1835
2020-04-29 10:54:16 -07:00
Dominik Münch
499246a4a4 add test to demonstrate kubernetes-sigs/kustomize#1835 2020-04-29 09:27:23 +02:00
Jeff Regan
bd3d413ffd Merge pull request #2420 from ian-howell/replaceVars-panic
Fix a panic when doing variable replacement.
2020-04-28 11:25:42 -07:00
Donny Xia
9195f05bba Update document 2020-04-28 17:36:44 +00:00
Donny Xia
63f7495e88 Remove inventory transformer #2392 2020-04-28 17:36:44 +00:00
guoxudong
6994e41eb3 fix 2020-04-28 14:17:03 +08:00
Ian Howell
1d46edccb5 Fix a panic when doing variable replacement.
This fixes an issue where Kustomize expects a []string, but gets a slice
of something else instead, which causing a runtime panic.

This fixes 2241
2020-04-27 15:54:04 -05:00
Jeff Regan
c771f24626 Merge pull request #2389 from webwurst/patch-1
Fix formating of example
2020-04-27 10:44:33 -07:00
Kubernetes Prow Robot
3e6b5918a2 Merge pull request #2418 from monopole/annotationTransformer
Remove MapTransformer.
2020-04-25 14:59:28 -07:00
jregan
7feb873ef6 Remove MapTransformer. 2020-04-25 13:27:01 -07:00
Jeff Regan
3c72a93c21 Merge pull request #2417 from monopole/fixBuild
Disable flaky git diff checks.
2020-04-25 12:52:23 -07:00
jregan
f07cae82b0 Disable flakey git diff checks. 2020-04-25 12:37:10 -07:00
Jeff Regan
2b48c4b08d Merge pull request #2416 from aodinokov/finalize_helm_v3_support
Finalize helm v3 support
2020-04-25 12:34:01 -07:00
Alexey Odinokov
855b2c3171 Polishing helmV3 related changes
Enabled HelmV3 related test,
Made sure HelmV2 and HelmV3 UT pass,
Pinned Chart version as per TODO note
Removed accomplished TODOs
2020-04-25 04:58:14 +00:00
Jeff Regan
82f20da46e Merge pull request #2414 from monopole/migrateLabelTransformer
Migrate label transformer
2020-04-24 18:12:44 -07:00
jregan
72c7db39f2 Migrate the label transformer. 2020-04-24 17:39:52 -07:00
jregan
c852bb00f2 Special treatment for core apiVersions. 2020-04-24 15:40:44 -07:00
Jeff Regan
a5db82e3a0 Merge pull request #2411 from monopole/moarTests
More GVK tests before GV treatment changes.
2020-04-24 15:35:22 -07:00
jregan
0636368c8c More GVK tests before GV treatment changes. 2020-04-24 15:10:59 -07:00
Jeff Regan
3516bf1bb1 Merge pull request #2409 from monopole/apiVersionExtractions
Isolate apiVersion parsing.
2020-04-24 14:17:28 -07:00
jregan
d5ba8533fa Isolate apiVersion parsing. 2020-04-24 13:56:41 -07:00
Alexey Odinokov
40db077d3d updated test for helmV3 2020-04-24 05:51:23 +00:00
Alexey Odinokov
d4d95012c7 Added needed calls for HelmV3 2020-04-24 05:14:08 +00:00
Kubernetes Prow Robot
99b15004dd Merge pull request #2406 from monopole/upgradeTests
Bug hunting; add more tests high and low.
2020-04-23 17:14:07 -07:00
jregan
c777a3805d Bug hunting; add more tests high and low. 2020-04-23 16:52:12 -07:00
Kubernetes Prow Robot
52facc13ed Merge pull request #2404 from monopole/goVersion14
Adjust scripts to allow either Go v.13 or Go v1.14
2020-04-22 19:09:45 -07:00
jregan
53e7c87604 Adjust scripts to be go v1.14 compatible 2020-04-22 18:34:15 -07:00
Kubernetes Prow Robot
8618613325 Merge pull request #2402 from pwittrock/validation-spec
release kyaml and cmd/config
2020-04-22 15:19:44 -07:00
Jeff Regan
59b1662b92 Merge pull request #2401 from monopole/fixBuild
Fix broken Makefiles.
2020-04-22 13:43:58 -07:00
jregan
efeb26c634 Fix broken Makefiles. 2020-04-22 13:30:39 -07:00
Jeff Regan
e287d68d0f Merge pull request #2403 from monopole/removeGuess
Remove time guessing.
2020-04-22 13:30:09 -07:00
jregan
3786db2dba Remove time guessing. 2020-04-22 13:20:10 -07:00
Phillip Wittrock
46316198cb release kyaml and cmd/config 2020-04-22 13:08:19 -07:00
Kubernetes Prow Robot
243394002f Merge pull request #2391 from pwittrock/validation-spec
Allow declaratively running starlark functions
2020-04-22 09:27:53 -07:00
guoxudong
60f3ca6f70 update:docs/zh/README.md 2020-04-22 17:00:16 +08:00
guoxudong
5e9619d3fb update:docs/zh/fields.md 2020-04-22 16:44:50 +08:00
Jeff Regan
b9053655db Merge pull request #2395 from monopole/checkForProwNotTravis
Check for prow, not travis, in CI test.
2020-04-21 21:19:45 -07:00
jregan
1f35b37712 Check for prow, not travis, in CI test. 2020-04-21 21:09:09 -07:00
Kubernetes Prow Robot
d7484aacad Merge pull request #2394 from monopole/installHelm3
Start adding helm3 to ChartInflator and its coverage.
2020-04-21 21:03:51 -07:00
jregan
98414e8bf6 Start adding helm3 to ChartInflator and its coverage. 2020-04-21 20:45:19 -07:00
Phillip Wittrock
c1f2dd3688 Allow declaratively running starlark functions 2020-04-21 14:51:15 -07:00
Jeff Regan
982b9e77d4 Merge pull request #2372 from phanimarupaka/GitDiffForUpdate
Print file difference like git diff
2020-04-21 11:16:36 -07:00
Kubernetes Prow Robot
c75a47322b Merge pull request #2388 from monopole/removeStaticCling
Remove static cling in plugin development flow.
2020-04-20 12:13:40 -07:00
Jeff Regan
bb05d19a5a Merge pull request #2383 from novalagung/master
Issue #2381 - bug fix for unmodified `found` variable
2020-04-20 10:41:20 -07:00
Tobias Bradtke
8c18970b56 Fix formating of example 2020-04-20 18:33:22 +02:00
jregan
2c615d78a2 Remove static cling in plugin development flow. 2020-04-20 08:29:01 -07:00
Jeff Regan
45a9805656 Merge pull request #2387 from monopole/splitOutCompilerUtils
Add compiler utils test.
2020-04-19 17:56:38 -07:00
jregan
504029281a Add compiler utils test. 2020-04-19 17:44:01 -07:00
Jeff Regan
2d699f93fc Merge pull request #2385 from monopole/pluginLoader
Plugin flow doc improvements and a new option for the plugin loader
2020-04-18 19:45:16 -07:00
jregan
1653a70693 Plugin loader improvements. 2020-04-18 18:29:10 -07:00
Kubernetes Prow Robot
4667372114 Merge pull request #2384 from pwittrock/validation-spec
Enable functions to defer failures
2020-04-17 21:43:35 -07:00
Phillip Wittrock
6d9702561a Enable functions to defer failures
so multiple validators can be run sequentially without shortcircuiting the pipeline
2020-04-17 20:27:58 -07:00
novalagung
4533e43009 Issue #2381 - bug fix for unmodified found variable 2020-04-18 04:06:54 +07:00
Kubernetes Prow Robot
c7b00733c1 Merge pull request #2382 from pwittrock/release
release cmd/config and kyaml
2020-04-17 11:03:07 -07:00
Phillip Wittrock
b023570fae release cmd/config and kyaml 2020-04-17 09:51:59 -07:00
Kubernetes Prow Robot
8c315ab874 Merge pull request #2362 from pwittrock/validation-spec
Support for serializing ResourceList.results field from functions
2020-04-17 09:23:06 -07:00
Phani Teja Marupaka
014db05f9c Print file difference like git diff 2020-04-16 12:31:00 -07:00
Kubernetes Prow Robot
d8f601248b Merge pull request #2377 from monopole/patchReadability
PatchTransformer readability mods and another test.
2020-04-16 10:46:46 -07:00
Jeffrey Regan
9c75afca58 PatchTransfomer readability mods. 2020-04-15 18:48:59 -07:00
Jeff Regan
8f2f2c201f Merge pull request #2376 from monopole/updateDeps
Update deps (autogenerated)
2020-04-15 17:49:55 -07:00
Jeffrey Regan
e66235f380 Update deps. 2020-04-15 17:12:25 -07:00
Jeff Regan
636167ac7f Merge pull request #2359 from mortent/PatchTransformerFilter
Update PatchTransformer to use kyaml filters
2020-04-15 17:11:29 -07:00
Kubernetes Prow Robot
4eac2b10d6 Merge pull request #2373 from monopole/addGeneratorTest
Add coverage to the disable name hash option in generators.
2020-04-15 16:18:45 -07:00
Jeffrey Regan
d15a573544 Add Generator Test 2020-04-15 16:00:06 -07:00
Phillip Wittrock
8d22cbdcca Support writing results from container filter 2020-04-15 08:01:49 -07:00
Phillip Wittrock
b72db9e783 ByteReader/Writer support for serializing ResourceList.results field 2020-04-14 12:59:46 -07:00
Kubernetes Prow Robot
a446a4f4fe Merge pull request #2354 from phanimarupaka/KustomizeOpenApi
Kustomization openapi ConfigMapGenerator and SecretGenerator
2020-04-14 10:48:13 -07:00
Phani Teja Marupaka
f81d766584 Kustomization openapi 2020-04-13 23:21:17 -07:00
Morten Torkildsen
ef592606a0 Update PatchTransformer to use kyaml filters 2020-04-13 21:25:02 -07:00
Kubernetes Prow Robot
4e322fb501 Merge pull request #2363 from monopole/moarPatchTransformerCoverage
Add more patch transformer coverage.
2020-04-10 19:35:47 -07:00
jregan
b1e48a46c7 Add more patch transformer coverage. 2020-04-10 18:21:12 -07:00
Jeff Regan
83700461fc Merge pull request #2361 from mortent/PatchTransformerFilterTest
Update tests for PatchTransformer
2020-04-10 18:04:33 -07:00
Kubernetes Prow Robot
853181e36f Merge pull request #2360 from monopole/updateDocs
More documentation for  field.
2020-04-10 17:49:47 -07:00
Morten Torkildsen
e7e7648c55 Update tests for PatchTransformer 2020-04-10 16:12:53 -07:00
jregan
20643c933e More documentation for field. 2020-04-10 13:54:25 -07:00
Kubernetes Prow Robot
0227582684 Merge pull request #2357 from monopole/refactorGeneratorArgs
Define hash suffix behavior in the presence of multiple GeneratorOptions.
2020-04-10 11:15:47 -07:00
jregan
c4db0f9a60 checkpoint 2020-04-10 11:01:31 -07:00
Jeff Regan
5479d32aa3 Merge pull request #2353 from kubernetes-sigs/prowBadge
Show prow build instead of deprecated travis
2020-04-09 19:49:33 -07:00
Jeff Regan
6aabe72fce Merge pull request #2352 from monopole/unpinPlugins
Unpin the plugins (i.e. point them to head).
2020-04-08 19:55:38 -07:00
Jeff Regan
ee110a8e02 Show prow build instead of deprecated travis 2020-04-08 18:29:57 -07:00
jregan
65b6e1c2bb Unpin the plugins (i.e. point them to head). 2020-04-08 18:01:10 -07:00
Jeff Regan
826da4b19e Merge pull request #2344 from mortent/patchJson6902
Add json6902 patch filter based on kyaml libraries
2020-04-08 13:10:11 -07:00
Kubernetes Prow Robot
630ac1b318 Merge pull request #2350 from pwittrock/comments
fix copy comments to include document comments
2020-04-08 10:53:44 -07:00
Phillip Wittrock
23589cc2af fix copy comments to include document comments 2020-04-08 09:16:43 -07:00
Kubernetes Prow Robot
b349351e6e Merge pull request #2343 from phanimarupaka/DetectMergeConflicts
Copy file from source to destination
2020-04-07 12:47:44 -07:00
Phani Teja Marupaka
7bddd14419 Copyfile 2020-04-07 12:17:07 -07:00
Kubernetes Prow Robot
894e21acbf Merge pull request #2341 from pwittrock/master
Fix program path in runfn
2020-04-07 10:03:44 -07:00
Morten Torkildsen
524d672307 Update go mudules dependencies 2020-04-07 09:57:45 -07:00
Morten Torkildsen
d051588789 Add json6902 patch filter based on kyaml libraries 2020-04-06 18:59:10 -07:00
Kubernetes Prow Robot
ea807fcdcc Merge pull request #2342 from monopole/fieldNameChange
Remove use of patchjson6902 field.
2020-04-06 17:37:19 -07:00
Jeffrey Regan
a7f0af939b Remove use of patchjson6902 field. 2020-04-06 17:23:55 -07:00
Phillip Wittrock
4f926df7cf Fix path in runfn
- Calculate path relative to the functionConfig file
- Do not allow absolute paths or traversal to parent directories
2020-04-06 16:53:20 -07:00
Jeff Regan
1dad3f0975 Update patchMultipleObjects.md 2020-04-06 16:34:20 -07:00
Jeff Regan
885a9db52e Update jsonpatch.md 2020-04-06 16:33:53 -07:00
Jeff Regan
8d40ead9b7 Merge pull request #2338 from monopole/multiPatchDemo
Better multi-patch demo.
2020-04-06 16:30:47 -07:00
Jeffrey Regan
86bcb47b7d Better multi-patch demo. 2020-04-06 16:16:44 -07:00
Kubernetes Prow Robot
f08594cc22 Merge pull request #2337 from mortent/releaseKyaml
release kyaml 0.1.5
2020-04-06 15:43:48 -07:00
Morten Torkildsen
56b6fa90b3 release kyaml 0.1.5 2020-04-06 15:25:51 -07:00
Jeff Regan
292d950465 Merge pull request #2336 from mortent/AddMortentAsMaintainer
Add mortent to the maintainers list
2020-04-06 10:17:21 -07:00
Morten Torkildsen
ee431f755c Add mortent to the maintainers list 2020-04-06 10:12:26 -07:00
Kubernetes Prow Robot
e00d0b98de Merge pull request #2229 from boylee1111/boyil/priorityclass_ref
Add namereference for PriorityClass
2020-04-06 08:51:47 -07:00
Kubernetes Prow Robot
a8b9741866 Merge pull request #2331 from monopole/moreExamplesInJsonPatch
Improve json6902 patch example.
2020-04-05 16:36:09 -07:00
Kubernetes Prow Robot
7855031ecc Merge pull request #2330 from phanimarupaka/RemoveFormatFilterForUpdate
Remove format filter for merge
2020-04-05 16:36:01 -07:00
Kubernetes Prow Robot
e12d57e6f2 Merge pull request #2327 from mortent/StrategicMergeTransformer
Add strategic merge patch filter based on kyaml libraries
2020-04-05 16:35:54 -07:00
Kubernetes Prow Robot
0d2ae19c80 Merge pull request #2306 from mortent/imageTagFilter
Add imagetag filter based on kayml libraries
2020-04-05 16:35:46 -07:00
Kubernetes Prow Robot
804cf6d71c Merge pull request #2326 from ian-howell/export-noFieldError
Export noFieldError
2020-04-05 16:19:46 -07:00
Kubernetes Prow Robot
e342b68f0a Merge pull request #2334 from mortent/FixKyamlJson
Fix issue with kyaml json unmarshalling
2020-04-05 15:51:46 -07:00
Morten Torkildsen
022805b56b Fix issue with kyaml json unmarshalling 2020-04-04 20:39:29 -07:00
Jeffrey Regan
eb57d4b510 Improve json patch example. 2020-04-03 18:34:02 -07:00
Phani Teja Marupaka
a5a51ba76a Remove format filter for update 2020-04-03 15:24:10 -07:00
Morten Torkildsen
32efef71f4 Add imagetag filter based on kayml libraries 2020-04-03 15:00:09 -07:00
Morten Torkildsen
98c08b2b66 Add strategic merge patch filter based on kyaml libraries 2020-04-03 13:56:20 -07:00
Ian Howell
5ea34b2efb Export noFieldError
This would allow user's of the kustomize API to determine whether the
error received while trying to access a value at a specific field-path
occurred because that field doesn't exist, or if it was something else
that went wrong.
2020-04-03 14:22:14 -05:00
Jeff Regan
0f3d5c80e4 Merge pull request #2324 from mortent/BetterTransformerTesting
Better support for testing tranformers with kyaml support
2020-04-03 08:28:29 -07:00
Morten Torkildsen
cabaccb9fd Better support for testing tranformers with kyaml support 2020-04-02 17:00:34 -07:00
Kubernetes Prow Robot
4d1fe6678f Merge pull request #2319 from pwittrock/master
Implement json marshal / unmarshal for RNode
2020-04-02 16:33:46 -07:00
Kubernetes Prow Robot
04af0e6648 Merge pull request #2320 from pwittrock/starlark
Import environment and openAPI into starlark fn runtime
2020-04-02 14:29:05 -07:00
Kubernetes Prow Robot
7a696ef616 Merge pull request #2312 from prachirp/volume
Support mounting volumes to containers
2020-04-02 14:13:04 -07:00
Phillip Wittrock
691c11d520 Import environment and openAPI into starlark fn runtime 2020-04-02 12:35:47 -07:00
Prachi Pendse
109ffdaec5 Update parsing of StringToStorageMount to use SplitN 2020-04-02 12:12:27 -07:00
Kubernetes Prow Robot
aac1b7dc24 Merge pull request #2323 from pwittrock/release
release kyaml 0.1.4
2020-04-02 11:42:25 -07:00
Phillip Wittrock
96782d9584 release kyaml 0.1.4 2020-04-02 11:32:25 -07:00
Prachi Pendse
b17ea88bf7 Update mount flag to match docker docs
- Also modify TODO in validator-kubeval example
2020-04-02 11:20:32 -07:00
Kubernetes Prow Robot
091964c2c4 Merge pull request #2317 from trodge/markdown
added markdown format flag for create-setters
2020-04-02 08:10:25 -07:00
Prachi Pendse
38973a80c3 Use mount flag to pass storage mounts to functions 2020-04-01 15:03:57 -07:00
Phillip Wittrock
4a7b22cf23 Implement json marshal / unmarshal so it can be used by PatchJson6902Transformer 2020-04-01 14:35:05 -07:00
Kubernetes Prow Robot
21a544f188 Merge pull request #2316 from mortent/ReplicaCountTransformer
Add replicacount filter based on kyaml libraries
2020-04-01 14:04:24 -07:00
Kubernetes Prow Robot
43f44b88ce Merge pull request #2315 from mortent/CleanupAnnotationsTransformer
Improve tests for AnnotationsTransformer
2020-04-01 13:48:23 -07:00
Kubernetes Prow Robot
0086470fe1 Merge pull request #2318 from pwittrock/master
Refactor and optimize function to set all setters
2020-04-01 12:46:23 -07:00
Phillip Wittrock
6a3eaf8ba0 Refactor and optimize function to set all setters 2020-04-01 11:27:59 -07:00
Thomas Rodgers
26e801d2f2 added markdown format flag 2020-04-01 10:35:53 -07:00
Kubernetes Prow Robot
d5d908610d Merge pull request #2314 from phanimarupaka/SetAllSetterDefinitions
Set all setter definitions from source package
2020-04-01 09:35:28 -07:00
Morten Torkildsen
8a22efb213 Add replicacount filter based on kyaml libraries 2020-03-31 22:25:02 -07:00
Morten Torkildsen
8bd989abb1 Improve tests for AnnotationsTransformer 2020-03-31 20:29:50 -07:00
Phani Teja Marupaka
a3f59f2f4f Set all setter definitions from source package 2020-03-31 20:25:52 -07:00
Prachi Pendse
a4ee1c2e72 Remove TODO for network and volume issues 2020-03-31 10:19:17 -07:00
Prachi Pendse
39fe903498 Support mounting volumes to containers 2020-03-31 01:08:54 -07:00
Kubernetes Prow Robot
78abd4193a Merge pull request #2311 from pwittrock/master
kyaml implementation of the PrefixSuffixTransformer
2020-03-30 16:34:40 -07:00
Phillip Wittrock
96926fecce kyaml implementation of the PrefixSuffixTransformer 2020-03-30 13:07:11 -07:00
Kubernetes Prow Robot
7d852c7bab Merge pull request #2305 from pwittrock/filtersutil
NamespaceTransformer tests
2020-03-30 11:56:41 -07:00
Kubernetes Prow Robot
d36a5a9c2f Merge pull request #2304 from bndn/patch-1
Fix argument name to provide digest to an image
2020-03-30 11:44:17 -07:00
Kubernetes Prow Robot
f81cc75925 Merge pull request #2307 from phanimarupaka/RearrangeComments
Rearrange comments for yaml/V3 bug fix
2020-03-30 11:22:16 -07:00
Kubernetes Prow Robot
ab39586960 Merge pull request #2309 from bzub/2308-list-setters_docs
config: update docs to use list-setters.
2020-03-30 10:54:17 -07:00
Phani Teja Marupaka
17503ae9d8 Rearrange comments for yaml/V3 bug fix 2020-03-30 10:51:47 -07:00
bzub
24988df444 config: update docs to use list-setters. 2020-03-30 12:42:37 -05:00
Phillip Wittrock
11ce0128ad NamespaceTransformer tests
Follow up items to #2288
2020-03-30 10:32:51 -07:00
Benjamin Danon
4c0ab89c87 Fix argument name to provide digest to an image 2020-03-29 11:36:47 +02:00
Kubernetes Prow Robot
50cc1968e4 Merge pull request #2303 from pwittrock/filtersutil
Move filltersutil serialization to kyaml
2020-03-28 16:37:53 -07:00
Phillip Wittrock
51ba40d39b Move filltersutil serialization to kyaml 2020-03-28 10:02:15 -07:00
Kubernetes Prow Robot
20184e9835 Merge pull request #2302 from pwittrock/filtersutil
Update kyaml version
2020-03-28 08:55:53 -07:00
Phillip Wittrock
8e3b7b195e Update kyaml version 2020-03-28 08:44:32 -07:00
Jeff Regan
ba48f615e8 Merge pull request #2300 from monopole/labelFunctions
Function to set labels.
2020-03-27 20:44:10 -07:00
Jeffrey Regan
2be48ca96a Function to set labels. 2020-03-27 17:53:28 -07:00
Kubernetes Prow Robot
85e9127071 Merge pull request #2297 from pwittrock/filtersutil
Utilities for working with map[string]interface{} + yaml.Node
2020-03-26 16:28:23 -07:00
Phillip Wittrock
06e70f74c2 Utilities for working with map[string]interface{} + yaml.Node 2020-03-26 15:06:00 -07:00
Jeff Regan
5184872cb5 Merge pull request #2298 from mortent/AnnotationsFilter
Add annotations filter based on kyaml libraries
2020-03-26 12:29:43 -07:00
Morten Torkildsen
f39f28d38f Add annotations filter based on kyaml libraries 2020-03-25 21:47:12 -07:00
Kubernetes Prow Robot
114e676cb1 Merge pull request #2288 from pwittrock/kunstruct
Kustomize API: implement a FieldSpec transformer using kyaml libraries
2020-03-25 19:50:25 -07:00
Kubernetes Prow Robot
2826dddc32 Merge pull request #2296 from pwittrock/slfn
Refactor function code and allow for using starlark based filters
2020-03-25 19:38:25 -07:00
Phillip Wittrock
7164e55831 Allow functions to enable the starlark filter (off by default) 2020-03-25 13:29:20 -07:00
Kubernetes Prow Robot
39629ed3e7 Merge pull request #2247 from mengqiy/kptfnexample
print to stderr when encoutnering errors
2020-03-25 11:58:25 -07:00
Kubernetes Prow Robot
002993379a Merge pull request #2255 from mvbakker/master
Updated README to use 'bases' instead of 'resources' in overlays examples
2020-03-25 11:28:25 -07:00
Kubernetes Prow Robot
63622dbf2f Merge pull request #2286 from masih/patch-1
Update inventory_object.md
2020-03-25 11:18:06 -07:00
Phillip Wittrock
85e9779bd6 Refactor container functions 2020-03-24 20:50:08 -07:00
Phillip Wittrock
81bbd2f2e3 Enable using kyaml namespace transformer in builtin plugin 2020-03-24 20:44:28 -07:00
Phillip Wittrock
d41df982c5 Util functions for kyaml <-> kunstruct compatibility 2020-03-24 20:44:28 -07:00
Phillip Wittrock
7629a03dd6 namespace transformer implementation using kyaml 2020-03-24 20:44:28 -07:00
Phillip Wittrock
3def13d479 Support for FieldSpec based operations on kyaml objects 2020-03-24 20:44:28 -07:00
Phillip Wittrock
51a79d554c Update go.mod and go.sum for kyaml based namespace transformer 2020-03-24 20:44:28 -07:00
Kubernetes Prow Robot
6c2adc48dd Merge pull request #2295 from pwittrock/slfn
refactor function filters
2020-03-24 13:55:02 -07:00
Phillip Wittrock
efdd812cc1 refactor function filters 2020-03-24 11:18:46 -07:00
Kubernetes Prow Robot
cd6614a93b Merge pull request #2278 from yujunz/getter
Support various target and resource with go-getter
2020-03-24 09:14:49 -07:00
Yujun Zhang
04bec8ed2e Rename resourceGetter to remoteTargetGetter for readability 2020-03-24 10:19:49 +08:00
Kubernetes Prow Robot
51b29d7023 Support various target and resource with go-getter 2020-03-24 09:44:05 +08:00
Kubernetes Prow Robot
3a2635bd2d Merge pull request #2291 from pwittrock/release
kyaml release 0.1.2
2020-03-23 12:21:25 -07:00
Phillip Wittrock
443fa792c3 kyaml release 0.1.2 2020-03-23 12:09:15 -07:00
Kubernetes Prow Robot
064f0641ba Merge pull request #2287 from phanimarupaka/DontWriteToNoSetFiles
Skip writing to unedited files
2020-03-20 18:30:43 -07:00
Phani Teja Marupaka
a36d5b76be Skip writing to unedited files 2020-03-20 16:24:16 -07:00
Kubernetes Prow Robot
5c0fbf9a7f Merge pull request #2284 from phanimarupaka/AddNetworkFlag
Generate network config
2020-03-20 11:19:09 -07:00
Phani Teja Marupaka
9a9bdee605 Generate network config 2020-03-20 10:24:24 -07:00
Masih H. Derkani
11ef1f3921 Update inventory_object.md 2020-03-20 10:11:22 +00:00
Kubernetes Prow Robot
ce2e685619 Merge pull request #2257 from ticketmaster/misspell
fix misspellings
2020-03-19 09:17:23 -07:00
Michael Cook
aa46b6ec44 fix misspellings 2020-03-18 14:36:12 +01:00
Kubernetes Prow Robot
c4d949333d Merge pull request #2283 from phanimarupaka/AddFieldSetterFilter
Add FieldSetter filter
2020-03-17 10:34:22 -07:00
Phani Teja Marupaka
702b10d524 Add FieldSetter filter 2020-03-17 10:08:29 -07:00
Kubernetes Prow Robot
7840b7f949 Merge pull request #2265 from pwittrock/merge3
Setters: support for setting string list fields
2020-03-17 09:44:30 -07:00
Kubernetes Prow Robot
2cf5dc16cb Merge pull request #2137 from rhomel/image-match-tag-braces
Allow braces in image tag name
2020-03-17 09:44:22 -07:00
Kubernetes Prow Robot
036b93c8d0 Merge pull request #2280 from yujunz/golangci-lint
Exlude golangci-lint v1.24.0 which breaks CI
2020-03-17 09:26:22 -07:00
Yujun Zhang
cad69ae415 Exlude golangci-lint v1.24.0 which breaks CI 2020-03-16 18:16:38 +08:00
Kubernetes Prow Robot
5b774d09e1 Merge pull request #2215 from giteshk/master
#2214 : Variable reference does not work on the nfs.server
2020-03-10 09:33:36 -07:00
Kubernetes Prow Robot
9cbabe9135 Merge pull request #2267 from pwittrock/starlark
Starlark Filter support
2020-03-09 19:43:36 -07:00
Phillip Wittrock
7e8f8a649c Better starlark documentation 2020-03-09 16:41:57 -07:00
Phillip Wittrock
68a9389bfe starlark fn support for functionConfig input 2020-03-09 10:30:20 -07:00
Phillip Wittrock
5364b2198a Add Starlark kio.Filter
- Support for implementing filters in Starlark
2020-03-09 10:30:18 -07:00
Phillip Wittrock
63ff34ffe2 Walk: opt-in to visiting map keys when walking map entries 2020-03-09 10:29:26 -07:00
Kubernetes Prow Robot
6944cea234 Merge pull request #2264 from yujunz/revert-2169
Revert "Merge pull request #2169 from yujunz/loader/go-getter"
2020-03-09 09:47:36 -07:00
Phillip Wittrock
370502ed4b Setters: support for setting string list fields 2020-03-07 13:53:24 -08:00
Yujun Zhang
711bab85ae Revert "Merge pull request #2169 from yujunz/loader/go-getter"
This reverts commit 0b1ad031a9, reversing
changes made to 300dd108d5.
2020-03-07 18:58:46 +08:00
Kubernetes Prow Robot
0b1ad031a9 Merge pull request #2169 from yujunz/loader/go-getter
Replace git cloner with go getter to support various target
2020-03-06 15:45:34 -08:00
Kubernetes Prow Robot
300dd108d5 Merge pull request #2167 from yujunz/loader/http
Allow loading file from http
2020-03-06 15:31:34 -08:00
Kubernetes Prow Robot
65522b9e9f Merge pull request #2182 from chancez/per_resource_generator_options
Enable specifying GeneratorOptions per resource
2020-03-06 14:51:34 -08:00
Kubernetes Prow Robot
270f832b07 Merge pull request #2261 from pwittrock/master
release kyaml cmd/config 1.1
2020-03-06 12:33:08 -08:00
Phillip Wittrock
f2dddf48ae release kyaml cmd/config 1.1 2020-03-06 09:29:25 -08:00
Kubernetes Prow Robot
37bab58095 Merge pull request #2258 from rhomel/api-0.3.3
increment api patch release to 0.3.3
2020-03-05 19:48:50 -08:00
Rhomel Chinsio
76e72ada16 increment api patch release to 0.3.3
Context: https://github.com/kubernetes-sigs/kustomize/pull/2249#issuecomment-595436980

Increased the patch version. But perhaps the minor version should increase instead since this is technically not a bug? Let me know if patch increment is sufficient in this case.
2020-03-06 09:56:34 +09:00
Kubernetes Prow Robot
0571f13da1 Merge pull request #2249 from rhomel/image-match-tag-braces-api
Allow braces in image tag name (api)
2020-03-05 12:28:38 -08:00
Rhomel Chinsio
b33d0f86f0 fix: add plugin file 2020-03-05 06:57:40 +00:00
Michiel Bakker
d43fc9979c Updated README to use 'bases' instead of 'resources' in overlays examples 2020-03-04 13:45:23 +01:00
Yujun Zhang
735cefa456 Use a lite fork of go-getter 2020-03-04 20:04:39 +08:00
Yujun Zhang
a24bf6aece Use a tailored go-getter to get rid of transitive depenencies 2020-03-04 20:04:39 +08:00
Yujun Zhang
fae66446a8 Replace git cloner with go getter to support various target 2020-03-04 20:04:39 +08:00
Kubernetes Prow Robot
6c2c08c4df Merge pull request #2253 from khrisrichardson/issues/2252
#2252: convert tests to exercise openapi and inference
2020-03-03 21:07:47 -08:00
Khris Richardson
fcfe798b75 convert tests to exercise openapi and inference 2020-03-03 18:50:02 -08:00
Kubernetes Prow Robot
a484bd2efd Merge pull request #2251 from Liujingfang1/master
Use sigs.k8s.io/Application type instead of go template
2020-03-03 16:33:47 -08:00
Jingfang Liu
c8602cf9b6 Use sigs.k8s.io/Application type instead of go template 2020-03-03 13:57:03 -08:00
Kubernetes Prow Robot
caa8fdc3cd Merge pull request #2245 from pwittrock/merge3
Use OpenAPI when 3-way merging resources
2020-03-03 12:51:46 -08:00
Rhomel Chinsio
f0ae77abd5 allow braces in image tag name (api) 2020-03-03 05:48:36 +00:00
Phillip Wittrock
5d1a0346b5 Use OpenAPI when merging (3way) resources
- When merging (3way) resources use the patch strategy from the openAPI if the definition exists for the field
- Allow disabling of guessing patch strategy merge keys when no definition exists
- Support defining strategy and key directly on configuration fields through line and header coments
- Support attaching schema to parent fields of lists, and propagating -- e.g. that a field is a PodTemplate
2020-03-02 20:56:53 -08:00
Mengqi Yu
55284dc290 print to stderr when encoutnering errors 2020-03-02 16:16:10 -08:00
Yujun Zhang
382425d974 Add unit test for http fileloader 2020-02-29 16:19:21 +08:00
Yujun Zhang
ff6250cdb4 Allow loading file from http 2020-02-29 16:19:21 +08:00
Kubernetes Prow Robot
2a8a17e3af Merge pull request #2239 from Liujingfang1/master
Add an example function to append an Application CR to resources
2020-02-28 15:34:39 -08:00
Gitesh Koli
70ac18f720 Corrected CronJob volume Path and the expected results 2020-02-28 16:46:09 -05:00
Gitesh Koli
bb6677f80a Fixed the YAML format error 2020-02-28 16:31:23 -05:00
install_apigee_kickstart_on_gke.sh script
3408c3e4c6 Fixed Tab to spaces 2020-02-28 16:11:22 -05:00
Jingfang Liu
f6ad78650e Add an example function to append an Application CR to resources 2020-02-28 13:05:33 -08:00
install_apigee_kickstart_on_gke.sh script
a3800701f1 Additional Tests to cover CronJob, DaemonSet, ReplicaSet, StatefulSet, Pod, Job 2020-02-28 15:52:59 -05:00
Kubernetes Prow Robot
6c4370cd0d Merge pull request #2238 from pwittrock/release
Release kyaml and cmd/config v0.1.0
2020-02-27 16:06:39 -08:00
Phillip Wittrock
052deacbb2 Add license to kfns_test 2020-02-27 15:49:53 -08:00
Phillip Wittrock
523ab2e35f Add cmd/ and kyaml/ to prow tests 2020-02-27 15:49:50 -08:00
Phillip Wittrock
9a015ca8d5 kyaml v0.1.0 release 2020-02-27 15:27:26 -08:00
Kubernetes Prow Robot
a24cc4d305 Merge pull request #2237 from Liujingfang1/master
add SetLabel function in kyaml library
2020-02-27 14:18:38 -08:00
Jingfang Liu
ef76575ab6 add test for SetLabel and SetAnnotation 2020-02-27 13:37:36 -08:00
Jingfang Liu
39094f2aeb add SetLabel function in kyaml library 2020-02-27 12:11:06 -08:00
Kubernetes Prow Robot
49ebb3f155 Merge pull request #2236 from pwittrock/parse
Setters type support
2020-02-27 12:06:38 -08:00
Phillip Wittrock
fa507f782f Setters: support for explicit setter typing
- ensure OpenAPI definitions always uses strings for setter values
- allow the field type to be defined -- integer,boolean,string
- format values using yaml 1.1 compatibility
2020-02-27 11:51:18 -08:00
Phillip Wittrock
da548f65ea fixup go.sum 2020-02-27 11:48:24 -08:00
Kubernetes Prow Robot
8991b193c6 Merge pull request #2232 from pwittrock/setby
Setters: support for enums
2020-02-26 20:33:19 -08:00
Phillip Wittrock
3c776b3435 fix setter clear set-by test 2020-02-26 20:25:05 -08:00
Phillip Wittrock
cf61a360e0 Support for enum mappings in setters 2020-02-26 20:13:06 -08:00
Kubernetes Prow Robot
a588f498ea Merge pull request #2228 from pwittrock/setby
Setters: clear set-by if unspecified when setting a value
2020-02-26 14:23:19 -08:00
Boyil (Elliot) Li
1503b4c834 add namereference for PriorityClass 2020-02-26 14:18:49 -08:00
Phillip Wittrock
573d7b7234 Setters: clear set-by if unspecified when setting a value 2020-02-26 13:53:47 -08:00
Kubernetes Prow Robot
1d94ee86df Merge pull request #2219 from phanimarupaka/substitutions
Create setters for substitutions
2020-02-26 13:41:19 -08:00
Phani Teja Marupaka
275bf05ae2 Refactoring and Table tests 2020-02-26 11:37:14 -08:00
Chance Zibolski
aec264d2b5 docs: Document per-resource generatorOptions 2020-02-26 09:54:43 -08:00
Chance Zibolski
62f21cbe69 Enable specifying GeneratorOptions per resource
In addition to specifying GeneratorOptions globally within a
kustomization, also allow users to set GeneratorOptions on a
per-resource level.
2020-02-26 09:54:43 -08:00
Phani Teja Marupaka
d70f3a7958 Update go files 2020-02-25 14:09:37 -08:00
Kubernetes Prow Robot
5707962df5 Merge pull request #2224 from monopole/disableTravis
Disable travis testing now that prow works.
2020-02-25 11:52:50 -08:00
Jeffrey Regan
63c06eeaf1 Disable travis testing now that prow works. 2020-02-25 11:38:36 -08:00
Kubernetes Prow Robot
b3ce3a7882 Merge pull request #2213 from vanou/correct_explanation_of_ApendAll_method_in_ResMap_interface
Correct explanation of ApendAll method in ResMap interface
2020-02-24 16:25:35 -08:00
Phani Teja Marupaka
a8b5ec2c61 Suggested Changes and Unit Tests 2020-02-24 12:35:14 -08:00
Kubernetes Prow Robot
d190e1c18a Merge pull request #2220 from kubernetes-sigs/monopole-patch-1
Add lint-kustomize to prow-presubmit-check
2020-02-24 10:42:50 -08:00
Jeff Regan
96ac25fff5 Add lint-kustomize to prow-presubmit-check
To do tool installs.
2020-02-24 10:17:52 -08:00
Phani Teja Marupaka
1d988a0fd8 Merge branch 'master' into substitutions 2020-02-24 09:39:22 -08:00
Phillip Wittrock
6f176b1507 Merge pull request #2203 from pwittrock/setter-wiring
Manually merging since the prow automation does not appear to be configured correctly
2020-02-24 09:23:00 -08:00
Phillip Wittrock
d2f0b1b345 Merge pull request #2218 from pwittrock/master
Update kyaml to v0.0.13
2020-02-21 14:35:25 -08:00
Phillip Wittrock
c95a40933b Update kyaml to v0.0.13 2020-02-21 10:18:52 -08:00
Phillip Wittrock
bc7b880ab1 Merge pull request #2211 from pwittrock/master
Make GetOpenAPIFile publicly settable
2020-02-21 10:16:21 -08:00
Phillip Wittrock
e004c31700 Make GetOpenAPIFile publicly settable 2020-02-21 08:09:48 -08:00
Phillip Wittrock
ca9aa62c26 Merge pull request #2216 from pwittrock/version
release cmd/config and kyaml 0.0.12
2020-02-21 08:09:08 -08:00
install_apigee_kickstart_on_gke.sh script
bfb1b44b15 Corrected the test data 2020-02-20 10:27:16 -05:00
install_apigee_kickstart_on_gke.sh script
9ebee1e247 Enable variable reference in the Volumes which involve NFS server 2020-02-20 00:23:10 -05:00
Phillip Wittrock
cee7cb6589 release cmd/config and kyaml 0.0.12 2020-02-19 15:01:14 -08:00
Phillip Wittrock
4f905c9cff Merge pull request #2203 from pwittrock/setter-wiring
Manually merging since the prow automation does not appear to be configured correctly
2020-02-19 14:55:09 -08:00
Phillip Wittrock
232c1c8ee9 write create-substitution into command 2020-02-19 14:25:38 -08:00
Phillip Wittrock
61cf3e6ec5 wire set 2.0 command 2020-02-19 14:25:38 -08:00
Phillip Wittrock
1ce469f1fd stop printing expected error message in fmt command test 2020-02-19 14:25:38 -08:00
Phillip Wittrock
a49c9de4a4 wire create-setter 2.0 into command 2020-02-19 14:25:38 -08:00
Phillip Wittrock
bada055cd3 wire list-setters 2.0 into command 2020-02-19 14:25:38 -08:00
Phillip Wittrock
d7e0b1ac31 setter utilities for simplifying commands 2020-02-19 14:25:38 -08:00
Phillip Wittrock
5549035b69 support for listing setters 2020-02-19 14:25:38 -08:00
Phillip Wittrock
025200cc12 support for adding setter substitution
- refactor add setter to include file updates
- support add substitution file updates
2020-02-19 14:25:38 -08:00
Phillip Wittrock
154939803f better support for reading / writing single resource yaml files 2020-02-19 08:16:07 -08:00
Phillip Wittrock
64c30a0678 fix nil dereference issue in fieldmeta 2020-02-19 08:13:26 -08:00
Phillip Wittrock
b7bef5dc44 openapi support for loading definitions from a file 2020-02-19 08:13:26 -08:00
vanou
87b680e1c0 Correct explanation of ApendAll method in ResMap interface
This commit corrects expalation of ApendAll method in ResMap
interface. AppendAll method should fail on CurId collision,
not OrgId collision.
2020-02-19 23:53:10 +09:00
Jeff Regan
0075d0a88c Add a prow target to the Makefile 2020-02-12 15:19:35 -08:00
Kubernetes Prow Robot
3fc359043a Merge pull request #2199 from phanimarupaka/Setters2ReadAndWrite
Setter Definitions read and write
2020-02-12 10:14:51 -08:00
Phani Teja Marupaka
6b6a74af19 Substitutions 2020-02-12 09:20:43 -08:00
Kubernetes Prow Robot
89fc3cbb94 Merge pull request #2200 from pwittrock/add
setters 2.0: add references
2020-02-11 16:26:08 -08:00
Phillip Wittrock
437be2831f setters 2.0: support for adding references to setters 2020-02-11 16:04:32 -08:00
Kubernetes Prow Robot
b05ab6e0e3 Merge pull request #2197 from pwittrock/setters
setters 2.0
2020-02-11 16:04:09 -08:00
Phillip Wittrock
7097013426 setters 2.0 2020-02-11 11:00:58 -08:00
Phani Teja Marupaka
29fbc564e3 Setter Definitions read and write 2020-02-11 10:45:39 -08:00
Jeff Regan
42abcbd516 Merge pull request #2195 from haiyanmeng/stats
Add notes on backup and restore
2020-02-11 09:02:32 -08:00
Haiyan Meng
b7b7a5a79f Fix typo 2020-02-10 15:44:51 -08:00
Kubernetes Prow Robot
ebcc49d064 Merge pull request #2192 from eddiezane/ez/1901-expose-network-as-function-option
Support exposing network as a function option
2020-02-10 09:31:54 -08:00
Haiyan Meng
807ca9c1e3 Add notes on backup and restore 2020-02-10 08:30:08 -08:00
Eddie Zaneski
6cdcb1f436 Support network in functions
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>
2020-02-07 17:31:33 -07:00
Jeff Regan
91da8525c1 Merge pull request #2183 from haiyanmeng/stats
Add curl commands for kustomize stats
2020-02-06 11:40:00 -08:00
Jeff Regan
b604f03740 Merge pull request #2189 from pwittrock/master
release cmd/config and kyaml
2020-02-06 11:39:08 -08:00
Jeff Regan
422ba21df0 Merge pull request #2186 from vanou/fix-typo-in-fields-explanation
Fix typo in kustomization file resources field explanation
2020-02-06 11:38:48 -08:00
Phillip Wittrock
20e13abbb4 release cmd/config and kyaml 2020-02-06 09:02:30 -08:00
vanou
5975761fbf Fix typo in kustomization file fields explanation
This commit fixes typo in explanation of 'resources' field
in kustomization file.
2020-02-06 22:43:45 +09:00
Kubernetes Prow Robot
ea7f74e9e0 Merge pull request #2185 from pwittrock/master
cmd/config: support for stdin/stdout in source/sink
2020-02-05 17:43:33 -08:00
Phillip Wittrock
90e1dbe5d0 cmd/config: support for stdin/stdout in source/sink 2020-02-05 17:24:45 -08:00
Kubernetes Prow Robot
daa9504890 Merge pull request #2181 from phanimarupaka/FieldOptionalForSetter
Make field optional flag for create setter
2020-02-05 12:47:55 -08:00
Haiyan Meng
baccf58ccf Avoid tracking the change in github_api_secret.txt
This helps prevent commiting your Github personal access token into
Github by accident.
2020-02-05 12:06:21 -08:00
Haiyan Meng
c7bdb3fbe4 Add cmds to process the kustomize-stats log 2020-02-05 11:04:59 -08:00
Haiyan Meng
967fe44e3f Add curl commands for kustomize stats 2020-02-05 11:04:59 -08:00
Haiyan Meng
d0602c732b Remove the usage of github access token from the kustomize-stats job 2020-02-05 11:04:59 -08:00
Haiyan Meng
a4179fa87f Use the silence mode of curl 2020-02-05 11:04:59 -08:00
Haiyan Meng
c9bce3fc0a Add comments on backup and restore 2020-02-05 11:04:59 -08:00
Jeff Regan
11aa07b17f Merge pull request #2178 from pwittrock/master
Support loading openapi from []bytes
2020-02-05 09:54:29 -08:00
Phani Teja Marupaka
72e7084639 Make filed optional flag for create setter 2020-02-05 09:21:45 -08:00
Phillip Wittrock
073a11f3f1 Support loading openapi from []bytes 2020-02-05 08:43:11 -08:00
Kubernetes Prow Robot
0b3e63c85d Merge pull request #2177 from pwittrock/master
kio: don't apply folded style to wrapped items
2020-02-04 14:18:42 -08:00
Phillip Wittrock
32fc17fedd kio: don't apply folded style to wrapped items 2020-02-04 13:51:42 -08:00
Kubernetes Prow Robot
bf6982afa3 Merge pull request #2176 from phanimarupaka/OptInToFormatSchema
Opt in to use schema
2020-02-04 11:27:27 -08:00
Phani Teja Marupaka
79d591e2b0 Opt in to use schema 2020-02-04 10:50:17 -08:00
Kubernetes Prow Robot
69bc776d30 Merge pull request #2175 from pwittrock/m3
Optionally use filepath as part of merge key for merge3
2020-02-04 10:01:27 -08:00
Phillip Wittrock
2d54981bcd optionally use filepath as part of merge key for merge3 2020-02-03 19:28:40 -08:00
Kubernetes Prow Robot
0cfc3b10fc Merge pull request #2174 from pwittrock/master
Fix tshirt-size image resources
2020-02-03 16:13:26 -08:00
Phillip Wittrock
beb30d79ec Fix tshirt-size image resources 2020-02-03 15:39:05 -08:00
Kubernetes Prow Robot
4f49d2883b Merge pull request #2173 from monopole/kyamlTo_v0.0.10
kyaml patch increment to 0.0.10
2020-02-03 13:43:27 -08:00
Jeffrey Regan
0d36ff958f kyaml patch increment to 0.0.10 2020-02-03 13:22:13 -08:00
Jeff Regan
c683e6ae3c Merge pull request #2172 from haiyanmeng/stats
Several improvements on crawler
2020-02-03 13:11:24 -08:00
Haiyan Meng
3ebeebabde Add comments for backup and restore 2020-02-03 12:37:18 -08:00
Haiyan Meng
a3b3449b1f Add curl commands for generator/transformer exploration 2020-02-03 09:59:52 -08:00
Haiyan Meng
1b8488da2c Add curl commands for snapshoting 2020-02-03 09:59:52 -08:00
Haiyan Meng
f5419e9f72 Check the incomplete_results field of github query responses
Currently, we don't check the `incomplete_results` field of a github
query response, which is problematic when incomplete query results are
used to split the query ranges: the splitted query ranges will
be very wild.
2020-02-03 09:59:52 -08:00
Haiyan Meng
7a87c84403 Reprocess the github filesize search ranges which have more than 1000 items 2020-02-03 09:59:52 -08:00
Haiyan Meng
0fcb3a014c Add config for index backup and restore 2020-02-03 09:59:52 -08:00
Haiyan Meng
0b38e6d284 Improve the analysis on generator and transformer 2020-02-03 09:59:52 -08:00
Haiyan Meng
d5c66cb3d4 Add KustomizationDocument.Copy method 2020-02-03 09:59:52 -08:00
Haiyan Meng
b35b5aa73d Check the checksums of documents in the index 2020-02-03 09:59:52 -08:00
Haiyan Meng
bb409a5ea8 Set up cronjob to run crawler every 7 days 2020-02-03 09:59:52 -08:00
Haiyan Meng
74e1b5d54b Add GCP service account into ESCluster config
This is necessary for index backup into GCS and index recovery from GCS
2020-02-03 09:59:52 -08:00
Kubernetes Prow Robot
c626eae9bd Merge pull request #2165 from frankfarzan/fix_run_scope
kyaml: Handle functions in top-level directory.
2020-01-31 16:25:22 -08:00
Frank Farzan
7372a371b4 kyaml: Handle functions in top-level directory.
scope() method uses HasPrefix to detect whether a resource
is in a subdirectory of function directory. It doesn't handle
the case when the function is in top-level dir ('.').
2020-01-31 14:41:56 -08:00
Jeff Regan
03cc4e3848 Merge pull request #2114 from mortent/FlexiblePrinting
Restructure the Apply command to separate printing from the code that actually does the work
2020-01-28 14:50:18 -08:00
Jeff Regan
0b33b3501f Merge pull request #2154 from karl-gustav/patch-1
Fix install_kustomize.sh so that it works on alpine linux
2020-01-28 09:31:29 -08:00
Kubernetes Prow Robot
8e2ec69d85 Merge pull request #2136 from yujunz/docs/how
Add document about how `kustomize build` works
2020-01-28 09:25:42 -08:00
Jeff Regan
0ce076758d Merge pull request #2150 from haiyanmeng/stats
Add `fileType` and `User` into the index
2020-01-28 09:18:31 -08:00
Morten Torkildsen
68195ffabb Restructure the Apply command to separate printing from the code that actually does the work 2020-01-27 14:50:08 -08:00
Karl Gustav
7eca29daee Fix install_kustomize.sh so it works on alpine linux
The install script fails and thinks that alpine linux is in windows. This is because
`$OSTYPE` in alpine linux is linux-musl, not linux-gnu as this script assumes.

I tested these changes with this script:
```

set -euo pipefail

opsys=""
function check {
    opsys=windows
    if [[ "$OSTYPE" == linux* ]]; then
      opsys=linux
    elif [[ "$OSTYPE" == darwin* ]]; then
      opsys=darwin
    fi
}

OSTYPE="linux-gnu"
check
test "$opsys" == "linux" || echo $OSTYPE test failed

OSTYPE="linuxsomething"
check
test "$opsys" == "linux" || echo $OSTYPE test failed

OSTYPE="darwinsomething"
check
test "$opsys" == "darwin" || echo $OSTYPE test failed

OSTYPE="either"
check
test "$opsys" == "windows" || echo $OSTYPE test failed
```

ref: #2146
2020-01-25 22:46:10 +01:00
Haiyan Meng
154208d331 Improve the efficiency of crawling github by skipping the documents
already in the index
2020-01-24 19:55:56 -08:00
Kubernetes Prow Robot
a851232100 Merge pull request #2153 from seans3/apply-prune
Connect prune to apply
2020-01-24 16:25:04 -08:00
Sean Sullivan
0c022db1e6 Connect prune to apply 2020-01-24 16:06:53 -08:00
Kubernetes Prow Robot
fec8881819 Merge pull request #2151 from seans3/inventory-set
Adds the PruneOptions and implements the methods for this struct
2020-01-24 15:05:04 -08:00
Sean Sullivan
7b44f71caf Adds the PruneOptions and implements the methods for this struct 2020-01-24 14:43:12 -08:00
Kubernetes Prow Robot
2d3cb22bc0 Merge pull request #2147 from HowJMay/fix_typo
fix typos
2020-01-24 10:14:32 -08:00
Rhomel Chinsio
59ce165355 docs: comment brace support purpose 2020-01-24 17:46:58 +09:00
Rhomel Chinsio
a7201a38e4 build: use local repo for test 2020-01-24 16:58:10 +09:00
Rhomel Chinsio
80633137a9 fix: test tags with braces 2020-01-24 15:10:22 +09:00
Haiyan Meng
b7b88cae76 Add curl commands for querying different filetypes 2020-01-23 16:04:55 -08:00
Jeff Regan
e787144811 Merge pull request #2145 from mortent/FixStatusEventOutput
Clean up output format for status events command
2020-01-23 14:03:58 -08:00
Morten Torkildsen
0f5256d952 Clean up output format for status events command 2020-01-23 12:38:11 -08:00
Jeff Regan
53432ba4bb Merge pull request #2135 from seans3/inventory-set
Fixed inventory Equal(), checking nil as passed parameter
2020-01-23 10:06:58 -08:00
HowJMay
00f68c12a8 fix typos
Fix typos
2020-01-23 23:35:38 +08:00
Jeff Regan
32ffbdf5ca Merge pull request #2140 from beantaxi/patch-1
Rename authoriing.md to authoring.md
2020-01-22 15:57:23 -08:00
Haiyan Meng
0820865e1d Retry FindRangesForRepoSearch 2020-01-22 10:13:57 -08:00
beantaxi
9f9a1d4159 Rename authoriing.md to authoring.md 2020-01-22 12:04:49 -06:00
Rhomel Chinsio
2a28b37b3c fix: place '-' as last character in regex class 2020-01-22 16:57:39 +09:00
Rhomel Chinsio
866303a0d7 fix: update generated file 2020-01-22 15:39:12 +09:00
Rhomel Chinsio
bce9cb5710 fix: update regex comment 2020-01-22 15:36:58 +09:00
Rhomel Chinsio
a9d35cc598 fix: add braces to image tag match 2020-01-22 15:36:02 +09:00
Yujun Zhang
e2f4339ec6 Add document about how kustomize build works 2020-01-22 13:32:49 +08:00
Sean Sullivan
1a7e2561ff Fixed inventory Equal(), checking nil as passed parameter 2020-01-21 17:14:08 -08:00
Jeff Regan
c7d78970fb Merge pull request #2134 from monopole/moveStatusToKustomize
Move status command to kustomize.
2020-01-21 17:13:06 -08:00
Jeffrey Regan
8e5bce17dc Move status command to kustomize. 2020-01-21 17:09:52 -08:00
Kubernetes Prow Robot
39c7a06829 Merge pull request #2133 from seans3/inventory-set
Adds InventorySet Equals() function
2020-01-21 16:44:36 -08:00
Sean Sullivan
bf2e398b33 Adds InventorySet Equals() function 2020-01-21 16:15:42 -08:00
Kubernetes Prow Robot
758d428264 Merge pull request #2132 from seans3/inventory-set
Adds new helper function retrieveGroupingLabel()
2020-01-21 15:48:37 -08:00
Kubernetes Prow Robot
5353db36f0 Merge pull request #2127 from mortent/FixColorOutput
Fix printing to make sure always match setting colors with a reset
2020-01-21 15:18:35 -08:00
Sean Sullivan
3623d9205e Adds new helper function retrieveGroupingLabel() 2020-01-21 15:18:22 -08:00
Morten Torkildsen
73d44f9d31 Fix printing to make sure always match setting colors with a reset 2020-01-21 14:57:10 -08:00
Kubernetes Prow Robot
b024157c2e Merge pull request #2130 from phanimarupaka/MultipleServicesE2e
E2E Tests with multiple apps on same "kind" cluster
2020-01-21 14:04:34 -08:00
Kubernetes Prow Robot
5c55915c57 Merge pull request #2129 from phanimarupaka/FixTrimmingNewLines
Do not remove empty lines in configmap/secret
2020-01-21 10:11:39 -08:00
Haiyan Meng
1120c6bc7a Add a User field into Document to make it easy to aggregate on github
user level.
2020-01-21 10:09:52 -08:00
Kubernetes Prow Robot
da23b9a8b4 Merge pull request #2128 from pwittrock/master
Release kyaml and cmd/config libs
2020-01-21 09:19:36 -08:00
Phani Teja Marupaka
e851e5eb94 E2E Tests with multiple apps 2020-01-20 23:02:50 -08:00
Phani Teja Marupaka
0bd872e6d5 Do not remove empty lines in configmap/secret 2020-01-20 11:42:39 -08:00
Haiyan Meng
96ee9e9146 Add curl ElasticSearch cmd for using filter and range together 2020-01-17 15:49:14 -08:00
Haiyan Meng
377eb5b66d Fix the regexp for determining kustomization file 2020-01-17 15:48:38 -08:00
Haiyan Meng
f4636f8555 Add a fileType field into the index 2020-01-17 13:15:49 -08:00
Jeff Regan
89367be008 Merge pull request #2111 from phanimarupaka/FixStatusOfUnknownResources
Exclude invalid resources from status
2020-01-16 17:15:30 -08:00
Jeff Regan
736f826e7e Merge pull request #2119 from phanimarupaka/HelloWorldExampleWithHere
Hello app e2e tests
2020-01-16 17:14:52 -08:00
Phillip Wittrock
331bab494d Release kyaml and cmd/config libs 2020-01-16 16:25:16 -08:00
Kubernetes Prow Robot
39bbe6efe0 Merge pull request #2117 from seans3/inventory-set
Adds new InventorySet abstraction
2020-01-16 16:09:45 -08:00
Phani Teja Marupaka
13c891f54a Install kind as part of e2e tests 2020-01-16 15:49:11 -08:00
Sean Sullivan
d93b5a161a Adds new InventorySet abstraction 2020-01-16 14:36:44 -08:00
Phani Teja Marupaka
4d07004977 Hello app e2e tests 2020-01-16 14:11:18 -08:00
Kubernetes Prow Robot
e35eaaff17 Merge pull request #2116 from pwittrock/master
Refactor `config annotate`
2020-01-16 12:50:32 -08:00
Phillip Wittrock
c96cd82cab Refactor config annotate 2020-01-16 11:49:44 -08:00
Jeff Regan
365583bc36 Merge pull request #2108 from fantashley/chartinflator-helm-repo
Support third-party Helm repos in ChartInflator
2020-01-16 11:41:03 -08:00
Kubernetes Prow Robot
74e325db60 Merge pull request #2115 from pwittrock/master
Add Annotate command to cmd/config
2020-01-16 11:36:33 -08:00
Jeff Regan
36b6a63066 Merge pull request #2110 from phanimarupaka/E2ETestsApplyAndGrpngObj
Alpha commands e2e tests
2020-01-16 11:24:24 -08:00
Jeff Regan
5dde9485a2 Merge pull request #2109 from haiyanmeng/stats
Add support to get files referred in the generators and tranformers fields
2020-01-16 09:54:14 -08:00
Haiyan Meng
9f80da28ae Refactor the stats code for generators and transformers 2020-01-16 09:20:24 -08:00
Jeff Regan
f454449cdb Merge pull request #2094 from arthurgustin/master
Add --namespace option to kustomize edit add secret command
2020-01-16 09:15:03 -08:00
Phillip Wittrock
d49b8cdf90 add annotate command to cmd/config 2020-01-15 21:03:22 -08:00
Kubernetes Prow Robot
087086cf3b Merge pull request #2113 from pwittrock/master
kyaml and cmd/config release
2020-01-15 19:02:22 -08:00
Phillip Wittrock
8633763e9d expose xargs and wrap commands as libraries 2020-01-15 18:33:41 -08:00
Phillip Wittrock
d2f9cf171f kyaml and cmd/config release 2020-01-15 18:10:20 -08:00
Kubernetes Prow Robot
18d3b9ad8b Merge pull request #2112 from pwittrock/master
drop short-hand flags from `config run` command
2020-01-15 17:30:22 -08:00
Phani Teja Marupaka
2bcf82c6a4 Exclude invalid resources from status 2020-01-15 17:22:07 -08:00
Phillip Wittrock
35e24067fc drop short-hand flags from config run command 2020-01-15 17:09:57 -08:00
Kubernetes Prow Robot
32c959cde0 Merge pull request #2107 from pwittrock/master
`config run`: support for RunFns.Functions and RunFns.Input
2020-01-15 16:42:23 -08:00
Haiyan Meng
5477bde7e5 Use an env variable for index name and fix the call to NewKustomizeIndex in backend 2020-01-15 15:29:17 -08:00
Haiyan Meng
3ead42fe27 Add --index flag to kustomize_stats config file 2020-01-15 15:29:16 -08:00
Haiyan Meng
cf8d53a195 Move SeenMap to the utils dir 2020-01-15 15:29:16 -08:00
Phillip Wittrock
a61d478f0d config run: support for RunFns.Functions and RunFns.Input
- Support specifying RunFns.Functions using the `-i` flag to specify an image
- Parse the function config from key-value arguments specified after ` -- `
- Support reading from stdin / writing to stdout if no arguments are provided
- Table driven tests for parsing flags and args into RunFns structure
2020-01-15 14:59:45 -08:00
Phani Teja Marupaka
c340c30f25 Alpha commands e2e tests 2020-01-15 14:17:37 -08:00
Haiyan Meng
aaaba99389 Use Document.Path instead of its fields 2020-01-15 12:10:08 -08:00
Haiyan Meng
29e50ab476 Collect stats on generators and transformers 2020-01-15 12:10:08 -08:00
Haiyan Meng
3519cc56a1 Add support to get files referred in the generators and tranformers
fields
2020-01-15 12:10:08 -08:00
Kubernetes Prow Robot
983ac2be31 Merge pull request #2046 from sunny0826/master
Add multiple zh docs
2020-01-15 10:44:09 -08:00
Ashley Nelson
d050276662 Support third-party Helm repos in ChartInflator 2020-01-15 11:59:39 -06:00
Kubernetes Prow Robot
37ee56fc9a Merge pull request #2104 from pwittrock/master
kyaml/rnfn: support explicit fn list and reading from an io.Reader
2020-01-15 08:39:37 -08:00
Kubernetes Prow Robot
ade4f8969c Merge pull request #2081 from mortent/FixDefaultNamespaceIssue
Change the ResourceIdentifier used in kstatus to use only Group instead of GroupVersion
2020-01-14 20:53:31 -08:00
Jeff Regan
5ad69d27e3 Merge pull request #2101 from seans3/kustomize-apply-deps
Adds PrependGroupingObject() as apply pre-processor
2020-01-14 20:50:30 -08:00
Morten Torkildsen
dc6e31c23f Change the ResourceIdentifier used in kstatus to use only Group instead of GroupVersion 2020-01-14 19:19:25 -08:00
guoxudong
af27ada685 fix zh/multi-namespace.md & zh/multibases.md 2020-01-15 11:15:48 +08:00
Phillip Wittrock
474dfc916b kyaml/rnfn: support explicit fn list and reading from an io.Reader
- Support specifying an io.Reader as Input.  Use this instead of Path for reading Resources.
- Default io.Writer to os.Stdout if no Path is specified
- Default io.Reader to os.Stdin if no Path is specified
- Support specifying an explicit list of Functions.
  If specified, use these in place of reading from the Input or Directory source by default.
2020-01-14 18:19:13 -08:00
Sean Sullivan
b1122a3e0b Adds PrependGroupingObject() as apply pre-processor 2020-01-14 17:02:54 -08:00
Kubernetes Prow Robot
863eca1c32 Merge pull request #2102 from haiyanmeng/seed
Use flags for configuring the crawler job
2020-01-14 17:02:36 -08:00
Haiyan Meng
2e895c147e Use log.Print* instead of fmt.Print* 2020-01-14 15:50:35 -08:00
Haiyan Meng
af131c7471 Use flags to specify crawling mode and github user/repo info 2020-01-14 15:36:12 -08:00
Jeff Regan
09ec25b045 Merge pull request #2098 from seans3/kustomize-apply-deps
Add hash as suffix to grouping object name
2020-01-14 15:32:59 -08:00
Haiyan Meng
7ac573ae51 Add a flag to specify the index name 2020-01-14 14:25:29 -08:00
Kubernetes Prow Robot
02dbc0da98 Merge pull request #2100 from pwittrock/master
runfns: sort ContainerFilters depth first
2020-01-14 14:06:36 -08:00
Haiyan Meng
bb09f82f3c Remove kustomize-index-name setting 2020-01-14 13:53:16 -08:00
Phillip Wittrock
778f92ca0d runfns: sort ContainerFilters depth first
- run ContainerFilters most deeply nested in the hierarchy before others
- test refactoring
2020-01-14 13:43:31 -08:00
Sean Sullivan
4152a91609 Add hash as suffix to grouping object name 2020-01-14 13:19:13 -08:00
Jeff Regan
2e118b7c68 Merge pull request #2097 from haiyanmeng/improve
Improve the efficiency of crawling github  by making sure a github file is crawled only once
2020-01-14 13:16:55 -08:00
Haiyan Meng
72eda992bd make seen a non-primitive type 2020-01-14 12:14:00 -08:00
Haiyan Meng
230e0ca752 Add two methods to type RangeQueryResult: Add and String 2020-01-14 12:14:00 -08:00
Haiyan Meng
14eb524b9e Add a command for searching for kustomize resource files 2020-01-14 12:14:00 -08:00
Haiyan Meng
81d62f90bf Improve the efficency of crawling github
Make sure a github file is crawled once
2020-01-14 12:14:00 -08:00
Kubernetes Prow Robot
d71d2df364 Merge pull request #2088 from bzub/2083-config_run_sans_resource_input
Fix resource directory when using functions directory.
2020-01-14 12:03:18 -08:00
bzub
34f21f44a1 Handle functions dir for resource destination. 2020-01-14 13:03:56 -06:00
Kubernetes Prow Robot
070e128e47 Merge pull request #2095 from pwittrock/release
release kyaml 0.0.7 and cmd/config 0.0.8
2020-01-14 07:09:18 -08:00
Phillip Wittrock
2e5222f8e2 release kyaml 0.0.7 and cmd/config 0.0.8 2020-01-14 06:41:12 -08:00
Arthur Gustin
3893e12897 Add --namespace option to kustomize edit add secret command
Fix https://github.com/kubernetes-sigs/kustomize/issues/1625
2020-01-14 14:18:58 +01:00
Jeff Regan
186df6f7c8 Merge pull request #2093 from phanimarupaka/E2ETestsFramework
End to End tests framework
2020-01-13 17:46:08 -08:00
Jeff Regan
5d3a904283 Merge pull request #2039 from mortent/KubectlStatus
Integrate status with kustomize apply
2020-01-13 16:17:38 -08:00
Jeff Regan
065a4b7e90 Merge pull request #2048 from mortent/statusForPDBs
Implement new rules for status for PDBs
2020-01-13 15:51:33 -08:00
Kubernetes Prow Robot
1a330f89d9 Merge pull request #2080 from yujunz/git-cloner
Simplify git cloner logic
2020-01-13 15:23:11 -08:00
Morten Torkildsen
4655c01c9b Integrate status with kustomize apply 2020-01-13 15:18:47 -08:00
Phani Teja Marupaka
1d3c3995ed End to End tests framework 2020-01-13 13:21:39 -08:00
Jeff Regan
62e5abd437 Merge pull request #2090 from haiyanmeng/retry
Add the Document ID pointing to a kuostomization root into cache to avoid crawling it repeatedly
2020-01-13 10:53:01 -08:00
Jeff Regan
ecff981d1c Merge pull request #2082 from ofek/patch-1
Fix typo
2020-01-13 10:52:12 -08:00
Kubernetes Prow Robot
0d1e085680 Merge pull request #2075 from seans3/kustomize-apply-deps
Adds inventory hash to grouping object.
2020-01-13 10:41:39 -08:00
Kubernetes Prow Robot
dae3ebcafe Merge pull request #2092 from pwittrock/master
Export cmd/config commands so they can be composed more easily
2020-01-13 10:29:39 -08:00
Jeff Regan
8b3723603c Merge pull request #2069 from verb/kstatus-doc
Indent preformatted text in kstatus doc.go
2020-01-13 10:26:39 -08:00
Jeff Regan
3ff8d4a099 Merge pull request #2067 from mortent/FixGoModules
Set proper version for dependencies in kstatus and cmd/resource
2020-01-13 10:26:13 -08:00
Phillip Wittrock
2fc340db62 Export cmd/config commands so they can be composed more easily 2020-01-13 10:05:42 -08:00
Kubernetes Prow Robot
936dd090e6 Merge pull request #2089 from pwittrock/master
Re-introduce global scope for `cmd/config run` as flag
2020-01-13 09:31:39 -08:00
Phillip Wittrock
7bbcba5d23 Re-introduce global scope for cmd/config run as flag 2020-01-13 08:42:20 -08:00
Morten Torkildsen
d7a6e35fec Set proper versions for dependencies in kstatus and cmd/resource 2020-01-12 09:34:00 -08:00
Ofek Lev
ed31a60e9b Fix typo 2020-01-12 08:29:16 -05:00
Haiyan Meng
569fafba81 Add the Document ID pointing to a kuostomization root into cache to
avoid crawl it repeatedly
2020-01-11 15:32:25 -08:00
Yujun Zhang
ae458d0c80 Simplify git cloner logic
Related to #2072
2020-01-11 20:40:55 +08:00
Jeff Regan
3af514fa9f Merge pull request #2079 from monopole/updateVersions
update versions for kustomize 3.5.4
2020-01-10 18:52:10 -08:00
jregan
3bb7c1ccc7 update versions for kustomize 3.5.4 2020-01-10 18:50:12 -08:00
Jeff Regan
f364030557 Merge pull request #2076 from monopole/upgradeSomeDepsInKustomize
Upgrade some deps in kustomize.
2020-01-10 18:40:26 -08:00
Jeffrey Regan
52efd8c932 Upgrade some deps in kustomize. 2020-01-10 18:22:40 -08:00
Sean Sullivan
83e75a0f0a Adds inventory hash to grouping object. 2020-01-10 18:22:26 -08:00
Phillip Wittrock
e02c48abd0 Merge pull request #2077 from pwittrock/master
update VERSIONS for cmd/resource and cmd/config
2020-01-10 16:39:57 -08:00
Phillip Wittrock
39c42d71f0 update VERSIONS for cmd/resource and cmd/config 2020-01-10 16:39:17 -08:00
Jeff Regan
0c9a3756b4 Merge pull request #2074 from monopole/incApiReleaseTo032
increment api patch release to 0.3.2
2020-01-10 15:05:23 -08:00
Jeffrey Regan
3f417c7b5b increment api patch release to 0.3.2 2020-01-10 14:16:09 -08:00
Kubernetes Prow Robot
4526cb14e8 Merge pull request #2064 from seans3/kustomize-apply-deps
Adds functions to add/retrieve inventory to/from grouping object
2020-01-10 13:59:37 -08:00
Sean Sullivan
595e41a3ec Adds functions to add/retrieve inventory to/from grouping object 2020-01-10 13:41:23 -08:00
Haiyan Meng
c801958d40 Log response status code to help debug
Recently, the crawler job often fails after 10+ hours with the following
error (10.0.47.27:9200 is the ElasticSearch master):
dial tcp 10.0.47.27:9200: connect: connection refused
2020-01-10 11:37:22 -08:00
Haiyan Meng
f9a4d5a14e Track the crawling process 2020-01-10 11:10:38 -08:00
Kubernetes Prow Robot
118ba7eefe Merge pull request #2040 from mortent/FixFlakyWaitTest
Print the initial unknown status for all resources before looking at events
2020-01-10 11:02:36 -08:00
Kubernetes Prow Robot
488bc5aceb Merge pull request #2066 from pwittrock/master
Use latest kstatus when releasing cmd/resources
2020-01-10 08:44:34 -08:00
Lee Verberne
4c6b995435 Indent preformatted text in kstatus doc.go
This indents the code examples in the kstatus doc.go files so that
they'll be placed inside <pre> blocks by godoc. Without this change only
the coincidentally indented lines are marked as preformatted in godoc
HTML output.
2020-01-10 15:58:09 +01:00
Phillip Wittrock
2786287444 Use latest kstatus when releasing cmd/resources 2020-01-09 20:33:38 -08:00
Kubernetes Prow Robot
4e7446540c Merge pull request #2065 from pwittrock/master
update release versions for cmd/*
2020-01-09 20:22:34 -08:00
Phillip Wittrock
90ecc5d30a update release versions for cmd/* 2020-01-09 20:05:37 -08:00
Kubernetes Prow Robot
8840085a32 Merge pull request #2063 from pwittrock/master
Move auth import into main programs so libraries don't inherit it by …
2020-01-09 16:02:34 -08:00
Phillip Wittrock
1bd62ffce9 Move auth import into main programs so libraries don't inherit it by default 2020-01-09 15:34:55 -08:00
Phillip Wittrock
344e6f18dd Move auth import into main programs so libraries don't inherit it by default 2020-01-09 15:30:02 -08:00
Jeff Regan
8b9d374170 Merge pull request #2049 from seans3/kustomize-apply-deps
Inventory info helper functions
2020-01-09 14:58:30 -08:00
Kubernetes Prow Robot
982ad409bd Merge pull request #2053 from pwittrock/master
cmd/config run scoping and path defaulting
2020-01-09 14:56:34 -08:00
Jeff Regan
9555095de9 Merge pull request #2016 from haiyanmeng/stats
Add a binary for generating the stats of the index
2020-01-09 13:11:50 -08:00
Sean Sullivan
c6cc457f45 Inventory info helper functions 2020-01-09 11:45:41 -08:00
Kubernetes Prow Robot
6d58848970 Merge pull request #2035 from pwittrock/openapi
Introduce OpenAPI kyaml libraries
2020-01-09 09:35:45 -08:00
Phillip Wittrock
8a2c886ab2 update kyaml go.mod and go.sum
also update cmd/config,cmd/kubectl,cmd/resource
2020-01-09 08:50:11 -08:00
guoxudong
891ba0f461 fix zh/breakfast.md & zh/ldap.md 2020-01-09 17:03:01 +08:00
Phillip Wittrock
2f5be62387 cmd/config run scoping and path defaulting
- default the path and index for Resources generated by functions
- scope functions to only operate against resources in subdirectories
2020-01-08 22:13:58 -08:00
Jeff Regan
a46046dac5 Merge pull request #2051 from haiyanmeng/nil
Two fixes of the crawler
2020-01-08 18:39:26 -08:00
Kubernetes Prow Robot
1404d2749d Merge pull request #2041 from seans3/kustomize-apply-deps
Adds helper functions for apply grouping objects
2020-01-08 12:03:40 -08:00
Kubernetes Prow Robot
9fe9a2500a Merge pull request #2043 from pwittrock/master
Fix various cmd/config issues
2020-01-08 11:23:41 -08:00
Jeff Regan
6186e4edb7 Merge pull request #2017 from haiyanmeng/search
Add ElasticSearch query examples
2020-01-08 11:19:32 -08:00
Morten Torkildsen
cfcf885031 Implement new rules for status for PDBs 2020-01-08 11:07:25 -08:00
Phillip Wittrock
54e92f1ab0 yaml formatter improvements
- identify and fix yaml 1.1 compatibility issues in configuration
- support providing function for performing custom formatting
2020-01-08 10:47:11 -08:00
Phillip Wittrock
04f5e6c953 Functions for identifying and fixing yaml 1.1 compatbility issues
- Identify if a field value would parse as a non-string yaml 1.1 value
- Using OpenAPI Schema to get Resource's field type
- Format yaml so value will be parsed as the correct type using a yaml 1.1 parser
2020-01-08 10:47:11 -08:00
Phillip Wittrock
9000eb7f81 Improve testing error messaging when comparing files 2020-01-08 10:47:11 -08:00
Phillip Wittrock
abeab51cae Library for getting Resource and field Schema from OpenAPI 2020-01-08 10:47:11 -08:00
Haiyan Meng
b154af8be4 Check the error of closing response body 2020-01-08 10:32:12 -08:00
Haiyan Meng
ccd129f7a5 Check empty http response before accessing it 2020-01-08 10:24:00 -08:00
Haiyan Meng
e2b56910f9 Add ElasticSearch query examples 2020-01-08 09:23:19 -08:00
guoxudong
21f7fa07c0 Merge remote-tracking branch 'upstream/master' 2020-01-08 14:10:46 +08:00
guoxudong
92f4a09e0b add zh docs: ldap multibases multi-namespace breakfast sprint-boot mysql 2020-01-08 14:10:24 +08:00
Jeff Regan
ed83b2d8fa Merge pull request #2044 from phanimarupaka/UnpinApi
UnPin api
2020-01-07 18:22:53 -08:00
Phani Teja Marupaka
bda865e9e4 UnPin api 2020-01-07 16:25:01 -08:00
Phillip Wittrock
77b59760c1 Support for source and sink with functions 2020-01-07 16:24:52 -08:00
Phillip Wittrock
4628705494 Parse metadata directly instead of struct serialization hack 2020-01-07 16:24:52 -08:00
Phillip Wittrock
e619cec090 Cleanup completion for kustomize 2020-01-07 16:24:52 -08:00
Phillip Wittrock
0cca76fbb8 Clear config.kubernetes.io/path annotation in cmd/cat 2020-01-07 16:24:52 -08:00
Phillip Wittrock
e473433cba Remove config.kubernetes.io/package annotation
It doesn't do anything useful
2020-01-07 16:24:52 -08:00
Phillip Wittrock
0cae0feb9b rename config.k8s.io/function to config.kubernetes.io/function 2020-01-07 16:24:49 -08:00
Jeff Regan
2437e1ffe7 Merge pull request #2042 from monopole/pinUnpin
Script to ease pinning modules to kustomize api
2020-01-07 16:18:06 -08:00
Jeffrey Regan
00f7656f1b Script to ease pinning modules to kustomize api 2020-01-07 16:05:33 -08:00
Jeff Regan
32c280664d Merge pull request #2025 from phanimarupaka/ConfigMapSpacesAndTabs
Trim trailing spaces and tabs from config map files
2020-01-07 15:53:31 -08:00
Sean Sullivan
abc57e481b Adds helper functions for apply grouping objects 2020-01-07 15:23:09 -08:00
Haiyan Meng
594a3bf0d2 Add a binary for generating the stats of the index
1) how many kinds of objects are being customized?
2) how many times is every kind of object customized?
3) how many kustomization features are being used?
4) how many times is every kustomization feature used?
2020-01-07 15:10:25 -08:00
Phani Teja Marupaka
2094f23414 Rerun travis CI 2020-01-07 15:05:59 -08:00
Morten Torkildsen
7b1a5f85ed Print the initial unknown status for all resources before looking at events 2020-01-07 15:01:47 -08:00
Jeff Regan
7190ea2688 Merge pull request #2038 from haiyanmeng/log-parser
Add a binary to parse GKE log
2020-01-07 14:57:40 -08:00
Jeff Regan
6bdb4fe2a6 Update main.go 2020-01-07 14:52:20 -08:00
Phani Teja Marupaka
62964bfcb4 Remove replace from kustomize/go.mod 2020-01-07 14:42:43 -08:00
Jeff Regan
e13c26b2f8 Merge pull request #2020 from ttonline6/execPluginGuidedExample.md
fix error url
2020-01-07 13:57:54 -08:00
Jeff Regan
647731a6ad Update execPluginGuidedExample.md 2020-01-07 13:57:30 -08:00
Kubernetes Prow Robot
426407a1b2 Merge pull request #1889 from frankfarzan/functions-doc
Generalize Configuration Functions Spec.
2020-01-07 13:14:19 -08:00
Frank Farzan
3276e74d2d Generalize configuration functions spec in RFC format.
As defined in `kustomize config docs-fn-spec`, configuration functions can be
implemented using any toolchain and invoked using any container workflow orchestrator
(e.g. Tekton, Cloud Build) or run directly using docker run.

functions-impl describes using `kustomize config run` as an example
orchestrator for invoking configuration functions.
2020-01-07 12:51:24 -08:00
Jeff Regan
bbceb49fc4 Merge pull request #2012 from julienp/master
Show namespace resource on id conflict
2020-01-07 11:41:01 -08:00
Haiyan Meng
950660ff63 Add a binary to parse GKE log 2020-01-07 10:31:10 -08:00
Kubernetes Prow Robot
f749a4a194 Merge pull request #2036 from pwittrock/fix-go-mod
Switch to api version 0.3.1
2020-01-07 10:08:18 -08:00
Jeff Regan
79cfdb0976 Merge pull request #1983 from mortent/statusCmdTests
Add tests for status cli
2020-01-07 09:56:04 -08:00
Jeff Regan
9ec4100ee1 Merge pull request #2001 from haiyanmeng/expose-es
Several fixes of Crawler
2020-01-07 09:49:01 -08:00
Phillip Wittrock
6e7f7ce194 create travis check for go.mod's 2020-01-07 09:45:01 -08:00
Phillip Wittrock
b1f514632a Switch to api version 0.3.1 2020-01-07 08:54:05 -08:00
Haiyan Meng
745b58b3d0 Check whether a pointer is empty before accessing it to avoid SIGSEGV 2020-01-06 12:06:18 -08:00
Haiyan Meng
142c105500 SKip the empty resource/base item in a kustomization file and set the
defaultBranch if needed
2020-01-06 12:06:18 -08:00
Haiyan Meng
5f8a8b545b Add "kustomization" into the kustomization filenames used by the crawler 2020-01-06 12:06:18 -08:00
Haiyan Meng
ee659a70e4 Fix how to construct URLs for finding all the commits related to a
github file

The existing logic sets the creation time of a github file to the time
when the github repository was created.
The fix sets the creation time of a github file to the time when the
file was created.
2020-01-06 12:06:18 -08:00
Kubernetes Prow Robot
837df94d67 Merge pull request #2027 from prachirp/configFnDocs
Docs and examples use config.k8s.io/function annotation
2020-01-06 11:00:19 -08:00
Prachi Pendse
6b90f13281 Clarify docs messaging 2020-01-06 13:05:24 +05:30
Kubernetes Prow Robot
db5e2c42b0 Merge pull request #2031 from pwittrock/master
list-setters command
2020-01-04 11:31:40 -08:00
Phillip Wittrock
d489bdedd7 publish list-setters command 2020-01-04 09:39:56 -08:00
Kubernetes Prow Robot
8b10aea859 Merge pull request #2030 from pwittrock/master
Fix `kio` sorting for files with more than 9 Resources
2020-01-03 12:51:41 -08:00
Phillip Wittrock
a7a28a85a4 Fix kio sorting for files with more than 9 Resources 2020-01-03 12:33:28 -08:00
Kubernetes Prow Robot
2c8736ccb2 Merge pull request #2029 from pwittrock/master
Release kyaml 0.0.5
2020-01-03 10:31:42 -08:00
Phillip Wittrock
9062a83276 Release kyaml 0.0.5 2020-01-03 09:57:50 -08:00
Prachi Pendse
5ee6380b1c Docs and examples use config.k8s.io/function annotation
- Update function docs to recommend new annotation
- Update examples to use config.k8s.io/function annotation
2020-01-03 10:52:56 +05:30
Kubernetes Prow Robot
2880c2ae5d Merge pull request #2026 from pwittrock/master
kyaml `setters`: support full and partial field replacement
2020-01-02 16:33:41 -08:00
Phillip Wittrock
e0b766ee46 Fix issue with setting set-by 2020-01-02 15:55:38 -08:00
Phani Teja Marupaka
2ab884c879 Push commit to point to changes 2020-01-02 15:06:54 -08:00
Phillip Wittrock
ac9b0a3e9e kyaml setters: support full and partial field replacement 2020-01-02 14:00:43 -08:00
Phani Teja Marupaka
5e1ddf38db Rerun travis-ci 2020-01-02 13:52:15 -08:00
Phani Teja Marupaka
011804e14d Make suggested changes 2020-01-02 13:06:14 -08:00
Phani Teja Marupaka
7753a04fdc Empty commit to trigger cncf-cla 2020-01-02 11:14:25 -08:00
Morten Torkildsen
f0d81c4fac Add tests for status cli 2020-01-02 10:42:51 -08:00
Phani Teja Marupaka
fa8f504ff4 Trim trailing spaces and tabs from config map files 2020-01-02 10:28:03 -08:00
Kubernetes Prow Robot
3577a7e174 Merge pull request #2022 from mortent/Docs
Better documentation for the resource and status commands.
2020-01-02 09:51:41 -08:00
Kubernetes Prow Robot
e4274bccba Merge pull request #2024 from pwittrock/release
Release kyaml and cmd/config 0.0.4
2020-01-02 09:49:40 -08:00
Phillip Wittrock
4b64801d44 release kyaml and cmd/config 0.0.4 2020-01-02 08:59:12 -08:00
Phillip Wittrock
a9c5f90805 fix releasing message 2020-01-02 08:58:01 -08:00
Kubernetes Prow Robot
29a1b96b96 Merge pull request #2023 from pwittrock/set
Refactor `set`
2020-01-02 08:57:42 -08:00
Phillip Wittrock
b37abbf057 Refactor set
- Implement inline setters as OpenAPI extensions
- Naming cleanup substitute -> set
- Documentation cleanup
- Simplify implementation
2020-01-02 08:32:38 -08:00
Kubernetes Prow Robot
3bef339186 Merge pull request #1890 from joncwong/merge3
Integrate merge3 as command for 3-way merges
2020-01-02 07:43:41 -08:00
Kubernetes Prow Robot
fc4a73f816 Merge pull request #2014 from alexeldeib/ace/varName
fix empty var names + clean up cross platform tests
2020-01-02 07:39:40 -08:00
Kubernetes Prow Robot
6e6878730c Merge pull request #2010 from prachirp/funcAnnotation
Add support for config.k8s.io/function annotation
2020-01-02 07:21:40 -08:00
Morten Torkildsen
71ce46416e Better documentation for the resource and status commands. 2020-01-01 14:05:14 -08:00
wangyetao
a47eff804b fix error url 2019-12-31 15:03:55 +08:00
Ace Eldeib
c4d3a2ff3f tests: make paths for x-plat friendly 2019-12-29 17:28:45 -08:00
Ace Eldeib
e0f62c67f6 fix: avoid passing empty variable names 2019-12-29 16:48:53 -08:00
Julien Poissonnier
0988f74d39 Show namespace resource on id conflict 2019-12-27 16:00:14 +01:00
Jonathan Wong
ef82c736b9 Remove newline 2019-12-24 21:46:59 -08:00
Jonathan Wong
fc57f530ee Clean up merge3 changes 2019-12-24 21:18:40 -08:00
Jonathan Wong
4bdfb1c511 Remove refactored cmd directory 2019-12-24 21:14:27 -08:00
Kubernetes Prow Robot
697a6e9759 Merge pull request #2009 from KnVerey/default_structure
config tree defaults to graph structure when ownerRefs available
2019-12-24 10:07:29 -08:00
Prachi Pendse
f6320ca379 Add support for config.k8s.io/function annotation 2019-12-23 13:44:42 -08:00
Katrina Verey
24cf0c1fdc config tree defaults to graph structure when ownerRefs available 2019-12-23 16:36:25 -05:00
Kubernetes Prow Robot
3900166fdf Merge pull request #2006 from pwittrock/set
Move setters to be available as libraries
2019-12-21 16:53:33 -08:00
Phillip Wittrock
ad4eb87e2e move setters to be available as libraries 2019-12-21 16:29:06 -08:00
Kubernetes Prow Robot
19928abb6f Merge pull request #2005 from pwittrock/complete
completion should suggest directories if use contains DIR
2019-12-21 16:21:32 -08:00
Phillip Wittrock
8a1874d20d completion should suggest directories if use contains DIR 2019-12-21 16:04:23 -08:00
Kubernetes Prow Robot
a280cdf5ee Merge pull request #2000 from pwittrock/master
release `kyaml` and `cmd/config` 0.0.3
2019-12-20 09:57:33 -08:00
Phillip Wittrock
fdf8f1b3df release kyaml and cmd/config 0.0.3 2019-12-20 09:40:10 -08:00
Kubernetes Prow Robot
105f25860e Merge pull request #1999 from pwittrock/fix-fmt
fix issues caused by dropping or overriding style
2019-12-20 09:27:33 -08:00
Jonathan Wong
e35e0bff60 Update docs for merge3 2019-12-20 03:48:29 -08:00
Jonathan Wong
8095b16c9a Add test for merge3 command 2019-12-20 03:47:45 -08:00
Jonathan Wong
d04b4a2899 Remove unnecessary 1-line comment 2019-12-20 03:47:45 -08:00
Jonathan Wong
aafeb75ef1 Rebase merge3 branch into master 2019-12-20 03:43:11 -08:00
Phillip Wittrock
98431f6a00 fix kyaml issue where dropping Style created issues
dropping the node style creates a compatibility issue where quotes around "on" are dropped
because yaml.v3 interprets it as a string.

other yaml parsers interpret on as a bool value, and parse it as a bool rather than string.

fix: retain the original style so it is kept as quoted.

- fmt: don't drop the styles
- merge2: keep the style when merging elements
- setting a field: if changing the value of a scalar field, retain its style by default
2019-12-19 20:25:31 -08:00
Jeff Regan
1ce3d9e099 Merge pull request #1985 from haiyanmeng/expose-es
Crawler Improvements
2019-12-19 18:05:49 -08:00
Kubernetes Prow Robot
e199c7f805 Merge pull request #1998 from seans3/kustomize-apply-deps
Update go.mod to point to most recent version of k8s.io/kubectl
2019-12-19 13:35:57 -08:00
Sean Sullivan
49f17586ca Update go.mod to point to most recent version of k8s.io/kubectl 2019-12-19 11:20:12 -08:00
Haiyan Meng
be2e03681d Remove unused param from IndexFunc 2019-12-18 15:56:44 -08:00
Haiyan Meng
127541f610 Support diffrent modes of running the crawler 2019-12-18 15:56:44 -08:00
Haiyan Meng
f5ff254203 Update deps 2019-12-18 15:56:44 -08:00
Haiyan Meng
a35f002139 Run goimports 2019-12-18 15:56:44 -08:00
Haiyan Meng
bef157d6b3 Fix insert/updating document logic 2019-12-18 15:56:44 -08:00
Haiyan Meng
2c2aa928cc Delete non-existing documents from the index 2019-12-18 15:56:44 -08:00
Haiyan Meng
1eb713157c Sort the string slice fields of a document to avoid updating the index
unnecessarily
2019-12-18 15:56:44 -08:00
Haiyan Meng
272b7a6fcd Use UpdateRequest to insert/update a document
Currently, `IndexRequest` is used to insert/update a document, which
increases the version of the document every time IndexRequest.Do is
called.
2019-12-18 15:56:44 -08:00
Haiyan Meng
5598d35e4b Add a summary for doCrawl 2019-12-18 15:56:44 -08:00
Haiyan Meng
8c89f0946c Avoid to index a document if FetchDcoument or SetCreated fails 2019-12-18 15:56:44 -08:00
Haiyan Meng
12fc8f41c7 Add support for github paths starting with "git@github.com:" 2019-12-18 15:56:44 -08:00
Haiyan Meng
e44d1298df Return errors if http Client.Do resp status code is not 2xx 2019-12-18 15:56:44 -08:00
Kubernetes Prow Robot
7e56c2c768 Merge pull request #1995 from iliazlobin/varreference
Handle variables in annotations
2019-12-18 11:27:57 -08:00
Ilia Zlobin
cc8b100331 Handle variables in annotations 2019-12-18 17:04:43 +03:00
Kubernetes Prow Robot
2c1cd6de41 Merge pull request #1880 from mortent/documentation
Add documentation for the kstatus library
2019-12-17 19:57:57 -08:00
Kubernetes Prow Robot
32b55109f7 Merge pull request #1978 from oke-py/doc
Fixed a wrong path and run `make all`
2019-12-17 16:39:58 -08:00
Kubernetes Prow Robot
21bf05d05e Merge pull request #1986 from pwittrock/release
Update api to 0.3.1
2019-12-17 15:17:58 -08:00
Kubernetes Prow Robot
d5e88977b3 Merge pull request #1981 from pwittrock/fieldmeta
Rename ownedBy and refactor kyaml travis
2019-12-17 15:01:59 -08:00
Phillip Wittrock
c66dd497c3 Update api to 0.3.1 2019-12-17 14:12:25 -08:00
Phillip Wittrock
3dd3654792 Merge pull request #1984 from pwittrock/bf
pin version of mdrip and blackfriday to fix build errors
2019-12-17 13:49:49 -08:00
Phillip Wittrock
de824c2e4d Drop mdrip dependency from api/ because it has conflicting deps with kubectl 2019-12-17 13:48:29 -08:00
Phillip Wittrock
502f86a982 rename ownedBy json value to setBy 2019-12-17 11:50:18 -08:00
Phillip Wittrock
ae2bfc8ee6 Fix travis kyaml exit and targets
- properly exit non-0 if there are any uncommitted files
- make functions/examples targes
- add missing licenses
- refactor into loop
2019-12-17 11:50:18 -08:00
Kubernetes Prow Robot
49127f702c Merge pull request #1976 from pwittrock/fixes
Using single quote style when setting annotations
2019-12-17 07:56:00 -08:00
Naoki Oketani
7a384bc0d8 Fixed a wrong path and run make all 2019-12-17 18:22:49 +09:00
Jeff Regan
79a891f488 Merge pull request #1977 from monopole/pinKustomize
Pin kustomize to specific versions of local deps.
2019-12-16 19:28:00 -08:00
Kubernetes Prow Robot
a4da55b1bc Merge pull request #1973 from pwittrock/release-scripts
Improve release process
2019-12-16 19:21:38 -08:00
Jeffrey Regan
0b9aa418c0 Pin kustomize to specific versions of local deps. 2019-12-16 19:10:20 -08:00
Phillip Wittrock
eaaefc128f Using single quote style when setting annotations
Annotations must be strings.  Use single-quote style
so tools don't get confused about the type.
2019-12-16 18:04:46 -08:00
Phillip Wittrock
60188ebe20 Address issues in release scripts
- Merge in changes to branches
- Get rid of releaseall.sh -- it is too error prone right now
- Support for releasing pluginator
- Automatically release binaries for kustomize
2019-12-16 16:30:08 -08:00
Kubernetes Prow Robot
01105af14d Merge pull request #1952 from bzub/function_example_kubeval
Add kubeval function example.
2019-12-16 15:17:38 -08:00
Kubernetes Prow Robot
751491551b Merge pull request #1953 from sunny0826/master
Update zh/INSTALL.md
2019-12-16 15:07:38 -08:00
Kubernetes Prow Robot
b38c0bc5c1 Merge pull request #1962 from pwittrock/sub
Support for set / substitution
2019-12-16 13:39:38 -08:00
Kubernetes Prow Robot
b07ae5558a Merge pull request #1969 from pwittrock/release-scripts
Add release scripts for modules and binaries
2019-12-16 13:35:38 -08:00
Phillip Wittrock
ae8143a9be Add release scripts for modules and binaries 2019-12-16 13:05:17 -08:00
Kubernetes Prow Robot
7edea2646f Merge pull request #1972 from monopole/goSumBlah
Update go.sums
2019-12-16 12:19:38 -08:00
Jeffrey Regan
90597d56c9 Update go.sums 2019-12-16 11:37:35 -08:00
Phillip Wittrock
62e969c719 cmd/config set: Support for setting fields imperatively from the cli 2019-12-16 10:39:55 -08:00
Kubernetes Prow Robot
9853948ac6 Merge pull request #1971 from kubernetes-sigs/revert-1970-doc
Revert "Fixed a wrong path and run `make generate`"
2019-12-16 10:01:39 -08:00
Phillip Wittrock
53db9b8de4 Revert "Fixed a wrong path and run make generate" 2019-12-16 09:29:22 -08:00
Kubernetes Prow Robot
2fc224c2ff Merge pull request #1965 from prachirp/config-doc
Clarify removing annotations in config-io
2019-12-16 09:27:38 -08:00
Kubernetes Prow Robot
3b904108bd Merge pull request #1970 from oke-py/doc
Fixed a wrong path and run `make generate`
2019-12-16 09:21:37 -08:00
Naoki Oketani
6fbab07df5 Fixed a wrong path and run make generate 2019-12-16 12:57:15 +09:00
guoxudong
46f1f1b5da fix 2019-12-14 11:02:08 +08:00
Prachi Pendse
b5dba5b4da Clarify removing annotation in config-io 2019-12-13 16:43:50 -08:00
Jeff Regan
75e9079baa Merge pull request #1964 from monopole/updateJs
Update serialize-javascript
2019-12-13 15:03:35 -08:00
Jeffrey Regan
7e205b46b8 Update serialize-javascript 2019-12-13 14:45:43 -08:00
Jeff Regan
a599d781ae Merge pull request #1961 from mortent/ReverseCurse
Remove dependency on curse library
2019-12-13 14:24:40 -08:00
Jeff Regan
c6c099a9d1 Merge pull request #1948 from haiyanmeng/expose-es
Add supports for crawling a specific git user or repo
2019-12-13 13:24:03 -08:00
Haiyan Meng
a9244f759e Add supports for crawling a specific git user or repo 2019-12-13 11:18:33 -08:00
Morten Torkildsen
60e2375521 Remove dependency on curse library 2019-12-13 09:18:36 -08:00
Kubernetes Prow Robot
e0ba78f292 Merge pull request #1955 from brannondorsey/patch-1
Minor grammar fix
2019-12-13 09:07:10 -08:00
Kubernetes Prow Robot
322f368cdf Merge pull request #1956 from artmello/remove_funlen_from_linter_list
kyaml: Remove funlen from Go linters list
2019-12-13 08:59:21 -08:00
Arthur Mello
ec3668fd34 kyaml: Remove funlen from Go linters list 2019-12-13 13:38:24 -03:00
bzub
68af986e09 Add kubeval function example. 2019-12-13 09:55:51 -06:00
Brannon Dorsey
735c249bc4 Minor grammar fix 2019-12-12 22:23:04 -05:00
Jeff Regan
7c8e2f3948 Merge pull request #1954 from monopole/pinToKustomizeApiV030
Pin to kustomize API v0.3.0
2019-12-12 19:04:58 -08:00
jregan
b8a13b6335 Pin to kustomize API v0.3.0 2019-12-12 18:41:05 -08:00
guoxudong
e0597683d4 Update zh/INSTALL.md 2019-12-13 09:59:24 +08:00
Jeff Regan
425cc04a34 Merge pull request #1951 from monopole/pinPluginatorToApiV030
Pin pluginator to api v0.3.0
2019-12-12 17:11:36 -08:00
Jeffrey Regan
2252b3cc8b Pin pluginator to api v0.3.0 2019-12-12 17:04:30 -08:00
Kubernetes Prow Robot
943693e8e4 Merge pull request #1949 from seans3/command-move
Rename misspelled commands.go
2019-12-12 16:54:54 -08:00
Jeff Regan
05829497d8 Merge pull request #1950 from monopole/dropPluginatorFromApiDeps
Drop api module's explicit dependence on pluginator.
2019-12-12 16:50:40 -08:00
Jeffrey Regan
87cf1231c3 Drop api module's explicit dependence on pluginator. 2019-12-12 16:36:57 -08:00
Sean Sullivan
1cae8f9858 Rename misspelled commands.go 2019-12-12 16:32:51 -08:00
Kubernetes Prow Robot
129206a3c8 Merge pull request #1947 from pwittrock/apply
expose apply Options so we can tune them
2019-12-12 16:02:55 -08:00
Phillip Wittrock
7bdb5d3cfa expose apply Options so we can tune them 2019-12-12 15:22:27 -08:00
Jeff Regan
6309af43a7 Merge pull request #1946 from monopole/dropLastDirectRefsToPseudoK8s
Drop last direct refs to pseudo/k8s.
2019-12-12 15:04:47 -08:00
Jeffrey Regan
ac1f4fec4a Drop last direct refs to pseudo/k8s. 2019-12-12 15:02:04 -08:00
Jeff Regan
792caeac82 Merge pull request #1945 from monopole/modTidyB4Release
Go mod tidy b4 release.
2019-12-12 14:45:49 -08:00
Jeffrey Regan
bb03507d98 Go mod tidy b4 release. 2019-12-12 14:24:06 -08:00
Kubernetes Prow Robot
4fc859b62e Merge pull request #1876 from lalyos/fix-process-args-fields
Fix process args fields
2019-12-12 14:16:32 -08:00
Jeff Regan
7cdb157a55 Update execplugin_test.go 2019-12-12 13:57:00 -08:00
Haiyan Meng
50ce2a66a3 Separate the two types of crawling
1) crawling the documents in the index to update these documents;
2) crawling the whole github.
2019-12-12 13:42:07 -08:00
Jeff Regan
dae03a9618 Merge branch 'master' into fix-process-args-fields 2019-12-12 13:41:50 -08:00
Jeff Regan
6dd48142cf Update execplugin_test.go 2019-12-12 13:41:08 -08:00
Jeff Regan
3f1b100edc Merge pull request #1944 from monopole/ahJs
Update npm deps.
2019-12-12 13:20:36 -08:00
Jeffrey Regan
61c5afdf83 Update npm deps. 2019-12-12 13:18:30 -08:00
Kubernetes Prow Robot
71e75283de Merge pull request #1942 from pwittrock/internal
refactor cmd/config to internal
2019-12-12 13:06:32 -08:00
Phillip Wittrock
98d2be5550 refactor cmd/config to internal 2019-12-12 12:46:31 -08:00
Jeff Regan
634c780d1b Merge pull request #1943 from monopole/tweakGoPluginBuildScript
Tweak Go plugin build script and targets.
2019-12-12 11:10:01 -08:00
Jeffrey Regan
400140a401 Tweak Go plugin build script and targets. 2019-12-12 11:06:44 -08:00
Kubernetes Prow Robot
e80bd10374 Merge pull request #1940 from pwittrock/apply
Publish apply and diff from kustomize
2019-12-12 10:54:33 -08:00
Phillip Wittrock
9242269b5b update kyaml travis to include new directories and check for generated files 2019-12-12 10:28:11 -08:00
Phillip Wittrock
7e847dc907 publish apply / diff as alpha commands 2019-12-12 10:28:10 -08:00
Phillip Wittrock
6dbed7c16c copy apply and diff commands from kubectl 2019-12-12 10:23:47 -08:00
Phillip Wittrock
1a3f622207 regenerate docs and license 2019-12-12 10:22:12 -08:00
Phillip Wittrock
1a28e493cd Fix client-go version to match apimachinery version 2019-12-12 10:22:12 -08:00
Haiyan Meng
d9239104aa Escape spaces in the query paths of git commit requests 2019-12-12 10:03:15 -08:00
Jeff Regan
f5805c64b2 Merge pull request #1920 from bzub/1919-build_go_plugins_script
Add script to detect/build Go plugins.
2019-12-12 09:56:37 -08:00
Jeff Regan
f299b28693 Merge pull request #1941 from monopole/upgradeToMDrip101
Upgrade to mdrip 1.0.1
2019-12-12 09:53:36 -08:00
Jeffrey Regan
ee678d6ce9 Upgrade to mdrip 1.0.1 2019-12-12 09:26:11 -08:00
Kubernetes Prow Robot
d5b44461b9 Merge pull request #1611 from sunny0826/zh
add zh doc transformerconfigs.md validationTransformer.md
2019-12-12 09:04:33 -08:00
Kubernetes Prow Robot
57059b74f5 Merge pull request #1904 from artmello/enable_gocritic
kyaml: Enable gocritic Go linter
2019-12-12 06:56:32 -08:00
Kubernetes Prow Robot
cd0b06c4fd Merge pull request #1937 from mortent/FixStatusRules
Fix issues with rules for Deployment and ReplicaSet
2019-12-12 06:40:31 -08:00
Kubernetes Prow Robot
057893a254 Merge pull request #1931 from pwittrock/vendor
Disable Alpha commands by default
2019-12-12 06:36:32 -08:00
Phillip Wittrock
1e14cc93c2 Merge branch 'master' into enable_gocritic 2019-12-12 06:35:33 -08:00
Kubernetes Prow Robot
54e8aab374 Merge pull request #1939 from pwittrock/kyaml-comments
Fix panic in merge2 comment merging
2019-12-11 20:02:32 -08:00
Phillip Wittrock
4312ab3f4d Fix panic in merge2 comment merging 2019-12-11 19:05:51 -08:00
Phillip Wittrock
6484259632 Disable alpha kustomize commands by default.
- enable alpha commands with env KUSTOMIZE_SHOW_ALPHA_COMMANDS=true
2019-12-11 18:42:46 -08:00
guoxudong
92dcc02ff1 fix zh doc 2019-12-12 10:21:18 +08:00
Kubernetes Prow Robot
fe6dffff2e Merge pull request #1935 from pwittrock/unk8s2
Remove psuedo/k8s module
2019-12-11 16:20:32 -08:00
Kubernetes Prow Robot
e1205698e6 Merge pull request #1933 from haiyanmeng/expose-es
Expose ElasticSearch as a LoadBalancer-type service
2019-12-11 16:16:32 -08:00
Kubernetes Prow Robot
a6535c4be2 Merge pull request #1934 from pwittrock/unk8s
revert pseudo/k8s deps
2019-12-11 16:08:32 -08:00
Morten Torkildsen
a28c353eab Fix issues with rules for Deployment and ReplicaSet 2019-12-11 15:51:30 -08:00
Phillip Wittrock
4791bf8e0b remove pseudo/k8s module 2019-12-11 15:29:06 -08:00
Jeff Regan
4025603396 Merge pull request #1936 from kubernetes-sigs/startAddressing1898
Introduce latest_kustomize tag in release process
2019-12-11 15:28:15 -08:00
Phillip Wittrock
c2dc7ae789 revert pseudo/k8s deps 2019-12-11 15:28:04 -08:00
Phillip Wittrock
484ad36529 remove verify deps -- use k8s directly 2019-12-11 15:28:03 -08:00
Jeff Regan
0e251ed96e Update README.md 2019-12-11 15:22:30 -08:00
Haiyan Meng
afd24c6faf Expose ElasticSearch as a LoadBalancer-type service 2019-12-11 15:05:10 -08:00
Jeff Regan
6b7236a206 Update INSTALL.md 2019-12-11 14:26:09 -08:00
Kubernetes Prow Robot
f65cac96d6 Merge pull request #1932 from haiyanmeng/fix
Avoid processing the nil pointer returned by kustomizationResultAdapter
2019-12-11 14:22:32 -08:00
Haiyan Meng
0d79219e46 Avoid processing the nil pointer returned by kustomizationResultAdapter
Currently, the crawler job panics whenever a nil pointer is returned by
kustomizationResultAdapter.
2019-12-11 13:54:01 -08:00
Kubernetes Prow Robot
e4635b456a Merge pull request #1930 from mortent/statusCli
cli for status
2019-12-11 13:34:32 -08:00
Morten Torkildsen
1b3b8522f9 cli for status 2019-12-11 13:13:09 -08:00
Jeff Regan
4098d6fdfb Merge pull request #1928 from haiyanmeng/empty
Mulitple improvements of the crawler
2019-12-11 13:04:29 -08:00
Jeff Regan
4ba69b27f8 Merge pull request #1922 from bzub/cmd_config_docs
cmd/config: Documentation nits + updates.
2019-12-11 12:59:41 -08:00
Haiyan Meng
bffc0d7071 Mulitple improvements of the crawler
1) Set document IDs to avoid duplicating documents;
2) Set the `creationTime` field of each document in the index;
3) set the `values`, `kinds` and `identifiers` fields for all documents;
4) Add a `Copy` method into the `Document` struct: this fixes the issue
where all the documents existing in the index point to the same Document
object;
5) Avoid using keystore redis;
6) Set imagePullPolicy to `Always` for crawler jobs.
2019-12-11 11:10:48 -08:00
Jeff Regan
54b1549586 Merge pull request #1909 from bzub/1908-plugin_test_path
Detect path to plugins from krusty tests.
2019-12-11 10:24:14 -08:00
bzub
3803541bfd Remove extraneous whitespace.
make all (generate docs)

Update examples in cmd docs.

make all (generate docs)

functions/examples: Whitespace cleanup.

functions/examples: Fix some example commands.
2019-12-11 12:12:32 -06:00
Morten Torkildsen
c7307a9b28 Add documentation for the kstatus library 2019-12-10 20:31:08 -08:00
Kubernetes Prow Robot
2102ddab7c Merge pull request #1916 from bzub/plugins_doc_go_link
Update plugins/doc.go link.
2019-12-10 15:50:06 -08:00
Kubernetes Prow Robot
f186a0d6bb Merge pull request #1927 from frankfarzan/config_io_docs
Expand and format Configuration IO API Semantics.
2019-12-10 13:24:05 -08:00
Frank Farzan
b0f1f66d9a Document the default value 2019-12-10 12:27:02 -08:00
Frank Farzan
8c037ba109 Index is a number not a string 2019-12-10 12:15:28 -08:00
Frank Farzan
5e5e3b19f5 Expand and format Configuration IO API Semantics. 2019-12-10 12:02:49 -08:00
Kubernetes Prow Robot
ad94f2c0eb Merge pull request #1921 from pwittrock/fixes
kyaml: fix error handling
2019-12-09 17:07:30 -08:00
Phillip Wittrock
b333115314 kyaml: fix error handling 2019-12-09 16:38:56 -08:00
Kubernetes Prow Robot
50c9916eae Merge pull request #1905 from pwittrock/autocomplete
shell completion for kustomize commands
2019-12-09 16:37:30 -08:00
bzub
e1b18d125d Add script to detect/build Go plugins. 2019-12-09 17:59:59 -06:00
Kubernetes Prow Robot
8d72bf6e5c Merge pull request #1917 from frankfarzan/fix_run
Fix 'config run' by removing default mount.
2019-12-09 15:04:40 -08:00
Frank Farzan
a4c69d9cde Fix 'config run' by removing default mount.
In, pull #1822 mount logic was refactored where the default
mount using zero-value no longer makes sense and leads to
this failure:

"invalid argument "type=,src=,dst=:ro" for "--mount" flag: type is
required"

I think the intent here was to remove default mount.
2019-12-09 14:37:57 -08:00
bzub
ecb9b9efa4 Update plugins/doc.go link. 2019-12-09 15:45:05 -06:00
Phillip Wittrock
2eacbeaa87 shell completion for kustomize commands 2019-12-09 09:22:14 -08:00
Kubernetes Prow Robot
46be801a48 Merge pull request #1910 from artmello/enable_goconst
kyaml: Enable goconst Go Linter
2019-12-09 08:40:02 -08:00
Arthur Mello
0bace652c3 Move repeated variable content to constants following linter suggestion 2019-12-08 07:12:48 -03:00
Arthur Mello
f0779cd02f kyaml: Enable goconst Go Linter 2019-12-07 16:27:25 -03:00
bzub
105a8e57c8 Detect path to plugins from krusty tests. 2019-12-07 13:16:15 -06:00
Arthur Mello
0a8d7c2be2 Fix code to address complains from gocritic (assignOp, ifElseChain and appendAssign) 2019-12-06 16:34:27 -03:00
Arthur Mello
20d995c87e kyaml: Enable gocritic Go linter 2019-12-06 16:01:12 -03:00
Kubernetes Prow Robot
3703450931 Merge pull request #1893 from artmello/enable_linters
kyaml: Enable Go linters (lll, stylecheck, unparam, whitespace)
2019-12-06 08:32:50 -08:00
lalyos
95ad5d05b3 fix exec plugin args handling 2019-12-06 13:34:42 +01:00
Arthur Mello
d4fa006ccb Remove leading/trailing newlines following whitespace linter recommendation 2019-12-05 23:49:00 -03:00
Jeff Regan
b2814c5310 Update INSTALL.md 2019-12-05 18:22:37 -08:00
Jeff Regan
c00cf120ff Update INSTALL.md 2019-12-05 18:22:23 -08:00
Jeff Regan
decca7fcd3 Merge pull request #1891 from mortent/FixControllerRuntimeDeps
Fix dependencies for kstatus
2019-12-05 18:17:31 -08:00
Kubernetes Prow Robot
9914017f60 Merge pull request #1897 from pwittrock/workspace
support writing run output to files
2019-12-05 18:08:49 -08:00
Arthur Mello
a077482e99 Rename struct field to solve issue raised by go vet 2019-12-05 23:06:19 -03:00
Arthur Mello
849e0f357a Unname unused parameters following unparam linter recommendation 2019-12-05 22:50:37 -03:00
Arthur Mello
df7688002a Remove init function following gochecknoinits linter recommendation 2019-12-05 22:44:14 -03:00
Arthur Mello
e811da14d8 Rename variable, constants and struct fields following stylecheck linter recommendation 2019-12-05 22:39:29 -03:00
Phillip Wittrock
9e5af98a94 support writing run output to files
so that it isn't necessary to wrap in bash to redirect to a file
2019-12-05 17:25:01 -08:00
Arthur Mello
f2c7066088 Remove leading/trailing newlines following whitespace linter recommendation 2019-12-05 22:23:35 -03:00
Jeff Regan
3f5dc1e80a Merge pull request #1896 from monopole/tweakInstall
Improve install script error message
2019-12-05 15:18:42 -08:00
Jeffrey Regan
04bfb3e94d Tweak install. 2019-12-05 15:17:33 -08:00
Jeff Regan
567bc834c9 Update INSTALL.md 2019-12-05 14:47:11 -08:00
Jeff Regan
49f8b2bee8 Update INSTALL.md 2019-12-05 14:43:58 -08:00
Jeff Regan
b710a76818 Add kustomize install script. 2019-12-05 14:02:16 -08:00
Jeff Regan
823c59666b Merge pull request #1894 from monopole/installScript
Kustomize installation script.
2019-12-05 13:51:53 -08:00
Jeffrey Regan
e14c441e77 Kustomize installation script. 2019-12-05 13:50:53 -08:00
Arthur Mello
de4d50386d kyaml: Enable Go linters (lll, stylecheck, unparam, whitespace) 2019-12-05 16:32:17 -03:00
Jeff Regan
969a1e8f37 Merge pull request #1892 from monopole/getRidOfFakeLoader
Get rid of the 'fake' loader.
2019-12-05 11:22:47 -08:00
Jeff Regan
184735fa89 Merge pull request #1887 from Liujingfang1/replacement-poc
add replacement type and an example transformer
2019-12-05 11:10:35 -08:00
Jeffrey Regan
caa71a73fe Get rid of the fake loader. 2019-12-05 10:50:42 -08:00
Morten Torkildsen
2625502ddb Fix dependencies for kstatus 2019-12-04 21:56:55 -08:00
Kubernetes Prow Robot
7c1b477ff6 Merge pull request #1888 from haiyanmeng/duplicates
Remove duplicates in the `kinds` field of the kustomize ElasticSearch index
2019-12-04 12:04:57 -08:00
Haiyan Meng
d25b6ff3dc Remove duplicates in kinds 2019-12-04 11:24:54 -08:00
Haiyan Meng
68a196dbe5 Add a test case to demonstrate kinds have duplicates 2019-12-04 11:24:23 -08:00
Jingfang Liu
c7600bc079 add replacement type and an example transformer 2019-12-04 11:13:05 -08:00
Jeff Regan
79884240ae Merge pull request #1883 from haiyanmeng/mapping
Set the ElasticSearch index creation configuration
2019-12-03 19:09:55 -08:00
Kubernetes Prow Robot
3880b8df1d Merge pull request #1822 from joncwong/container-local-vol
Add Local Volume support to ContainerFilter
2019-12-03 16:30:58 -08:00
Haiyan Meng
8aaa3f56f5 Set the ElasticSearch index creation configuration
Currently, the `kustomize` index in ElasticSearch is using dynamic
mapping, which sets the types of all the fields to `text`. However,
`text` field type is good for full-text value matching, and not good for
exact-value matching.  For exact-value matching, the `keyword` filed
type should be used.
2019-12-03 15:16:32 -08:00
Jeff Regan
4a7ade6421 Merge pull request #1882 from monopole/crawlerNitSweep
Fix some nits in the crawler and elsewhere.
2019-12-03 11:22:36 -08:00
Jeffrey Regan
e9ab3da164 Fix some nits in the crawler and elsewhere. 2019-12-03 10:44:44 -08:00
Jonathan Wong
dff30b926e Nit fixes and proper RunFns integration 2019-12-03 00:17:12 -08:00
Jeff Regan
fd5db20a48 Update harness.go 2019-12-02 18:47:07 -08:00
Jeff Regan
8e99dbdaf0 Merge pull request #1881 from monopole/pluginSimplification
Simplify test framework
2019-12-02 18:37:04 -08:00
Jeffrey Regan
861c86a70a Simplify plugin tests. 2019-12-02 17:12:59 -08:00
Jeff Regan
0a19a5dbd9 Merge pull request #1879 from monopole/consolidateTestHarness
Consolidate test harness to one package.
2019-12-02 12:48:15 -08:00
Jeffrey Regan
382c330f5b Consolidate test harness to one package. 2019-12-02 12:29:10 -08:00
Kubernetes Prow Robot
ce935448c1 Merge pull request #1877 from joncwong/patch-5
Fix three typos
2019-12-02 07:49:05 -08:00
Jonathan Wong
49287a0f8f Fix verb noun agreement mistake 2019-12-02 02:01:00 -08:00
Jonathan Wong
1433ea4faa Fix two typos 2019-12-02 01:55:20 -08:00
Jeff Regan
daa14ae4bd Merge pull request #1875 from lalyos/fix-sed-plugin
fix quotation issues by using a bash array
2019-12-01 07:54:07 -08:00
Jeff Regan
46af583a57 Update bugs.md 2019-12-01 07:48:10 -08:00
Jeff Regan
f33069fc15 Update bugs.md 2019-12-01 07:24:56 -08:00
lalyos
cf5d3e73c0 fix quotation issues by using a bash array
see: http://mywiki.wooledge.org/BashFAQ/050
2019-11-30 21:51:32 +01:00
Jeff Regan
4f8eaacc9b Update kustomizer_test.go 2019-11-30 11:49:40 -08:00
Jeff Regan
47d6d498d6 Merge pull request #1874 from monopole/oopsMoreTest
More tests/examples.
2019-11-30 11:34:40 -08:00
jregan
1f85ce454d More tests/examples. 2019-11-30 11:32:08 -08:00
Jeff Regan
fc8c45cff5 Merge pull request #1872 from monopole/printPluginEnvPlugin
Add PrintPluginEnv plugin.
2019-11-30 10:29:37 -08:00
jregan
d98af3f06a Add PrintPluginEnv plugin. 2019-11-30 09:58:11 -08:00
Jeff Regan
d942e6fa59 Merge pull request #1871 from monopole/moar2
Move remaining examples.
2019-11-30 08:28:53 -08:00
jregan
fdd2cc5004 Move another test. 2019-11-30 07:31:38 -08:00
Jeff Regan
59b1c81e7e Merge pull request #1870 from monopole/moar
Move more examples up.
2019-11-30 06:58:35 -08:00
jregan
ae0658869a Move more examples up. 2019-11-30 06:57:57 -08:00
Kubernetes Prow Robot
5491202d69 Merge pull request #1869 from Dingshujie/mv_test_example_to_krusty
mv /api/internal/target example to /api/krusty
2019-11-30 06:19:02 -08:00
Dingshujie
c3716ff3e0 mv diamonds to api/krusty/, Provide another high level example. 2019-11-30 17:35:09 +08:00
Dingshujie
8e7c53b9e7 mv extendedpatch_test, inlinepatch_test to api/krusty/, Provide another high level example. 2019-11-30 17:35:08 +08:00
Dingshujie
cbfe314778 mv generatormergeandreplace_test, generatoroptions_test to api/krusty/, Provide another high level example. 2019-11-30 17:35:08 +08:00
Dingshujie
2d39d64d3a mv mutiplepath_test, nullvalues_test to api/krusty/, Provide another high level example. 2019-11-30 17:35:08 +08:00
Dingshujie
cd84b65972 mv pruneconfigmap_test to api/krusty/, Provide another high level example. 2019-11-30 17:35:08 +08:00
Dingshujie
fd7574cd61 mv variableref_test to api/krusty/, Provide another high level example. 2019-11-30 17:35:08 +08:00
Dingshujie
d28ef820ea mv resourceconflict_test to api/krusty/, Provide another high level example. 2019-11-30 14:50:36 +08:00
Dingshujie
e5c314a3ea mv namespace_test to api/krusty/, Provide another high level example. 2019-11-30 14:25:02 +08:00
Dingshujie
189f65dab9 mv crd_test to api/krusty/, Provide another high level example. 2019-11-30 09:41:56 +08:00
Dingshujie
9942a9278f mv configmaps_test to api/krusty/, Provide another high level example. 2019-11-30 09:34:01 +08:00
Jeff Regan
44db041682 Merge pull request #1867 from monopole/moarTests
More tests.
2019-11-29 08:53:10 -08:00
jregan
a49a764705 More tests. 2019-11-29 08:31:51 -08:00
Jeff Regan
680a0812c6 Merge pull request #1866 from monopole/anotherTestMove
Move another test up.
2019-11-29 08:02:03 -08:00
jregan
50c63d0021 Move another test up. 2019-11-29 08:00:03 -08:00
Jeff Regan
37e167e8d1 Merge pull request #1865 from monopole/simplifyPluginTestHarness
Simplify and document plugin test harness.
2019-11-29 07:55:27 -08:00
jregan
038c070626 Simplify and document plugin test harness. 2019-11-29 07:30:42 -08:00
Jeff Regan
8bb8637213 Update replicas.md 2019-11-29 07:00:23 -08:00
Jeff Regan
7ae21cb933 Merge pull request #1864 from Dingshujie/master
mv basereusenameprefix_test to api/krusty/
2019-11-29 06:55:42 -08:00
Jeff Regan
8fb64ffb0c Merge pull request #1863 from lundbird/patch-1
Add example for replicas in kustomization.yaml
2019-11-29 05:07:51 -08:00
Jeff Regan
f5a7227e26 Merge pull request #1859 from utilitywarehouse/master
Fallback to full clone if git fetch fails
2019-11-29 05:05:30 -08:00
Dingshujie
8a2b3cd1d9 mv basereusenameprefix_test to api/krusty/, Provide another high level example. 2019-11-29 20:42:56 +08:00
john
61133f3e2e remove flag logic 2019-11-29 08:58:14 +00:00
john
bf339173c8 unify git cloner behaviour 2019-11-29 08:58:04 +00:00
Jonathan Wong
e46108ada0 Add in struct for mounted storage options 2019-11-28 15:43:17 -08:00
Alex Lundberg
9e16c8ca50 Add example for replicas in kustomization.yaml 2019-11-28 18:38:05 -05:00
Jeff Regan
763cb4e925 Merge pull request #1861 from monopole/anotherExampleMoved
Provide another high level example.
2019-11-28 08:47:43 -08:00
jregan
f0153997e1 Provide another high level example. 2019-11-28 08:18:12 -08:00
Jeff Regan
6d141f2ad0 Merge pull request #1860 from monopole/improveExampleVisibility
Start making examples more visible.
2019-11-28 08:17:07 -08:00
jregan
89e7b76d48 Start making examples more visible. 2019-11-28 07:23:37 -08:00
John
b7855dc959 Merge pull request #1 from utilitywarehouse/deep-git-clone-flag
add --deep_git_clone flag
2019-11-28 12:06:15 +00:00
john
6485a7cf3e add --deep_git_clone flag 2019-11-28 11:54:03 +00:00
Kubernetes Prow Robot
fc92f4acd0 Merge pull request #1856 from pwittrock/workspace
cmd/config: update naming of commands
2019-11-27 13:03:04 -08:00
Phillip Wittrock
52a5e6ec99 rename run-fns to run 2019-11-27 12:40:10 -08:00
Jeff Regan
752ddd087b Merge pull request #1845 from haiyanmeng/work
Make the crawler work
2019-11-27 12:07:23 -08:00
Jeff Regan
2b22bfc16b Merge pull request #1855 from monopole/makeWalkWork
Make filesys.Walk work.
2019-11-27 12:05:59 -08:00
Phillip Wittrock
7ce1f7e95a Update cmd/config docs from using yaml to using kustomize config 2019-11-27 11:59:45 -08:00
Jeffrey Regan
c722d4cd17 Make filesys walk work. 2019-11-27 11:33:10 -08:00
Kubernetes Prow Robot
1a9d62617e Merge pull request #1850 from pwittrock/workspace
cmd/config: Add examples and tutorials for config functions
2019-11-26 20:27:20 -08:00
Phillip Wittrock
dc66de6bf3 cmd/config: Add examples and tutorials for config functions
- Add examples under `functions`
- Add built-in tutorial for functions
2019-11-26 20:08:23 -08:00
Jeff Regan
cb64e19da3 Merge pull request #1849 from monopole/moarRefactor
More tests, better errors.
2019-11-26 19:46:24 -08:00
Haiyan Meng
9bba761a14 Add config for creating an ElasticSearch Cluster 2019-11-26 19:38:17 -08:00
jregan
f3e735153f More tests, better errors. 2019-11-26 19:29:06 -08:00
Haiyan Meng
31c5e89b1f Add String method to KustomizationDocument to avoid printing the
content of kustomization.yaml
2019-11-26 14:49:44 -08:00
Kubernetes Prow Robot
a2b84fce86 Merge pull request #1818 from mortent/WaitStatus
Add APIs for computing status based on fetching resource info from a cluster
2019-11-26 14:25:21 -08:00
Jonathan Wong
eccef3bb0d Add appropriate test for read only LocalVolume 2019-11-26 13:52:27 -08:00
Morten Torkildsen
a489f30183 Add APIs for computing status based on fetching resource info from a
cluster
2019-11-26 13:33:21 -08:00
Jonathan Wong
7eaaedf9f6 Make LocalVolume read only 2019-11-26 13:29:50 -08:00
Jeff Regan
d1b33e7468 Merge pull request #1847 from monopole/refactorForNewWalk
Refactor filesys to prep for new filesys.Walk
2019-11-26 12:31:24 -08:00
Jeffrey Regan
3b2988bda8 Refactor to prep for new filesys.Walk 2019-11-26 11:41:23 -08:00
Haiyan Meng
84b75afae4 Make the crawler work
1) add the crawler binary and fix the crawler library
2) remove the readiness probe in the search backend
3) add config for redis keystore
4) add github_api_secret.txt file with instructions
2019-11-26 09:50:51 -08:00
Kubernetes Prow Robot
73fb32c85a Merge pull request #1842 from pwittrock/workspace
cmd/config: add built-in tutorials
2019-11-26 07:51:11 -08:00
Phillip Wittrock
5876a8cce0 cmd/config: add built-in tutorials 2019-11-25 22:48:21 -08:00
Kubernetes Prow Robot
c9ee7f3787 Merge pull request #1840 from pwittrock/workspace
mdtogo: support for alternate license headers
2019-11-25 20:51:10 -08:00
Phillip Wittrock
23f9f819eb mdtogo: support for alternate license headers 2019-11-25 20:32:27 -08:00
Kubernetes Prow Robot
7fe518b0c6 Merge pull request #1837 from pwittrock/workspace
Publish `cmd/config` as Kustomize subcommand group
2019-11-25 13:26:09 -08:00
Phillip Wittrock
7baabf7a97 cmd/config: mark config command group as [Alpha] 2019-11-25 10:33:31 -08:00
Phillip Wittrock
4a65ea8056 Publish cmd/config as a Kustomize sub-command 2019-11-25 10:25:02 -08:00
Phillip Wittrock
598854440a cmd/config: expose target for embedding config commands 2019-11-25 10:20:34 -08:00
Jeff Regan
9f2163ae54 Merge pull request #1836 from monopole/unpinAllPlugins
Unpin all the plugins (non-builtins too).
2019-11-25 08:49:46 -08:00
Jeffrey Regan
ee8598dcbd Unpin all the plugins (non-builtins too). 2019-11-25 08:47:30 -08:00
Kubernetes Prow Robot
f8a25cc2b3 Merge pull request #1834 from bzub/fix_builtin_docs_fields_links
docs: Fix images and name{Prefix,Suffix} field links.
2019-11-25 08:17:26 -08:00
bzub
80dc481f9c Fix images + name{Prefix,Suffix} field links. 2019-11-23 14:29:06 -06:00
Jeff Regan
be4d6f77b2 Merge pull request #1832 from monopole/fixNits
Fix nit leftover from 1820
2019-11-22 16:21:58 -08:00
jregan
2a35bbffe4 Fix nit leftover from 1820 2019-11-22 16:02:59 -08:00
Jeff Regan
59a70525fa Merge pull request #1720 from oke-py/apps/v1
migrate Deployment from apps/v1beta2 to apps/v1
2019-11-22 15:55:35 -08:00
Jeff Regan
ee4f404ae8 Merge pull request #1820 from haiyanmeng/image
Skip updating empty containers in image tranformer
2019-11-22 15:53:28 -08:00
Haiyan Meng
752ca4b37c Skip updating empty containers in image tranformer 2019-11-22 14:18:59 -08:00
Haiyan Meng
964a5082b1 Add a unit test to demonstrate the issue 1747 2019-11-22 14:18:55 -08:00
Kubernetes Prow Robot
81d809f15d Merge pull request #1830 from pwittrock/docs-4
Add api documentation for annotations and fns
2019-11-22 14:18:42 -08:00
Jeff Regan
5f80480068 Merge pull request #1831 from monopole/unpinBuiltins
Unpin the builtin plugins.
2019-11-22 14:13:11 -08:00
Jeffrey Regan
416e1fcc1a Unpin the builtin plugins. 2019-11-22 14:08:24 -08:00
Phillip Wittrock
bf8af8efba kyaml: New documentation for annotations and fns (apis) 2019-11-22 13:10:39 -08:00
Kubernetes Prow Robot
980209e87c Merge pull request #1829 from pwittrock/docs-3
kyaml: refactor command documentation into .md files from go files
2019-11-22 13:02:42 -08:00
Phillip Wittrock
3345464b25 kyaml: refactor command documentation into .md files from go files
No new documentation added.
2019-11-22 12:22:25 -08:00
Phillip Wittrock
2a5f513bc3 Merge pull request #1828 from pwittrock/makefile
kyaml: fixup Makefile
2019-11-22 12:11:50 -08:00
Phillip Wittrock
f531ac065d kyaml: fixup Makefile
- Change name of generated binary to `config` to match module name
- Use GOBIN instead of GOPATH to simplify commands
- Export GOBIN environment variable to the `go generate` command so it can find built commands
2019-11-22 11:53:14 -08:00
Phillip Wittrock
b240092058 Merge pull request #1827 from pwittrock/makefile
Add utility for generating cobra documentation from .md files
2019-11-22 11:48:13 -08:00
Phillip Wittrock
f0ca8f9c1a Add utility for generating cobra documentation from .md files 2019-11-22 11:47:35 -08:00
Kubernetes Prow Robot
5d4e45c24d Merge pull request #1824 from ibidani/fix-docs-links
Fix docs broken files links as Github relative links
2019-11-22 08:07:28 -08:00
Idan Bidani
04516803f2 Fix docs broken links as Github relative links 2019-11-21 23:52:53 -05:00
Jeff Regan
56d57c3088 Merge pull request #1823 from kubernetes-sigs/revert-1631-replacement-poc
Revert "Replacement poc"
2019-11-21 18:32:46 -08:00
Jeff Regan
b6d760dc6f Update eschewedFeatures.md 2019-11-21 17:00:09 -08:00
Jeff Regan
c856f800d0 Revert "Replacement poc" 2019-11-21 16:39:57 -08:00
Jeff Regan
b86bea9749 Merge pull request #1631 from Liujingfang1/replacement-poc
Replacement poc
2019-11-21 15:11:37 -08:00
Kubernetes Prow Robot
675faaced2 Merge pull request #1821 from monopole/improveGenRules
Improve code generation rules.
2019-11-21 14:49:29 -08:00
Jeffrey Regan
248d0d57d6 Improve builtin generation rules. 2019-11-21 12:42:45 -08:00
Jonathan Wong
a7cff1c75b Add local volume support to container filters 2019-11-21 12:16:09 -08:00
Jeff Regan
96c2873cc0 Merge pull request #1814 from haiyanmeng/dockerfile
Fix dir paths in crawler backend Dockerfile
2019-11-21 12:05:02 -08:00
Jonathan Wong
ff60138efd Merge branch 'master' of https://github.com/kubernetes-sigs/kustomize 2019-11-21 11:55:24 -08:00
Kubernetes Prow Robot
672153f021 Merge pull request #1815 from joncwong/rename-kyaml
Rename cmd/kyaml to cmd/config
2019-11-21 10:01:29 -08:00
Kubernetes Prow Robot
d81913de42 Merge pull request #1819 from annp1987/fix_typo
fix typo
2019-11-21 09:59:28 -08:00
Nguyen Phuong An
3ec583a3df fix typo
Signed-off-by: Nguyen Phuong An <AnNP@vn.fujitsu.com>
2019-11-21 09:26:32 +07:00
Jonathan Wong
14d4059f46 Rename cmd/kyaml to cmd/config in travis scripts 2019-11-19 18:42:18 -08:00
Jonathan Wong
99701a1932 Rename directory cmd/kyaml to cmd/config 2019-11-19 18:41:35 -08:00
Jonathan Wong
d8e5891498 Rename cmd/kyaml to cmd/config 2019-11-18 15:09:38 -08:00
Haiyan Meng
53b5e0f602 Fix dir paths in crawler backend Dockerfile 2019-11-18 13:35:16 -08:00
Jeff Regan
e5382c59a2 Merge pull request #1813 from monopole/testElaboratingCustomConfig
Add test elaborating on custom config.
2019-11-18 09:47:55 -08:00
Jeffrey Regan
bf119bf5b7 Add test elaborating on custom config. 2019-11-18 09:24:12 -08:00
Jeff Regan
277f565f2e Update genargs.go 2019-11-18 09:23:06 -08:00
Jeff Regan
8019cb0405 Merge pull request #1812 from monopole/activateLintTypecheck
Activate lint typecheck
2019-11-18 08:20:11 -08:00
Jeffrey Regan
362454413a Activate lint typecheck 2019-11-18 07:46:43 -08:00
Jeff Regan
562aaadf2c Merge pull request #1810 from justinsb/typo_suing
Fix typo: suing -> using
2019-11-18 06:49:07 -08:00
Jeff Regan
c868f01f82 Merge pull request #1811 from monopole/activateLintUnused
Activate lint for unused code.
2019-11-18 06:45:53 -08:00
Jeffrey Regan
83db25d6c4 Activate lint for unused code. 2019-11-18 06:41:01 -08:00
Jonathan Wong
e6306f60f4 Add docs command boilerplate 2019-11-17 19:51:19 -08:00
Justin SB
dd3ff341e0 Fix typo: suing -> using 2019-11-17 14:08:09 -08:00
Jeff Regan
5381daf95a Merge pull request #1792 from rcmorano/feature/add-chartRelease-and-chartVersion-support
Add support to choose 'chartRelease' and 'chartVersion' while kustomizing remote helm charts
2019-11-16 08:35:37 -08:00
Jeff Regan
fd588879e8 Merge pull request #1808 from monopole/fixMakeTabs
Fix makefile tabs (sigh).
2019-11-16 08:13:54 -08:00
Jeff Regan
03dfb03a16 Merge pull request #1807 from monopole/activateLintStaticCheck
Activate lint staticcheck.
2019-11-16 07:22:31 -08:00
jregan
927d0d0c63 Fix makefile tabs (sigh). 2019-11-16 07:16:20 -08:00
jregan
0924269e76 Activate lint staticcheck. 2019-11-16 07:04:53 -08:00
Jeff Regan
2326362fd2 Merge pull request #1805 from monopole/lintGosimple
Activate lint gosimple.
2019-11-16 06:37:52 -08:00
jregan
3da0afdda0 Activate lint gosimple. 2019-11-16 06:09:54 -08:00
Kubernetes Prow Robot
85d34531a2 Merge pull request #1795 from mortent/status
Library for computing status for Kubernetes resources
2019-11-15 17:05:41 -08:00
Kubernetes Prow Robot
4db30d16a6 Merge pull request #1804 from hypnoglow/linters
kyaml: enable errcheck & golint; fix gofmt
2019-11-15 12:40:32 -08:00
Morten Torkildsen
a49507c79e Library for computing status for Kubernetes resources 2019-11-15 10:26:47 -08:00
Igor Zibarev
7f1e93c6f5 kyaml: enable errcheck & golint; fix gofmt 2019-11-15 21:14:41 +03:00
Jeff Regan
7b71263583 Merge pull request #1801 from monopole/raiseLinterBar
Raise the golinter bar.
2019-11-14 18:40:30 -08:00
Jeffrey Regan
75b8103215 Raise the golinter bar. 2019-11-14 16:37:49 -08:00
Jeff Regan
2fa944b1cd Merge pull request #1800 from haiyanmeng/move-crawler
Move crawler from hack under api/internal
2019-11-14 15:16:40 -08:00
Haiyan Meng
aa09e3f3f9 Run go mod tidy 2019-11-14 13:57:29 -08:00
Haiyan Meng
8aaac77397 Update the module path in go.mod 2019-11-14 13:56:20 -08:00
Haiyan Meng
9255c991f4 Replace the sigs.k8s.io/kustomize/hack/crawl/* import path with
`sigs.k8s.io/kustomize/api/internal/crawl/*`
2019-11-14 13:38:18 -08:00
Haiyan Meng
d08140d3f7 Remove api/internal/hack/crawl/crawler/git dir, use api/internal/git
instead.
2019-11-14 13:35:00 -08:00
Haiyan Meng
f69d2d2e69 Move hack/crawl under api/internal 2019-11-14 13:17:28 -08:00
Jeff Regan
d0b874a643 Update Makefile 2019-11-14 13:08:05 -08:00
Jeff Regan
b52c6a77f4 Merge pull request #1784 from joncwong/patch-2
Fix broken redirect for contributor cheatsheet
2019-11-14 13:05:57 -08:00
Jeff Regan
0a84a0d525 Merge pull request #1793 from haiyanmeng/fix-git
Fix two broken deps to allow tests under hack/crawl to pass
2019-11-14 13:04:21 -08:00
Kubernetes Prow Robot
12a26e1cbc Merge pull request #1786 from joncwong/patch-3
Add tree to necessary tools
2019-11-14 13:03:36 -08:00
Jeff Regan
1a7cb3137e Merge pull request #1798 from jeanfabrice/master
fix typo in pseudo/README.md
2019-11-14 12:48:17 -08:00
Kubernetes Prow Robot
2605c124cc Merge pull request #1797 from oke-py/whitespace-path
quote PATH to run `make` successfully even if PATH includes whitespace
2019-11-14 12:41:36 -08:00
Kubernetes Prow Robot
95f4d9d2bb Merge pull request #1785 from hypnoglow/container-filter-network
kyaml: add Network to ContainerFilter
2019-11-14 12:39:35 -08:00
Kubernetes Prow Robot
7164f840aa Merge pull request #1787 from hypnoglow/fix-scopelint
kyaml: fix scopelint issues
2019-11-14 12:35:36 -08:00
Jeff Regan
c0d1bde30c Update macDevGuide.md 2019-11-14 11:59:09 -08:00
Phillip Wittrock
75a761112c Merge branch 'master' into container-filter-network 2019-11-14 11:56:49 -08:00
Kubernetes Prow Robot
73f94c1981 Merge pull request #1799 from monopole/makeFTW
Drive kustomize repo verification entirely from Makefile
2019-11-14 11:53:35 -08:00
Jeffrey Regan
003b3eccc2 Drive kustomize repo verification from make. 2019-11-14 11:31:42 -08:00
Haiyan Meng
df25f3a93a Run go mod tidy to clean up go.sum 2019-11-14 10:16:58 -08:00
Haiyan Meng
4448bcf22c Update go.sum and go.mod by running go build|test 2019-11-14 10:16:58 -08:00
Haiyan Meng
5eef5f2777 Fix two broken deps to allow tests under hack/crawl to pass
1) copy api/internal/git to hack/crawl/crawler/: internal packages are
not allowed to be imported;
2) change the import path from api/pgmconfig to api/kconfig
2019-11-14 10:16:25 -08:00
jeanfabrice
52466ffe83 fix typo in pseudo/README.md 2019-11-14 15:00:35 +01:00
Naoki Oketani
4542e4a122 quote PATH to run make successfully even if PATH includes whitespace 2019-11-14 19:00:20 +09:00
jregan
875385609e Simplify precommit. 2019-11-13 21:19:30 -08:00
Kubernetes Prow Robot
24f3d7556f Merge pull request #1789 from pwittrock/run
Add kyaml command for invoking container filters
2019-11-13 11:31:21 -08:00
Roberto C. Morano
ffeae451ab added support for 'chartRelease' (stable|incubator) and 'chartVersion' (0.0.1) 2019-11-13 19:30:46 +01:00
Phillip Wittrock
c99278c67b Add kyaml command for invoking container filters 2019-11-13 07:33:28 -08:00
Jeff Regan
867b795158 Update README.md 2019-11-12 14:41:16 -08:00
Igor Zibarev
301e529a4a kyaml: fix scopelint issues 2019-11-12 23:42:02 +03:00
Jonathan Wong
563564a198 Add tree to necessary tools
I don't believe "tree" is under the branch of gnu tools, so it might be misleading to put it under "Install gnu tools." Should we leave it like this or change the title to "Install gnu/unix tools"
2019-11-12 12:37:40 -08:00
Igor Zibarev
bfa5c59dc6 kyaml: add Network to ContainerFilter 2019-11-12 23:28:55 +03:00
Jonathan Wong
f202ce34eb Fix broken redirect for contributor cheatsheet 2019-11-12 10:57:03 -08:00
Kubernetes Prow Robot
912a9c3baa Merge pull request #1783 from pwittrock/errors
Improve error handling in kyaml libraries
2019-11-12 10:48:54 -08:00
Phillip Wittrock
b473faccca Improve error handling in kyaml libraries 2019-11-12 08:53:55 -08:00
Jeff Regan
1bbd8b2c43 Merge pull request #1781 from monopole/pinToPluginatorV2
Pin api HEAD to pluginator v2.
2019-11-11 22:38:12 -08:00
Jeffrey Regan
1be5292eb6 Pin api to pluginator v2. 2019-11-11 22:03:39 -08:00
Naoki Oketani
a8ece4b5f7 migrate Deploymnet from apps/v1beta2 to apps/v1 2019-11-12 15:02:54 +09:00
Jeff Regan
a6a5976304 Merge pull request #1780 from monopole/pluginatorV2
Pluginator v2
2019-11-11 21:38:20 -08:00
Jeffrey Regan
c91e2283db Pluginator v2 2019-11-11 21:35:53 -08:00
Jeff Regan
2c9635967a Merge pull request #1779 from monopole/pinAllAtApiV020
Pin kustomize and the plugins to kust Api v0.2.0
2019-11-11 20:48:40 -08:00
Jeffrey Regan
2dd148af24 Pin kustomize and the plugins to kust Api v0.2.0 2019-11-11 19:47:28 -08:00
Jeff Regan
bae6418ca2 Merge pull request #1777 from monopole/pinKustomizeApiToPseudo
Pin kustomize API to pseudok8s v0.1.0
2019-11-11 18:17:35 -08:00
Jeffrey Regan
1db0248748 Pin kustomize API to pseudok8s v0.1.0 2019-11-11 17:45:19 -08:00
Jeff Regan
387afef19b Merge pull request #1776 from monopole/moarTweaksDarnPseudo
Tweaks to accomodate pseudo/k8s.
2019-11-11 17:11:31 -08:00
Jeffrey Regan
9e47e585d4 Tweaks to accomodate pseudo/k8s. 2019-11-11 17:09:17 -08:00
Jeff Regan
1f8696865f Merge pull request #1775 from monopole/addPseudoReleaseOption
Set up for pseudok8s release.
2019-11-11 15:38:59 -08:00
Jeff Regan
87b6a4d6bc Set up for pseudok8s release. 2019-11-11 15:37:53 -08:00
Kubernetes Prow Robot
5fe0b9e1b2 Merge pull request #1774 from kubernetes-sigs/pseudoK8sReleaseStuff
Set up for pseudok8s release.
2019-11-11 15:06:06 -08:00
Jeffrey Regan
9a25cb96b7 Set up for pseudok8s release. 2019-11-11 12:37:12 -08:00
Jeff Regan
0f81cf52e7 Update README.md 2019-11-11 11:10:01 -08:00
Jeff Regan
eb75c039e5 Merge pull request #1773 from monopole/pseudoMain
A pseudo main to make goreleaser happier.
2019-11-11 10:59:46 -08:00
jregan
0f0c6618a0 A pseudo main to make goreleaser happier. 2019-11-11 10:57:35 -08:00
Jingfang Liu
3e4354dfb8 add test with diamond shape 2019-11-11 09:06:51 -08:00
Jingfang Liu
06e10cc084 add replacement transformer 2019-11-11 09:03:17 -08:00
Jeff Regan
97f2f33460 Merge pull request #1769 from monopole/removeOpsysCommentFromGeneratedCode
Remove opsys comment from generated code
2019-11-11 08:47:38 -08:00
jregan
382981fb43 Remove opsys comment from generated code. 2019-11-11 08:32:35 -08:00
Jeff Regan
519dacc10f Merge pull request #1768 from monopole/makeRepoMoreRelocatable
Add a relative path option for finding plugin source.
2019-11-11 08:08:30 -08:00
jregan
02c0c2692f Make repo more relocatable on developer's workstation. 2019-11-11 08:03:58 -08:00
Jeff Regan
6df4efd145 Merge pull request #1766 from monopole/lessGopath
Simplify pre-submit.sh
2019-11-09 16:19:02 -08:00
jregan
4dab6268da Less GOPATH dependence. 2019-11-09 15:01:26 -08:00
Jeff Regan
4150026ec7 Merge pull request #1767 from monopole/updateGeneratedCodeAndGoSums
Update plugin go.sums
2019-11-09 14:43:46 -08:00
jregan
10cd82ce31 Update go.sums 2019-11-09 14:42:29 -08:00
Jeff Regan
d0ce4fcf15 Merge pull request #1765 from monopole/makaMaka
Move code generation to makefile.
2019-11-09 08:54:15 -08:00
Jeffrey Regan
d54ff23560 Move code generation to makefile. 2019-11-09 08:32:09 -08:00
Phillip Wittrock
8e4609a850 Merge pull request #1764 from pwittrock/cmd
Switch cmd/kyaml to pseudo/k8s
2019-11-08 17:51:24 -08:00
Phillip Wittrock
eabb476461 Switch cmd/kyaml to pseudo/k8s 2019-11-08 17:23:04 -08:00
Kubernetes Prow Robot
74255f6bad Merge pull request #1763 from pwittrock/deps-fresh1
Switch kustomize to depend on pseudo/k8s
2019-11-08 17:05:59 -08:00
Phillip Wittrock
3dfe62fe55 switch to pseudo/k8s deps 2019-11-08 16:48:42 -08:00
Phillip Wittrock
ad9b869ddb Use local kustomize api for pluginator and hack/crawl 2019-11-08 16:38:01 -08:00
Phillip Wittrock
5c4c19bf19 Script to update pseudo references 2019-11-08 16:38:01 -08:00
Jeff Regan
1f86a0ca5d Merge pull request #1749 from pwittrock/cmd
Create kyaml command to expose running kyaml filters on the cli
2019-11-08 13:24:13 -08:00
Kubernetes Prow Robot
db630a9d07 Merge pull request #1762 from pwittrock/deps-fresh1
Fetch pseudo modules
2019-11-08 13:21:25 -08:00
Jeff Regan
388dd13a5f Merge pull request #1753 from oke-py/gnu-sed
brew install gnu-sed
2019-11-08 12:53:02 -08:00
Phillip Wittrock
67c9d469c4 Enable pseudo dependency checking in travis 2019-11-08 12:52:00 -08:00
Jeff Regan
28a55bbd9c Merge pull request #1761 from monopole/rmScript
Remove hack/fork_k8s_and_fix_deps.sh to avoid confusion.
2019-11-08 12:50:54 -08:00
Jeffrey Regan
bdacb941ab Remove hack/fork_k8s_and_fix_deps.sh to avoid confusion. 2019-11-08 12:49:58 -08:00
Phillip Wittrock
d87ad523de Fix pseudo/README.md script name 2019-11-08 12:49:20 -08:00
Phillip Wittrock
ec36993d42 Run pseudo/init-pseudo-module.sh to fetch packages 2019-11-08 12:48:06 -08:00
Kubernetes Prow Robot
6b5aebac22 Merge pull request #1760 from pwittrock/deps-fresh1
pseudo: script for creating psuedo modules
2019-11-08 12:44:52 -08:00
Phillip Wittrock
883714e2e5 Scripts for adding psuedo modules
psuedo modules will contain modules copied from k8s where we cannot depend directly on the k8s modules
2019-11-08 12:25:13 -08:00
Phillip Wittrock
8b0f4bf714 kyaml: Add kyaml filters as cli commands 2019-11-08 09:26:02 -08:00
Kubernetes Prow Robot
e83b97ea1f Merge pull request #1748 from pwittrock/commands
kyaml: rename annotations and fix linting
2019-11-07 20:00:20 -08:00
Jeff Regan
48dfcf5a3e Merge pull request #1750 from monopole/invokePluginUnitTests
Invoke plugin unit tests in presubmit.
2019-11-07 17:29:15 -08:00
Jeff Regan
cb4498594b Merge pull request #1758 from monopole/scriptToForkAndFixDeps
Script to fork and fix k8s deps.
2019-11-07 17:28:33 -08:00
Jeffrey Regan
b0bd4b5410 Script to fork and fix k8s deps. 2019-11-07 17:20:15 -08:00
Jeffrey Regan
dbf8a0fde4 Invoke plugin unit tests in presubmit. 2019-11-07 15:54:20 -08:00
Phillip Wittrock
3db1111f8e kyaml: rename annotations and fix linting 2019-11-07 15:46:30 -08:00
Kubernetes Prow Robot
e482ffa3f9 Merge pull request #1755 from monopole/unpinThePlugins
Repin the plugins on head for release testing.
2019-11-07 15:44:19 -08:00
Jeffrey Regan
2b1749778f Unpin all the plugins, so we can test against head b4 release. 2019-11-07 15:28:04 -08:00
Naoki Oketani
6af51a1bfe brew install gnu-sed 2019-11-08 08:17:48 +09:00
Phillip Wittrock
e0b46acf2f Merge pull request #1746 from pwittrock/kyaml
Kyaml documentation improvements
2019-11-07 09:42:42 -08:00
Phillip Wittrock
2e33a69388 Update documentation for kyaml package 2019-11-07 09:16:27 -08:00
Phillip Wittrock
018698ec85 Update .gitignore to ignore Intellij metadata files 2019-11-07 08:02:52 -08:00
Phillip Wittrock
0029a8ce32 Update Makefile with licenseadder and golangci-lint 2019-11-07 07:57:37 -08:00
Jeff Regan
04d5494246 Merge pull request #1745 from monopole/likelyLastMove
Remove more k8sdeps from external API.
2019-11-06 21:00:57 -08:00
jregan
41a8bd208d Remove more k8sdeps from external API. 2019-11-06 20:43:26 -08:00
Kubernetes Prow Robot
6bb470dbd0 Merge pull request #1744 from monopole/removePluginsPackagesFromExternalApi
Remove remaining plugins packages from external API.
2019-11-06 19:48:43 -08:00
jregan
9fa0391ce9 Remove remaining plugins packages from external API. 2019-11-06 19:32:53 -08:00
Kubernetes Prow Robot
bda22d08cc Merge pull request #1743 from monopole/lowercaseBuiltins
Lowercase the generated filenames per Go style.
2019-11-06 19:30:43 -08:00
jregan
09faaa1b2c Lowercase the generated filenames per Go style. 2019-11-06 19:12:12 -08:00
Jeff Regan
9a65634df6 Merge pull request #1742 from monopole/moveBuiltinsToTop
Move the builtins to the top level as part of API
2019-11-06 18:50:49 -08:00
Jeffrey Regan
300383959d Remove plugins packages from external API. 2019-11-06 18:31:33 -08:00
Kubernetes Prow Robot
ab17d8dd74 Merge pull request #1741 from monopole/RemoveCMandSecretPackageFromApi
Remove CMSecret package from API.
2019-11-06 16:00:43 -08:00
Jeffrey Regan
c5ba2ced3b Remove CMSecret package from API. 2019-11-06 15:35:18 -08:00
Kubernetes Prow Robot
4103580834 Merge pull request #1740 from monopole/removeTargetFromExposedApi
Remove target package from exposed API.
2019-11-06 15:25:50 -08:00
Jeffrey Regan
d36e3f015d Remove target package from exposed API. 2019-11-06 15:10:11 -08:00
Jeff Regan
975e071394 Merge pull request #1739 from monopole/removeGitFromExposedApi
Remove git package from exposed API.
2019-11-06 13:16:08 -08:00
Jeffrey Regan
6542af600d Remove 'git' package from exposed API. 2019-11-06 13:08:47 -08:00
Kubernetes Prow Robot
9e6e928725 Merge pull request #1732 from monopole/moarMakefile
Migrate some presubmit functionality to Makefile.
2019-11-05 15:44:59 -08:00
Jeffrey Regan
ad24ba2234 Migrate some presubmit functionality to Makefile. 2019-11-05 12:37:08 -08:00
Jeff Regan
c7fd1dee8b Merge pull request #1716 from bzub/node_cm_namereference
Support node configmap namereference.
2019-11-04 14:38:22 -08:00
Jeff Regan
606eb8a74c Merge pull request #1731 from monopole/noKubevalOnTravis2
No kubeval dependent test on travis.
2019-11-04 14:37:27 -08:00
Jeffrey Regan
2340c98f6a No kubeval dependent test on travis. 2019-11-04 14:20:39 -08:00
Kubernetes Prow Robot
a7607c20e3 Merge pull request #1730 from monopole/noKubevalOnTravis
No kubeval dependent test on travis.
2019-11-04 14:08:12 -08:00
Phillip Wittrock
0b5cf74945 Merge pull request #1728 from pwittrock/kyaml
kyaml: initial support for yaml and resource manipulation
2019-11-04 14:04:01 -08:00
Jeffrey Regan
0687699d27 No kubeval dependent test on travis. 2019-11-04 13:01:37 -08:00
Kubernetes Prow Robot
357126fc4e Merge pull request #1729 from gliptak/patch-1
Correct typo
2019-11-04 12:56:12 -08:00
Gábor Lipták
0aeb53a2b3 Correct typo 2019-11-04 15:36:13 -05:00
Phillip Wittrock
efd7c8e3f7 kyaml: initial support for yaml and resource manipulation 2019-11-04 11:36:35 -08:00
bzub
152ee44b92 Support node configmap namereference. 2019-11-04 12:38:28 -06:00
Jeff Regan
588297f1f9 Update whatApi.sh 2019-11-04 09:50:43 -08:00
Jeff Regan
6b81ae9a93 Merge pull request #1726 from monopole/konfigPalooza
Improve config package names and reduce API exposure.
2019-11-04 09:24:28 -08:00
jregan
077c7b2d20 Improve config package names and reduce API exposure. 2019-11-03 16:39:44 -08:00
Jeff Regan
1a4330a7cb Merge pull request #1725 from monopole/tryThisOne
Improve plugin home defaulting.
2019-11-03 15:58:33 -08:00
jregan
d08690a6aa Improve plugin home defaulting. 2019-11-03 15:47:43 -08:00
Jeff Regan
ba925e833d Merge pull request #1724 from monopole/removeErrorFromConstructor
Improve error messaging around plugin loading problems.
2019-11-03 06:46:31 -08:00
jregan
4c15c42447 Remove error return from constructor. 2019-11-03 06:37:04 -08:00
Jeff Regan
690e01c2ba Update whatApi.sh 2019-11-02 14:12:15 -07:00
Jeff Regan
133d8bff5e Merge pull request #1723 from monopole/renaming
Improved plugin loading docs.
2019-11-02 13:56:55 -07:00
jregan
079c3307c1 Improved plugin loading docs. 2019-11-02 13:47:47 -07:00
Jeff Regan
e0070f7ec5 Merge pull request #1722 from monopole/moveLoadRestrictions
push flag code from api module to kustomize internal
2019-11-02 11:07:36 -07:00
Jeffrey Regan
a45eca7e22 move load restrictions 2019-11-02 10:34:33 -07:00
Jeff Regan
79c5f8a977 Merge pull request #1719 from monopole/mvPluginConfig
Move plugin config to main config package.
2019-11-01 16:32:42 -07:00
Jeffrey Regan
69d1699963 Move plugin config to main config package. 2019-11-01 16:31:00 -07:00
Jeff Regan
b6b8f4396f Merge pull request #1717 from liztio/patch-1
strategic-merge-patch documentation has moved
2019-11-01 16:11:32 -07:00
Liz
9ca5284e4f strategic-merge-patch documentation has moved 2019-10-31 14:31:19 -04:00
Kubernetes Prow Robot
335292fe8a Merge pull request #1714 from monopole/addTests
Add some kustomization tests.
2019-10-31 09:19:37 -07:00
Jeff Regan
cf9edbfb3c Merge pull request #1712 from pwittrock/mac-docs
Add Mac development guide
2019-10-30 16:36:17 -07:00
Jeffrey Regan
364a2342df Add some kustomization tests. 2019-10-30 16:20:23 -07:00
Phillip Wittrock
3301913178 Add Mac development guide 2019-10-30 09:11:25 -07:00
Jeff Regan
ac3c53557e Merge pull request #1709 from pwittrock/skip
Support for ignoring specific Resources via annotation.
2019-10-29 17:19:59 -07:00
Phillip Wittrock
8bf98dd255 Support for ignoring specific Resources via annotation.
Resources annotated with `config.kubernetes.io/local-config` will be ignored by Kustomize
2019-10-29 16:51:38 -07:00
Jeff Regan
f2368201d9 Merge pull request #1704 from monopole/whatApi
Script to report on api usage.
2019-10-28 14:41:07 -07:00
Jeffrey Regan
f44574cf43 Script to report on api usage. 2019-10-28 14:40:24 -07:00
Jeff Regan
3054d69dd9 Merge pull request #1702 from monopole/buryBuildCode
Reduce the size of the API used by the build command
2019-10-28 14:36:07 -07:00
Jeff Regan
739c2a5bac Merge pull request #1703 from monopole/timApple
Update travis.yaml for osx
2019-10-28 14:14:40 -07:00
Jeffrey Regan
a780bd6465 Update travis.yaml for osx 2019-10-28 13:51:24 -07:00
Jeffrey Regan
4716cb026f Simplify building api. 2019-10-28 13:36:14 -07:00
Jeff Regan
a186144a78 Reinstate simplified makefile
Partially undo
2ea4762d0f

The original makefile was annoying people who naturally expected it to work.
2019-10-28 13:35:49 -07:00
Jeff Regan
2ea4762d0f Delete makefile
This isn't maintained because it's not used by ./travis/pre-commit.sh or any other automated process.
It's just causing confusion.
2019-10-28 11:54:44 -07:00
Jeff Regan
eb268fa722 Merge pull request #1701 from monopole/replaceApiWithLocalApi
Point kustomize to local API for development.
2019-10-28 11:29:57 -07:00
Jeffrey Regan
3b3a1309e4 Point kustomize to local API for development. 2019-10-28 11:17:34 -07:00
Jeff Regan
72db6dde9e Merge pull request #1699 from monopole/makeKrusty
Make krusty package - high-level CLI-like package.
2019-10-27 08:28:33 -07:00
jregan
6d30bc5c35 Make krusty package - high-level CLI-like package. 2019-10-27 08:19:56 -07:00
Jeff Regan
773629e544 Merge pull request #1698 from monopole/mvHacksToHack
mv hacks dir to hack (match pattern in k/k repo).
2019-10-27 05:13:30 -07:00
jregan
cd50bf4e1e Move hacks to hack (match k8s pattern). 2019-10-27 05:05:23 -07:00
Jeff Regan
ff59e9b52f Merge pull request #1681 from rcmorano/feature/add-releaseName-and-releaseNamespace-support
Add support to render charts using '.Release.Name' and .Release.Namespace'
2019-10-25 10:33:59 -07:00
Jeff Regan
9a954d4f0b Merge pull request #1693 from monopole/fixSomeNits
Fix some nits.
2019-10-25 10:30:28 -07:00
jregan
5c63c20390 Fix some nits. 2019-10-25 10:29:48 -07:00
Kubernetes Prow Robot
a84f8d65db Merge pull request #1692 from monopole/movePluginsToApiV011
Pin the plugins to api/v0.1.1
2019-10-24 16:59:38 -07:00
Jeffrey Regan
6e2335ec3d Move plugins to api/v0.1.1 2019-10-24 16:32:12 -07:00
Jeff Regan
4cf6630fc0 Merge pull request #1671 from beautytiger/dev-191022-dup
delete duplicated entry in slice
2019-10-24 15:34:23 -07:00
Jeff Regan
d239d52217 Merge pull request #1690 from monopole/tuneUpCrawl
Tune up hack/crawl.
2019-10-24 13:29:59 -07:00
Jeffrey Regan
c260105212 Tune up hack/crawl. 2019-10-24 13:29:14 -07:00
Jeff Regan
44cdf98a47 Filter out pluginator in install curl script. 2019-10-24 12:40:06 -07:00
Kubernetes Prow Robot
92390eabe4 Merge pull request #1663 from chaosteil/pluginloadfail
Refactor exec plugin load to error if plugin isn't executable
2019-10-24 11:55:41 -07:00
Jeff Regan
7b8fa51ec5 More fixes to releasing instructions. 2019-10-24 11:50:34 -07:00
Jeff Regan
af8e17a1ed Fix curl command in INSTALL.md 2019-10-24 11:34:09 -07:00
Jeff Regan
e2eeb90639 Update INSTALL.md 2019-10-24 11:23:21 -07:00
Jeff Regan
1704977a4b Explain using go to install kustomize. 2019-10-24 11:08:21 -07:00
Kubernetes Prow Robot
7050c6a7b6 Merge pull request #1688 from monopole/moveKustBackToV3
Move kustomize back to v3
2019-10-24 10:45:13 -07:00
Jeffrey Regan
02f9b98b5a Move kustomize back to v3 2019-10-24 10:32:11 -07:00
Jeff Regan
ce7ebe3299 Make all releases draft by default 2019-10-23 17:03:01 -07:00
Roberto C. Morano
3928ada0e5 Add support to inflate charts including '.Release.Name' and .Release.Namespace' references in templates 2019-10-23 10:15:54 +02:00
Jeff Regan
0a8faced8f Merge pull request #1679 from monopole/updateCloudbuildAgain
Improve the release process instructions
2019-10-22 16:16:36 -07:00
Jeff Regan
3c06debf98 Merge pull request #1678 from monopole/fixCliInternalDeps
Fix internal kustomize CLI deps
2019-10-22 16:14:39 -07:00
Jeff Regan
fcee91eafd Merge pull request #1678 from monopole/fixCliInternalDeps
Fix internal kustomize CLI deps
2019-10-22 15:37:37 -07:00
Jeffrey Regan
b0b3a705f4 Fix internal kustomize CLI deps 2019-10-22 15:27:57 -07:00
Jeff Regan
67c8fbcc3c Merge pull request #1676 from monopole/useLatestCloudbuilderSigh
Use latest cloudbuilder image.
2019-10-22 12:50:33 -07:00
Jeffrey Regan
9b50b78ec8 Use latest cloudbuilder image. 2019-10-22 12:49:38 -07:00
Jeff Regan
943a1b0195 Merge pull request #1675 from monopole/pinKustomizeToApiV011
Pin kustomize CLI to API v0.1.1
2019-10-22 12:40:12 -07:00
Jeffrey Regan
f77143cd34 Pin kustomize CLI to API v0.1.1 2019-10-22 12:32:05 -07:00
Jeff Regan
b7d2ba2376 Merge pull request #1674 from monopole/dealWithDeprecationsInGoReleaser
Deal with goreleaser field deprecations.
2019-10-22 12:12:34 -07:00
Jeffrey Regan
c28a0eb83d Deal with goreleaser field deprecations. 2019-10-22 12:11:13 -07:00
Jeff Regan
f7e5b5138b Merge pull request #1673 from monopole/moreTweaks
Add tag check to release script
2019-10-22 11:52:55 -07:00
Jeffrey Regan
61149cbf21 Add tag check to release script 2019-10-22 11:51:26 -07:00
Jeff Regan
310d516030 Update README.md 2019-10-22 10:16:51 -07:00
Jeff Regan
a9e3fe155b Merge pull request #1672 from monopole/moreReleasingTweaks
Pin the cloudbuild step container tags.
2019-10-22 10:13:32 -07:00
Jeffrey Regan
24837bad40 More releasing tweaks. 2019-10-22 10:10:47 -07:00
Guangming Wang
9686cc9861 delete duplicated entry in slice 2019-10-22 21:45:55 +08:00
Dominykas Djacenko
a4784ee5ec Refactor exec plugin load to error if plugin isn't executable 2019-10-21 19:49:27 -07:00
Jeff Regan
3063560e77 Merge pull request #1670 from monopole/installKubevalNotes
Add kubeval install notes.
2019-10-21 19:34:41 -07:00
jregan
bff0604bee Add kubeval install notes. 2019-10-21 19:33:45 -07:00
Jeff Regan
9f8faa7d7e Merge pull request #1669 from monopole/cloudBuildTake9834
Cloud build adjustments.
2019-10-21 19:03:03 -07:00
jregan
335077eade Cloud build adjustments. 2019-10-21 19:00:52 -07:00
Jeff Regan
491baa74cb Merge pull request #1668 from monopole/tweakReleaseProcess
Experimenting with cloud build and goreleaser
2019-10-21 17:33:52 -07:00
Jeff Regan
2f2d078669 Update README.md 2019-10-21 17:31:40 -07:00
Jeff Regan
b7bcb90057 Update README.md 2019-10-21 16:43:35 -07:00
Jeff Regan
35dc15b16b Merge pull request #1667 from monopole/setupApiRelease
Define the API release process.
2019-10-21 16:37:41 -07:00
Jeffrey Regan
83f70877c8 Define the API release process. 2019-10-21 16:24:16 -07:00
Jeff Regan
98cd31b820 Merge pull request #1666 from monopole/modulesForAll
Each plugin gets its own module.
2019-10-21 16:16:25 -07:00
Jeffrey Regan
5416ae7365 Introduce API module. 2019-10-21 15:21:04 -07:00
Kubernetes Prow Robot
644f2ddcdc Merge pull request #1665 from monopole/introduceApiModule
Introduce API module.
2019-10-21 15:13:22 -07:00
Jeffrey Regan
46524d3b6a Introduce API module. 2019-10-21 13:30:31 -07:00
Jeff Regan
4f014d0262 Merge pull request #1664 from monopole/moveGeneratedCode
Move generated code
2019-10-21 13:21:19 -07:00
Jeffrey Regan
0cf2057fc5 Install generated plugin code into the API module. 2019-10-21 11:15:51 -07:00
Jeffrey Regan
3f08e1546c Move generated plugin code. 2019-10-21 09:48:11 -07:00
Jeff Regan
10619fb0f7 Merge pull request #1662 from monopole/builtinNestingPlace
Make new nesting place for generated builtin code.
2019-10-20 17:53:02 -07:00
jregan
c88e8cc057 Make new nesting place for generated builtin code. 2019-10-20 17:41:09 -07:00
Jeff Regan
327a3f5300 Merge pull request #1661 from monopole/moveK8sdeps
Move ks8deps to api for now.
2019-10-20 16:51:47 -07:00
jregan
fddde81f9c Move ks8deps to api for now. 2019-10-20 16:49:53 -07:00
Jeff Regan
22d07ed37d Merge pull request #1660 from monopole/drainTopInternal
Drain top internal folder
2019-10-20 16:14:08 -07:00
jregan
dee1c425da Drain the top level internal. 2019-10-20 15:51:04 -07:00
jregan
951d15bf17 Make api/plugins 2019-10-20 15:12:13 -07:00
Jeff Regan
0f82d2932c Merge pull request #1658 from monopole/makeInventoryPublic
Make inventory public.
2019-10-20 11:46:09 -07:00
jregan
e2d7a06e9f Make inventory public. 2019-10-20 11:43:36 -07:00
Jeff Regan
286b9c1aed Merge pull request #1657 from monopole/makeGitPrivate
Make git package private
2019-10-20 11:43:25 -07:00
jregan
f54d4a5837 Make git package private 2019-10-20 11:36:10 -07:00
Jeff Regan
d9031fb2c9 Merge pull request #1656 from monopole/makeResourcePublic
Make resource, resmap and ifc public.
2019-10-20 11:14:22 -07:00
jregan
3af5a8afea Make resource, resmap public. 2019-10-20 10:51:20 -07:00
Jeff Regan
e2fd33c54a Merge pull request #1655 from monopole/drainPkgTransformers
Drain pkg transformers
2019-10-20 09:50:59 -07:00
jregan
c90e0a4080 Drain pkg/transformers. 2019-10-20 09:19:07 -07:00
jregan
5de000ee3d Move FieldSpec to API. 2019-10-20 06:52:13 -07:00
Jeff Regan
c28b82510c Merge pull request #1654 from monopole/makeSmpPrivate
Make SMP code private to CLI.
2019-10-18 17:16:10 -07:00
jregan
fda3ba8af9 Make SMP code private to CLI. 2019-10-18 17:14:43 -07:00
Kubernetes Prow Robot
fd1356e5d8 Merge pull request #1653 from monopole/docsUpdate
Update docs
2019-10-18 13:13:37 -07:00
jregan
a62f1364fe Update docs 2019-10-18 12:46:36 -07:00
Jeff Regan
d1240bcc63 Update INSTALL.md 2019-10-18 10:48:54 -07:00
Jeff Regan
1c24fe7d16 Merge pull request #1651 from monopole/startApi
Start api directory, which will become the api module.
2019-10-17 15:03:57 -07:00
Jeffrey Regan
e5c8b5ec8f Start api directory, which will become a module. 2019-10-17 14:01:20 -07:00
Jeff Regan
180429774a Merge pull request #1649 from monopole/fixNits
fixNits
2019-10-17 11:16:46 -07:00
Jeffrey Regan
586bba0b31 fixNits 2019-10-17 11:15:10 -07:00
Jeff Regan
2ce138ab3a Update awker.sh 2019-10-16 20:40:21 -07:00
Jeff Regan
5e99ad000e Merge pull request #1645 from monopole/docTypes
Document the types package.
2019-10-16 17:25:05 -07:00
jregan
0f0e740c21 Document the types package. 2019-10-16 17:24:21 -07:00
Kubernetes Prow Robot
33600189bc Merge pull request #1644 from monopole/makeTypesPublic
Make types package public.
2019-10-16 16:58:38 -07:00
jregan
07d2500ee3 Make types package public. 2019-10-16 16:41:43 -07:00
Jeff Regan
de6eb14867 Merge pull request #1643 from monopole/cleanupTypes
Cleanup types package before going public.
2019-10-16 16:24:40 -07:00
jregan
85b71a31e3 Cleanup types package before going public. 2019-10-16 16:02:01 -07:00
Jeff Regan
16e7638220 Merge pull request #1642 from monopole/makeHasherPublic
Maker hasher public for now.
2019-10-16 14:21:44 -07:00
jregan
04c23b2085 Maker hasher public for now. 2019-10-16 12:25:09 -07:00
Kubernetes Prow Robot
24db94dd0d Merge pull request #1638 from dbachrach/f-edit-set-replicas
Add support for kustomize edit set replicas
2019-10-15 19:44:07 -07:00
Kubernetes Prow Robot
5f862ba17c Merge pull request #1639 from dbachrach/b-zero-replica-formatting
Fix yaml formatting of replicas count when count is 0
2019-10-15 17:00:13 -07:00
Jeff Regan
18ba3ee91b Merge pull request #1640 from monopole/moveKvStuff
Extract kv loader from file loader, and place in public package.
2019-10-15 16:59:21 -07:00
Jeffrey Regan
4e9d42fae7 Move kv loader code to public package. 2019-10-15 16:52:03 -07:00
Dustin Bachrach
52e57dab7f FIx yaml formatting of replicas count when count is 0
Previously, a count of 0 would cause the count field to be omitted from the yaml
2019-10-15 15:47:53 -07:00
Dustin Bachrach
ba464a5e11 Add support for kustomize edit set replicas
New command line tool for editing replica counts for resources.
Example:
  kustomize edit set replicas app=3 other-app=1
2019-10-15 15:43:10 -07:00
Jeff Regan
2734085fb0 Merge pull request #1634 from tkellen/gh-1600-failing
make failing test showing spurious variable conflicts
2019-10-15 14:24:28 -07:00
Tyler
d21ff7cfe6 make test pass with reference to bug 2019-10-15 16:59:32 -04:00
Jeff Regan
3a15f450a9 Merge pull request #1637 from monopole/renameDataSources
Rename DataSources to KvPairSources and remove deprecated env field.
2019-10-15 13:47:44 -07:00
Jeffrey Regan
bb77e7491a Rename DataSources to KvPairSources and remove deprecated env field. 2019-10-15 13:39:42 -07:00
Tyler
aa82240b4c use namespace value when making Var 2019-10-15 14:47:05 -04:00
Kubernetes Prow Robot
cac7b46ebd Merge pull request #1635 from beautytiger/dev-191015-trimfix
fix string trim in normalizeGitHostSpec func
2019-10-15 09:27:53 -07:00
Guangming Wang
367d0e042c fix string trim in normalizeGitHostSpec func
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-10-16 00:06:02 +08:00
Tyler
d851305c33 make failing test showing spurious variable conflicts 2019-10-15 00:33:33 -04:00
Jeff Regan
0c52bd71ba Merge pull request #1633 from monopole/startPlugLib
Start pluglib, a set of public, plugin specific functions.
2019-10-14 20:25:15 -07:00
Jeffrey Regan
41a008e9a3 Start pluglib, a set of public, plugin specific functions. 2019-10-14 19:43:55 -07:00
Jeff Regan
2fadb4dd59 Merge pull request #1630 from monopole/moveFilesysUp
Move filesys package up to make public.
2019-10-14 12:50:15 -07:00
Jeffrey Regan
a88ee3f93c Move filesys package up to make public. 2019-10-14 12:40:09 -07:00
Jeff Regan
237848a80b Merge pull request #1629 from monopole/renamePackageFsToFileSys
Rename fs package to filesys
2019-10-14 11:01:43 -07:00
Jeffrey Regan
9e3b837093 Rename fs package to filesys 2019-10-14 10:50:27 -07:00
Jeff Regan
c4eca908ac Merge pull request #1623 from monopole/removeVersionCheckFromMinecraft
Remove minecraft version check from chart plugin tests.
2019-10-12 13:03:22 -07:00
jregan
72d9b4cbca Remove minecraft version check from chart plugin tests. 2019-10-12 12:52:36 -07:00
Jeff Regan
19d94110b1 Merge pull request #1621 from scottnuma/patch-1
Update broken URL in Exec Plugin Tutorial
2019-10-12 10:10:41 -07:00
Jeff Regan
1756765dbc Merge pull request #1622 from monopole/fixNits
Fix some nits
2019-10-12 07:43:03 -07:00
jregan
b306f8511c Fix some nits 2019-10-12 07:42:04 -07:00
Scott Numamoto
9778f867b5 Update broken URL in Exec Plugin Tutorial
- link created in the scripts of Exec plugin on linux in 60 seconds to download the kustomize executable does not work
- used the [releases page](https://github.com/kubernetes-sigs/kustomize/releases/tag/v3.0.0) to fix
2019-10-12 01:02:16 -07:00
Jeff Regan
a69ebf2b11 Merge pull request #1576 from chenrui333/go-1.13
Upgrade golang to v1.13
2019-10-11 11:04:23 -07:00
Jeff Regan
cf9c81f908 Merge pull request #1615 from monopole/moreCodeToDiscussIn1297
More composition testing
2019-10-11 11:01:02 -07:00
Jeffrey Regan
b95164b9a8 More code to discuss in 1297 2019-10-11 10:37:29 -07:00
Rui Chen
0551338958 Merge branch 'master' of github.com:kubernetes-sigs/kustomize into go-1.13
* 'master' of github.com:kubernetes-sigs/kustomize: (27 commits)
  Update complexcomposition_test.go
  doc: add configmap generator key example
  tweakNamesInTest
  cleanup on errors in git loader
  refactor complexcomposition_test in prep for addition
  Update INSTALL.md
  Update INSTALL.md
  Introduce dummy program to help with API releases.
  fix zh-doc
  v3.3.0 release notes
  Move pluginator to kustomize Go API v3.3.0
  Three builders.
  Update README.md
  update release process doc
  improve tests for alternative kustomization file names
  Reduce size of pgmconfig package
  Break the dep between fs and pgmconfig.
  Improve fs package and doc in prep to officially go public
  Update versioning notes.
  Fix: documentation link for plugins
  ...
2019-10-11 11:18:20 -04:00
Kubernetes Prow Robot
40b7ad23ea Merge pull request #1618 from seriousben/add-configmap-key-example
doc: add configmap generator key example
2019-10-10 15:19:21 -07:00
Kubernetes Prow Robot
ce66ceeed6 Merge pull request #1616 from jeffmhastings/cleanup-git-clone-errors
cleanup on errors in git loader
2019-10-10 15:17:21 -07:00
Jeff Regan
4e45af6265 Update complexcomposition_test.go 2019-10-10 13:16:45 -07:00
Benjamin Boudreau
07a9454215 doc: add configmap generator key example 2019-10-10 16:11:37 -04:00
Jeff Regan
9f5a936236 Merge pull request #1617 from monopole/tweakNamesInTest
tweakNamesInTest
2019-10-10 13:04:25 -07:00
Jeffrey Regan
e6770e5f1e tweakNamesInTest 2019-10-10 13:03:55 -07:00
Jeff Hastings
705b4ab212 cleanup on errors in git loader 2019-10-10 15:54:56 -04:00
Jeff Regan
2cb964ab8e Merge pull request #1614 from monopole/refactorComplexTest
refactor complexcomposition_test in prep for addition
2019-10-10 11:28:27 -07:00
Jeffrey Regan
949b10bf93 refactor complexcomposition_test in prep for addition 2019-10-10 11:25:38 -07:00
guoxudong
0115fbc3da add zh doc transformerconfigs.md validationTransformer.md 2019-10-10 15:27:10 +08:00
Jeff Regan
cc4341c546 Update INSTALL.md 2019-10-09 11:16:19 -07:00
Jeff Regan
d0caea0ce1 Update INSTALL.md
fix #1604
2019-10-09 11:15:48 -07:00
Jeff Regan
f2ac5a2d0d Merge pull request #1603 from monopole/kustapiversion
Introduce dummy program to help with API releases.
2019-10-08 15:39:44 -07:00
jregan
78d14d0d75 Introduce dummy program to help with API releases. 2019-10-08 15:15:24 -07:00
Kubernetes Prow Robot
d5034af5ca Merge pull request #1519 from sunny0826/zh
zh example:chart,secret generator plugin
2019-10-08 11:25:50 -07:00
guoxudong
40ed9e6a44 fix zh-doc 2019-10-08 09:49:55 +08:00
Jeff Regan
c1d20546ec Merge pull request #1597 from monopole/v330releaseNotes
v3.3.0 release notes
2019-10-07 17:35:02 -07:00
Jeffrey Regan
3cf6b8ec4d v3.3.0 release notes 2019-10-07 17:34:21 -07:00
Jeff Regan
3aee7a9081 Merge pull request #1596 from monopole/updatePluginator
Move pluginator to kustomize Go API v3.3.0
2019-10-07 16:47:28 -07:00
Jeffrey Regan
abefa2b155 Move pluginator to kustomize Go API v3.3.0 2019-10-07 16:46:16 -07:00
Jeff Regan
5d800f0b0a Merge pull request #1595 from monopole/threeReleases
Differentiate the cloud builders.
2019-10-07 15:45:01 -07:00
Jeffrey Regan
4eb2d5bcc2 Three builders. 2019-10-07 15:40:36 -07:00
Jeff Regan
988af1ff61 Update README.md 2019-10-07 12:38:21 -07:00
Kubernetes Prow Robot
1617183ea4 Merge pull request #1590 from monopole/releaseProcessUpdate
update release process doc
2019-10-07 11:39:11 -07:00
jregan
ee72746481 update release process doc 2019-10-07 10:21:29 -07:00
Jeff Regan
c9e7dc3bfa Merge pull request #1589 from monopole/moreTestsAroundKustFileName
improve tests for alternative kustomization file names
2019-10-04 10:22:04 -07:00
Jeffrey Regan
07e0e46ac7 improve tests for alternative kustomization file names 2019-10-04 10:17:49 -07:00
Jeff Regan
404d2d631a Merge pull request #1587 from monopole/reducePgmconfig
Reduce size of pgmconfig package
2019-10-03 18:37:27 -07:00
Jeffrey Regan
baa0296a12 Reduce size of pgmconfig package 2019-10-03 18:22:05 -07:00
Jeff Regan
0f665ac153 Merge pull request #1544 from ptux/add-transformer-href
add transformer href
2019-10-03 16:38:47 -07:00
Jeff Regan
14b0a65091 Merge pull request #1581 from monopole/refactorFs
Break the dep between fs and pgmconfig.
2019-10-02 12:39:02 -07:00
Jeffrey Regan
2d58f8b81c Break the dep between fs and pgmconfig. 2019-10-02 12:01:45 -07:00
Jeff Regan
9a43ca53cc Merge pull request #1578 from nlamirault/fix/build-plugins-doc
Fix: documentation link for plugins
2019-10-02 11:15:41 -07:00
Jeff Regan
5372fc6f6c Merge pull request #1579 from monopole/fsPackageCleanup
Improve fs package and doc in prep to officially go public
2019-10-01 12:16:38 -07:00
Kubernetes Prow Robot
86bc344057 Merge pull request #1513 from nimohunter/fix_empty_list_item
empty list or map item return error
2019-10-01 12:13:34 -07:00
Jeff Regan
a014f7d414 Merge pull request #1561 from beautytiger/dev-190925
improve test code coverage in transformers
2019-10-01 12:13:00 -07:00
Jeffrey Regan
9a94bcb854 Improve fs package and doc in prep to officially go public 2019-10-01 11:12:27 -07:00
Jeff Regan
07634ef098 Merge pull request #1575 from monopole/versioning
Update versioning notes.
2019-09-30 18:42:14 -07:00
jregan
995f88d60c Update versioning notes. 2019-09-30 18:41:09 -07:00
Rui Chen
5caba59073 Upgrade golang to v1.13 2019-09-29 16:34:18 -04:00
Nicolas Lamirault
334a64676f Fix: documentation link for plugins
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
2019-09-27 09:22:35 +02:00
Guangming Wang
08963ba503 improve test code coverage in transformers
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-09-27 14:53:58 +08:00
Jeff Regan
326fb689be Merge pull request #1570 from bzub/1234-go_plugin_doc
Fix compile kustomize example.
2019-09-26 17:40:11 -07:00
Jeff Regan
970ce67c34 Update goPluginCaveats.md 2019-09-26 17:38:50 -07:00
Jeff Regan
98d1893057 Update INSTALL.md 2019-09-26 17:34:53 -07:00
Jeff Regan
d89b448c74 Fix git tag recovery in cloud build.
Deleted in previous PR.  Hard to test locally.
2019-09-26 17:08:58 -07:00
Jeff Regan
17bf9d325b Update releasing README. 2019-09-26 16:58:22 -07:00
Kubernetes Prow Robot
a99aff1d1c Merge pull request #1571 from monopole/updateCloudBuildProcess
Update cloud build process for kustomize.
2019-09-26 16:39:34 -07:00
Jeffrey Regan
a694ac7b63 Update cloud build process for kustomize. 2019-09-26 16:05:35 -07:00
bzub
b5b11ef6e9 Fix compile kustomize example. 2019-09-26 17:37:53 -05:00
Jeff Regan
fa1af6f51e Merge pull request #1473 from richardmarshall/execpluginhash
Support resource generator options in exec plugins
2019-09-26 10:12:52 -07:00
Jeff Regan
9288dec02a Fix failing BashedConfigMapTest 2019-09-26 09:56:04 -07:00
Kubernetes Prow Robot
1a45dd0b4f Merge pull request #1566 from monopole/releaseNotes3.2.1
v3.2.1 release notes
2019-09-26 09:09:08 -07:00
Richard Marshall
592c5acf5a docs: Exec plugin generator options 2019-09-26 08:41:41 -07:00
Richard Marshall
ac9424fa3e tests: Add unit tests for update resource options 2019-09-26 08:41:41 -07:00
Richard Marshall
79fbe7c4cc Support resource generator options in exec plugins 2019-09-26 08:41:41 -07:00
Jeff Regan
f69d526fa3 v3.2.1 release notes 2019-09-25 19:48:37 -07:00
Jeff Regan
07a95a60f6 Merge pull request #1565 from monopole/tweakBinaryDepsBeforeTagging
Pin the kustomize binary's dependence on kustomize libs.
2019-09-25 18:29:38 -07:00
jregan
032b385711 Pin the kustomize binary's dependence on kustomize libs. 2019-09-25 18:09:45 -07:00
Kubernetes Prow Robot
810629596a Merge pull request #1564 from monopole/moveKustomizeBinaryToOwnModule
Move the kustomize binary to its own module.
2019-09-25 16:53:06 -07:00
Jeffrey Regan
b82a8fd316 Move the kustomize binary to its own module. 2019-09-25 15:37:48 -07:00
Kubernetes Prow Robot
2d0c22d6a4 Merge pull request #1562 from keleustes/tools
Pin tool versions using go modules
2019-09-25 13:50:06 -07:00
Ian Howell
aa342deff7 Pin tool versions using go modules
This pins down the versions of various tools used in the building,
testing, and linting of kustomize. This will provide more consistency
across contributors' and travis' environments.
2019-09-25 15:27:47 -05:00
Kubernetes Prow Robot
10786ec0a7 Merge pull request #1554 from keleustes/readme
Update README.md to include Kubernetes 1.16
2019-09-25 09:12:02 -07:00
Jerome Brette
7c7056877b Update README.md to include Kubernetes 1.16 2019-09-25 12:51:51 +00:00
Jeff Regan
e8933d9789 Merge pull request #1560 from monopole/precommitTuneup
Make pre-commit more portable and less tricky.
2019-09-24 21:42:35 -07:00
jregan
9d7b65446f Make pre-commit more portable and less tricky. 2019-09-24 21:10:58 -07:00
Jeff Regan
7a0946a922 Merge pull request #1558 from monopole/dependOnNewPluginatorModule
Depend on new pluginator location.
2019-09-24 18:18:18 -07:00
Jeffrey Regan
def4f04572 Depend on new pluginator location. 2019-09-24 16:43:53 -07:00
Jeff Regan
2f2408f1cd Merge pull request #1559 from monopole/compressCopyright
Compress copyright in the commands package.
2019-09-24 16:43:26 -07:00
Jeffrey Regan
3b9bcc48a0 Compress copyright in the commands package. 2019-09-24 16:40:32 -07:00
Jeff Regan
d0429ff43b Merge pull request #1557 from monopole/pluginatorModule
Copy pluginator to its own module.
2019-09-24 14:38:38 -07:00
Jeffrey Regan
33deefc307 Copy pluginator to its own module. 2019-09-24 11:24:13 -07:00
Jeff Regan
9b3de82b45 Merge pull request #1506 from Liujingfang1/release
add release note for v3.2.0
2019-09-23 10:14:17 -07:00
Kubernetes Prow Robot
d217074fbf Merge pull request #1550 from keleustes/apiversion
Fix typo yaml declaration of APIVersion field of Kustomization type
2019-09-23 09:25:24 -07:00
Jerome Brette
1d90ba7c7b Fix typo in apiVersion yaml declaration 2019-09-22 05:24:58 +00:00
Kubernetes Prow Robot
eeeb4c36a1 Merge pull request #1547 from keleustes/extensions
Update Ingress apiVersion to networking.k8s.io/v1beta1
2019-09-20 13:17:26 -07:00
Jerome Brette
b1faa989f4 Update Ingress apiVersion to networking.k8s.io/v1beta1 2019-09-20 19:37:05 +00:00
nimohunter
d8250c9ee2 move test case 2019-09-19 15:45:31 +08:00
Wang(わん)
c950046659 add transformer href 2019-09-19 11:34:01 +09:00
Kubernetes Prow Robot
0c32691e9e Merge pull request #1537 from jaypipes/gomod-install-note
add note about GO111MODULE for source install
2019-09-18 11:43:31 -07:00
Jeff Regan
88b1d62740 Merge pull request #1541 from rtnpro/patch-1
Fix typo in transformerconfigs README
2019-09-18 11:34:18 -07:00
Jeff Regan
aec8206695 Update INSTALL.md 2019-09-18 11:33:18 -07:00
Jeff Regan
20c2b53a46 Merge pull request #1542 from monopole/tweakFilePathsInTest
Tweak file path handling and logging in test.
2019-09-18 11:19:08 -07:00
Jeffrey Regan
274b5c3b4e Tweak file path handling and logging in test. 2019-09-18 11:17:21 -07:00
Ratnadeep Debnath
b1fdaa2311 Fix typo in transformerconfigs README 2019-09-18 19:01:02 +05:30
Kubernetes Prow Robot
a3103f1e62 Merge pull request #1534 from monopole/configExample
Example of configuring builtin plugin.
2019-09-17 16:43:15 -07:00
Jeffrey Regan
74ed0b30e5 Example of configuring builtin plugin. 2019-09-17 16:29:08 -07:00
nimohunter
b5d5e70bdc empty list or map item return error 2019-09-16 09:42:49 +08:00
nimohunter
2e82985380 empty list or map item return error 2019-09-16 09:30:01 +08:00
Jay Pipes
55941f5769 add note about GO111MODULE for source install
It's not immediately obvious that in order to
get the `go install sigs.k8s.io/kustomize/v3/cmd/kustomize` instructions
to work successfully, you need to have `GO111MODULE=on` set, so I added
a note about that.

Issues #1536, #1314
2019-09-14 18:59:07 -04:00
Kubernetes Prow Robot
32be1cf4c2 Merge pull request #1532 from monopole/runBuiltinSansFlag
Ease configuring and running the builtin plugins.
2019-09-13 15:28:00 -07:00
jregan
2050afdeb4 Ease doing custom configuration of builtin plugins. 2019-09-13 14:45:36 -07:00
Kubernetes Prow Robot
7e71009283 Merge pull request #1526 from jimmidyson/ignore-prefix-suffix-apiservice
Do not prefix/suffix APIService resources
2019-09-13 11:28:29 -07:00
Kubernetes Prow Robot
72d26c6ad5 Merge pull request #1522 from jcassee/basereusenameprefix-test
Add test for name conflict with base reuse
2019-09-13 11:02:29 -07:00
Jeff Regan
e011f3be4f change "bases:" to "resources:"
per https://github.com/monopole/kustomize/blob/master/docs/fields.md#bases

no big deal
2019-09-13 10:47:35 -07:00
Kubernetes Prow Robot
f725bfc165 Merge pull request #1520 from jcpetruzza/cm-merge-nameprefix
Consider also currentId when replacing/merging resources
2019-09-13 10:40:30 -07:00
Jeff Regan
94ac55f17b Merge pull request #1505 from Liujingfang1/master
add inline patch document
2019-09-13 10:16:40 -07:00
Jimmi Dyson
dd5b3c1e2e Do not prefix/suffix APIService resources 2019-09-12 09:53:33 +01:00
Joost Cassee
e898c5221b Add test for name conflict with base reuse 2019-09-10 23:57:15 +02:00
Daniel Gorin
1237ae43b4 Consider currentId when replacing/merging resources
When merging resources such as the output of a `configMapGenerator`,
we need to consider the `CurrentId`, otherwise, we cannot extend
a common base definition twice by adding different prefixes, and
then further kustomize them.

See #1442.
2019-09-10 11:14:08 +01:00
guoxudong
281f932814 zh example:chart,secret generator plugin 2019-09-10 10:19:18 +08:00
Kubernetes Prow Robot
cd0187e948 Merge pull request #1515 from yujunz/plugin/go-getter
plugin/go-getter: support urls including `:`
2019-09-09 09:05:22 -07:00
jingfangliu
9516880042 add inline patch document 2019-09-09 09:02:48 -07:00
Yujun Zhang
4cb883863f plugin/go-getter: support urls including : 2019-09-09 15:39:45 +08:00
nimohunter
9e226001e3 empty list or map item return error 2019-09-09 13:42:18 +08:00
Kubernetes Prow Robot
9ee35c9afb Merge pull request #1484 from sunny0826/master
update zh doc
2019-09-06 08:44:58 -07:00
guoxudong
e455acc14b fix 2019-09-06 09:20:21 +08:00
Jeff Regan
6a3c2b2893 Merge pull request #1507 from monopole/anotherTest
Add an example of reusable builtin plugins with custom config.
2019-09-05 16:11:53 -07:00
Jeffrey Regan
f59d7998d2 Add an example of reusable builtin plugins with custom config. 2019-09-05 15:53:03 -07:00
jingfangliu
77b63f96d1 add release note for v3.2.0 2019-09-05 13:42:43 -07:00
Michael
6fcb78403f use kubectl apply -k # (#1495)
`kubectl apply -f ` is executed failed.  ref: #1494
2019-09-05 09:27:39 -07:00
Kubernetes Prow Robot
f87edc8c67 Merge pull request #1488 from yujunz/plugin/go-getter
Add example plugin for go-getter
2019-09-05 08:57:10 -07:00
Yujun Zhang
6a4150d199 Amend go-getter plugin document according to comments 2019-09-05 13:57:20 +08:00
Jeff Regan
143c5dd21d Merge pull request #1489 from damienr74/generic-crawler
tooling performance improvements, better structure
2019-09-03 11:35:43 -07:00
Yujun Zhang
ed920afb2e Support setting command in go-getter plugin
This allows one to use non-kustomization remote source
2019-09-02 14:53:18 +08:00
Jeff Regan
2677f4c4e7 Merge pull request #1492 from monopole/anotherTest
Test custom configuration of a builtin plugin.
2019-08-30 16:54:21 -07:00
jregan
a081534938 Test custom configuration of a builtin plugin. 2019-08-30 16:37:29 -07:00
Kubernetes Prow Robot
4ebad27d7a Merge pull request #1490 from mr-karan/docfix
feat: Add instructions for setting key in configmap
2019-08-30 11:08:57 -07:00
Karan Sharma
716a7307b2 feat: Add instructions for setting key in configmap 2019-08-30 16:21:11 +05:30
Yujun Zhang
ed91bce275 Add example plugin for go-getter 2019-08-30 11:14:46 +08:00
Damien Robichaud
c2d6f09ef3 Crawler performance improvements, better structure
Refactored the crawler implementation to make the whole thing more
testable. Added a document interface to make the crawler generic.
This will be useful for collecting plugins, and other documents.
2019-08-29 22:25:45 -03:00
Kubernetes Prow Robot
119ff5af73 Merge pull request #1487 from laverya/properly-omitempty-kustomization-inventory
properly omitempty for 'inventory' in 'kustomize'
2019-08-29 15:17:00 -07:00
Andrew Lavery
2e7ad48b44 properly omitempty for 'inventory' in 'kustomize'
with the current 'yaml:"inventory:omitempty"', 'inventory:omitempty' is used as the literal name for the yaml field
2019-08-29 14:41:03 -07:00
Kubernetes Prow Robot
6ead3b7b1f Merge pull request #1446 from keleustes/ending
IsInKustomizeCtx should use end of nameprefix array instead of beginning
2019-08-29 12:12:59 -07:00
Jerome Brette
31262cccbe IsInKustomizeCtx should use end of nameprefix array (code review) 2019-08-29 13:59:01 -05:00
Jerome Brette
93cedbaa51 IsInKustomizeCtx should use end of nameprefix array (3/3)
Improve multi level kustomization ctx during candidate selection
testing.
2019-08-29 13:58:03 -05:00
Jerome Brette
6e13acfac3 IsInKustomizeCtx should use end of nameprefix array (2/3)
Update unit tests associated with in IsSameKustomizeCtx
2019-08-29 13:58:03 -05:00
Jerome Brette
2e6dd481e0 IsInKustomizeCtx should use end of nameprefix array (1/3)
Need to use ending prefix and suffix subarray instead of beginning
2019-08-29 13:58:03 -05:00
Kubernetes Prow Robot
a66808a10d Merge pull request #1483 from bianpengyuan/fix-typo
Fix environment variable typo in plugin doc
2019-08-28 13:17:55 -07:00
guoxudong
a4e1ba0593 update zh doc 2019-08-27 13:57:17 +08:00
Pengyuan Bian
73660af10c fix environment variable typo. 2019-08-26 16:24:44 -07:00
Kubernetes Prow Robot
84519c236b Merge pull request #1434 from sunny0826/master
update examples-zh
2019-08-26 09:00:27 -07:00
guoxudong
aedb362565 fix doc 2019-08-24 16:18:34 +08:00
Jeff Regan
6918931728 Merge pull request #1481 from damienr74/modify-crawler
Add configs
2019-08-23 12:59:08 -07:00
Damien Robichaud
3f1b2bb744 Add configs 2019-08-23 12:57:59 -07:00
Kubernetes Prow Robot
33ad02a6b4 Merge pull request #1383 from richardmarshall/smp_patch_directive
Handle ordering patch with SMP delete directives
2019-08-23 11:15:18 -07:00
Kubernetes Prow Robot
bfd6e086de Merge pull request #1474 from keleustes/coverage
Add cover target to Makefile
2019-08-23 10:55:18 -07:00
Jeff Regan
a9f58383d8 Merge pull request #1460 from richardmarshall/namespace_conflicts
Detect ID conflicts in namespace transformer
2019-08-23 10:54:36 -07:00
Ian Howell
aabbbf05ef Add cover target to Makefile 2019-08-23 08:22:00 -05:00
Jeff Regan
40c613d0cd Merge pull request #1476 from damienr74/add-ui
Adds frontend + configs to interal/tools
2019-08-22 16:59:44 -07:00
Jeff Regan
eca5b8796f Merge pull request #1470 from damienr74/index
First draft of documentation for internal/tools
2019-08-22 16:08:44 -07:00
Damien Robichaud
aa2bf7ed08 Adds frontend + configs to interal/tools/ui 2019-08-22 15:39:00 -07:00
Damien Robichaud
351df67e39 First draft of documentation for internal/tools 2019-08-21 17:01:59 -07:00
Kubernetes Prow Robot
8a8698ccdd Merge pull request #1469 from damienr74/index
Add simple service/configs to internal tooling.
2019-08-21 14:58:31 -07:00
Damien Robichaud
66fa2de073 Add main backend service and configurations 2019-08-21 14:29:41 -07:00
Kubernetes Prow Robot
3ace96d7a4 Merge pull request #1467 from richardmarshall/create_fixes
Fixes to create sub-command
2019-08-21 11:38:33 -07:00
Jeff Regan
2b44ba200f Merge pull request #1455 from lcostea/master
Add short version flag
2019-08-21 11:35:23 -07:00
Jeff Regan
4b67a6de12 Merge pull request #1456 from matti/patch-2
fix latest version
2019-08-21 10:57:18 -07:00
Jeff Regan
33bd221a98 Update README.md
removed it rather than keeping it and having it get out of date again
2019-08-21 10:56:43 -07:00
Richard Marshall
594a06d35b Fixes to create sub-command 2019-08-21 08:59:21 -07:00
Kubernetes Prow Robot
e541ff3999 Merge pull request #1414 from richardmarshall/create_subcommand
Create subcommand
2019-08-20 16:47:20 -07:00
Jeff Regan
9ea184c04a Merge pull request #1449 from richardmarshall/git_cycle_detection
Fix indirect cycle detection for git resources
2019-08-20 16:17:36 -07:00
Jeff Regan
993993c6cd Merge pull request #1464 from damienr74/index
Add internal tooling library for index managment.
2019-08-20 15:22:58 -07:00
Jeff Regan
35b39763dd Merge pull request #1445 from liggitt/patch-path
Fix patch path example
2019-08-20 15:15:03 -07:00
Jeff Regan
2c1dda5436 Merge pull request #1437 from fentas/fentas-patch-1
add PriorityClass to the order list
2019-08-20 15:09:57 -07:00
Jeff Regan
653123975c Merge pull request #1435 from lukatera/go-get-submodules
Download submodules when using base from git
2019-08-20 15:08:08 -07:00
Jeff Regan
fb8b314a29 Merge pull request #1426 from fleeto/translate-zh-glossary
translate-zh: glossary.md
2019-08-20 15:04:22 -07:00
Jeff Regan
5cf3f4e275 Merge pull request #1419 from richardmarshall/git_url_handling
Handle git:: prefix in urls containing _git
2019-08-20 15:01:14 -07:00
Jeff Regan
766500508c Merge pull request #1465 from monopole/testHeadAgainstExamples
Test examples against HEAD as well as against latest release.
2019-08-20 14:24:09 -07:00
Jeffrey Regan
423a8a6e0d Test examples against HEAD as well as against latest release. 2019-08-20 14:10:01 -07:00
Damien Robichaud
7783a76b8f Add internal tooling library for index queries. 2019-08-20 11:25:20 -07:00
Jeff Regan
2b6a406dc7 Merge pull request #1462 from monopole/errormessages
in plugin executor remove unnecessary code and improve error messages
2019-08-19 20:35:51 -07:00
jregan
bc303c4629 in plugin executor remove unnecessary code and improve error messages 2019-08-19 20:23:07 -07:00
Jeff Regan
00360f381c Merge pull request #1461 from monopole/fixNonTravisTests
Fix non-travis tests.
2019-08-19 16:29:44 -07:00
jregan
fa834f9541 Fix non-travis tests. 2019-08-19 16:29:00 -07:00
Jeff Regan
a2767cab2a Merge pull request #1374 from alexeldeib/ace/windows
fix: windows builds
2019-08-19 15:03:51 -07:00
Richard Marshall
24c173a49b Detect ID conflicts in namespace transformer 2019-08-19 08:55:54 -07:00
Matti Paksula
d3d4908f95 fix latest version
I don't think it makes sense to have version in README, though
2019-08-18 13:18:22 +03:00
Jeff Regan
be1d5478dc Merge pull request #1450 from damienr74/master
Add internal tooling for kustomize
2019-08-16 14:49:37 -07:00
Damien Robichaud
d3022ccd65 rename to tools directory 2019-08-16 11:25:20 -07:00
Damien Robichaud
fe45157b26 Update crawler to cache web request form github.
- Increase logging signal to noise ratio.
- Allow to specify the `http.Client` for github requests. (This allows
 the use of caching http.Clients).
- Clean up implementation.
2019-08-16 09:48:23 -07:00
Damien Robichaud
df779fd720 Modify document for elasticsearch migration. 2019-08-16 09:48:23 -07:00
Damien Robichaud
e0d388c6f7 Implements search query partitioning by filesize.
Binary searches through different ranges of file sizes to create search
queries with fewer than 1000 results. This is required since github will
only return the first 1000 result of any search query.

The implementation handles the case where some files may be deleted
while the search is running, and (possibly artificially) assures that the
number of files increases monotonically as the filesize range grows.

The implementation also caches queries and is expected to make fewer
than O((#files/1000) * lg(max file size)) API calls to retrieve the
range queries that can be used to index all of the files.

In practice running the search splitting takes a few minutes, while
retrieving all of the data takes a few hours.
2019-08-16 09:48:23 -07:00
Damien Robichaud
62edcae233 Implementation of configurable github crawler.
Currently I've left the search splitting by file size out of this commit
since it's ~200 lines of logic, and I think it's best to get it reviewed
separately.

In it's current state the crawler would only be able to get the last
1000 indexed files by Github, but it does show the general structure of
how the crawler is implemented.
2019-08-16 09:48:23 -07:00
Damien Robichaud
ac6918d70f Implementation of github query helper library.
To make this easier to read, use, and modify, I've abstracted the
important parts of the github query api into crawler/github/query.go
which allows to describe at a high level what is to be searched without
knowing the API syntax.
2019-08-16 09:48:23 -07:00
Damien Robichaud
ca41674df3 Implementation of basic crawler organisation.
`crawler.Crawler` interface is defined, where a crawler has to implement
a `Crawl` method that forwards document found by the crawler to a channel.

A helper function that launches a list of crawlers concurrently and
merges their channels into one main output channel, forwarding errors is
also implemented.

Finally, a test that verifies the correctness and concurrency of the
helper method is provided.
2019-08-16 09:48:23 -07:00
Damien Robichaud
c02b4f3a11 Initial (temporary) implementation of search doc.
Document describing how to convert a kustomization file into a
searchable document on appengine (will be changed to elasticsearch)
soon.
2019-08-16 09:48:23 -07:00
Liviu Costea
64341a81fa Add short version flag 2019-08-16 09:46:37 +03:00
Richard Marshall
fe8ba8e44b Log loader errors during resource accumulation 2019-08-15 07:59:55 -07:00
Richard Marshall
54f1952195 Log output from git on errors 2019-08-15 07:34:38 -07:00
Richard Marshall
44b62a8ebc Fix indirect git resource cycle detection 2019-08-15 07:25:20 -07:00
Jordan Liggitt
8e9c08ea61 Fix patch path example 2019-08-14 15:55:55 -04:00
Kubernetes Prow Robot
c464fb0a81 Merge pull request #1436 from richardmarshall/kubectl_clarity
docs: Additional details for kubectl integration
2019-08-13 15:18:23 -07:00
Richard Marshall
9481e3fba6 docs: Update patchesStrategicMerge documentation 2019-08-13 13:38:42 -07:00
Richard Marshall
0e5206a251 test: Update target tests for SMP directives 2019-08-13 13:38:42 -07:00
Richard Marshall
96c5b4aa3e Handle ordering patches with SMP delete directives
This change enables the SMP patch merging process to support delete
directives in patches regardless of input order.
2019-08-13 13:38:41 -07:00
Jan Guth
6c44da52a2 add PriorityClass to the order list 2019-08-10 07:31:54 +02:00
Kubernetes Prow Robot
694cf23df8 Merge pull request #1432 from richardmarshall/lostreplicas
Retain replicas field in edit marshal path
2019-08-09 14:29:14 -07:00
Richard Marshall
e66656aa7f docs: Additional details for kubectl integration 2019-08-08 17:06:19 -07:00
Richard Marshall
eaae7af5fe Retain replicas field in edit marshal path 2019-08-08 15:45:56 -07:00
Luka Skugor
2de052ecd8 Download submodules when using base from git 2019-08-08 15:49:56 +02:00
guoxudong
6cf8b9e2b8 update examples-zh 2019-08-08 10:16:13 +08:00
Kubernetes Prow Robot
f9fe138114 Merge pull request #1416 from anthonyho007/makefile
add Makefile for local development
2019-08-07 11:04:09 -07:00
Vincent C
78c9729252 translate-zh: glossary.md 2019-08-03 20:40:58 +08:00
Kubernetes Prow Robot
2a2a889c37 Merge pull request #1423 from sunny0826/master
Update zh-README.md & zh-example-README.md
2019-08-02 12:37:55 -07:00
郭旭东
34287e511f fix example-zh-README.md 2019-08-02 09:09:32 +08:00
Anthony Ho
e6fffc8ba4 add makefile 2019-08-01 11:23:38 -04:00
郭旭东
86f221611e Update zh-example-README.md 2019-08-01 15:30:11 +08:00
郭旭东
b4d6e89fa2 Update zh-README.md 2019-08-01 15:19:14 +08:00
Richard Marshall
adbb6228a5 Handle git:: prefix in urls containing _git 2019-07-31 10:23:05 -07:00
Kubernetes Prow Robot
5937bd0259 Merge pull request #1394 from richardmarshall/namerefperformance
Simplify name reference candidate resmap building
2019-07-31 10:18:14 -07:00
Richard Marshall
eeafd43513 Remove import of k8sdeps from create command 2019-07-30 20:52:06 -07:00
Richard Marshall
a68f95b65f Rename commands utility function file 2019-07-30 20:50:52 -07:00
Richard Marshall
ed3c29be12 Simplify name reference candidate resmap building
This patch removes a layer of looping in the name reference candiate
resmap building process by not checking if the resources already exist
in the new resmap.
2019-07-30 17:15:15 -07:00
Kubernetes Prow Robot
3d2e956b19 Merge pull request #1412 from richardmarshall/anchor_resmap_select
Automatically anchor resource selector patterns
2019-07-30 15:47:11 -07:00
Kubernetes Prow Robot
dd9d1f95e9 Merge pull request #1389 from Liujingfang1/repospec
make repospec memebers public
2019-07-30 15:27:51 -07:00
jingfangliu
a279c08f7d make repospec memebers public 2019-07-30 13:56:20 -07:00
Kubernetes Prow Robot
a798109161 Merge pull request #1413 from bai/fix-typo
Fix typo in patches definition
2019-07-30 10:14:51 -07:00
Richard Marshall
5dfa929906 Add create subcommand 2019-07-30 09:17:29 -07:00
Richard Marshall
e904f612f3 Move commands/edit utils package up to commands 2019-07-30 08:45:06 -07:00
Vlad Gorodetsky
bafd6b5423 Fix typo in patches definition 2019-07-30 14:52:02 +03:00
Richard Marshall
963913f9ef Automatically anchor resource selector patterns 2019-07-29 17:57:33 -07:00
Jingfang Liu
46905588ac add document for inline patch (#1411) 2019-07-29 15:15:06 -07:00
Kubernetes Prow Robot
5426888df4 Merge pull request #1405 from Liujingfang1/inlinepatch
add inline patch support for Strategic Merge Patch and JSON patch
2019-07-29 14:28:49 -07:00
jingfangliu
35481ec6d9 add inline patch support for Strategic Merge Patch and JSON patch 2019-07-29 14:10:57 -07:00
Kubernetes Prow Robot
6c92c30e94 Merge pull request #1402 from damienr74/currentid-replicas
Allow replicas to find modified names.
2019-07-29 12:54:47 -07:00
Damien Robichaud
02f6b3ec98 Allow replicas to find modified names.
Also allows to test for modified resmaps instead of directly loading
them.
2019-07-26 18:00:59 -07:00
Kubernetes Prow Robot
a9848f2738 Merge pull request #1403 from Liujingfang1/inlinepatch
add testing for patch transformers
2019-07-26 15:05:57 -07:00
jingfangliu
b4038a6cd2 add testting for patch transformers 2019-07-26 14:02:52 -07:00
Kubernetes Prow Robot
95f3303493 Merge pull request #1400 from keleustes/defaultsa
Force the namespace value for the "default" service object.
2019-07-26 10:51:21 -07:00
Jerome Brette
2faf4a491b Force the namespace value for the "default" service object.
The clusterrolebinding and rolebinding is pointing at a resource
which is not listed in the kustomize
2019-07-25 22:43:59 +00:00
Kubernetes Prow Robot
e646bba1ff Merge pull request #1396 from Liujingfang1/delete
support strategic merge patch with $patch: delete
2019-07-25 12:24:45 -07:00
Kubernetes Prow Robot
99a21b0a3c Merge pull request #1308 from keleustes/varequal
Demonstrate need for Var.DeepEqual method equivalent
2019-07-25 11:26:06 -07:00
Kubernetes Prow Robot
e7a22b6bc5 Merge pull request #1398 from keleustes/doc
Update v3.1.0 release notes.
2019-07-25 10:43:28 -07:00
Jerome Brette
d783bbc0bc DeepEqual method seems cleaner than adding Defaulting before every
reflect.DeepEqual call
2019-07-25 03:52:25 +00:00
Jerome Brette
b7405f3872 Test new types.Var.DeepEqual method. 2019-07-25 03:50:28 +00:00
Jerome Brette
abc419b5f9 Add Absorb method to VarSet and DeepEqual to Var 2019-07-25 03:42:40 +00:00
Jerome Brette
336378b114 Update release notes 2019-07-25 00:12:51 +00:00
jingfangliu
29959551da release note for v3.1.0 2019-07-24 14:16:09 -07:00
jingfangliu
fc78917191 support strategic merge patch with $patch: delete 2019-07-24 12:46:33 -07:00
Kubernetes Prow Robot
ffd95ef5a9 Merge pull request #1378 from keleustes/nameprefix
Name Prefix and Suffix Transformation for multi level level kustomize context
2019-07-24 11:33:21 -07:00
Jerome Brette
230090d790 Fix namereference and stacked kustomization contexts (3/3)
- Update unit and integration tests.
2019-07-24 18:02:29 +00:00
Jerome Brette
8fa3861ba3 Fix namereference and stacked kustomization contexts (2/3)
- Leverage nameprefix and namesuffix contextual data
2019-07-24 18:02:23 +00:00
Jerome Brette
69c90e3427 Fix namereference and stacked kustomization contexts (1/3)
- Update PrefixSuffixTransfomer to add empty prefix and suffix
2019-07-24 10:59:07 -05:00
Kubernetes Prow Robot
5a73f345fd Merge pull request #1388 from Liujingfang1/patch
add example for extended patches
2019-07-23 17:04:16 -07:00
jingfangliu
0e62d759f0 address comments 2019-07-23 16:55:58 -07:00
jingfangliu
b2967d2f77 add example for extended patches 2019-07-23 15:54:25 -07:00
Kubernetes Prow Robot
c23039c07a Merge pull request #1379 from keleustes/namespace
Update Namespace and Name simultaneously
2019-07-23 14:10:14 -07:00
Kubernetes Prow Robot
5747c417c4 Merge pull request #1363 from Liujingfang1/patch
update edit fix to convert the old patches to patchesStrategicMerge
2019-07-23 13:16:14 -07:00
jingfangliu
8c53d77111 update edit fix to convert the old patches to patchesStrategicMerge 2019-07-23 10:38:48 -07:00
Jerome Brette
01667cabde Update Namespace and Name simultaneously (2/2)
Add tests combining prefixsuffix and namespace transformers.
2019-07-23 11:04:59 -05:00
Jerome Brette
f649b62629 Update Namespace and Name simultaneously (1/2)
- Removed RoleBinding and Webhook specific code in the namespacetransformer.
  That code was attempting to perform the task of the namereference
- Updated namereference transformer configuration to suppport the
  Webhooks.
- Prevent the namereference from wiping out the namespace value if
  no referral candidate was selected
- Added unit tests.
2019-07-23 11:04:52 -05:00
Kubernetes Prow Robot
3a4d025b5c Merge pull request #1371 from keleustes/nsvar
Add namespace to variable definition
2019-07-22 11:04:53 -07:00
Ace Eldeib
c2cc93a009 fix: tempfile(?) 2019-07-19 17:38:24 -07:00
Ace Eldeib
af29855802 fix: windows builds 2019-07-19 12:58:06 -07:00
Jerome Brette
99eb08eb1e Add Namespace to var definition to allow disambiguation 2019-07-19 12:08:38 -05:00
Kubernetes Prow Robot
d3f8c0d87f Merge pull request #1327 from keleustes/residrequals-variables
ResId.Equals usable for VariableRef.
2019-07-19 09:41:12 -07:00
Jerome Brette
0bec7b996b Code review implementation for namespace needed in vars 2019-07-18 19:20:10 -05:00
Jerome Brette
dd5674fe6b ResId.Equals usable for VariableRef.
- Namespace need objRef field in variable declaration
- Add namespace conflict test for variables

The replacement of ResId.GkvnEquals reference by ResId.Equals
highligthed the fact it is no possible yet when looking for
variable targets because the namespace field is not allowed yet.
This commit adds two tests to the namespaces_test.go regarding
that use case.
2019-07-18 19:20:10 -05:00
Kubernetes Prow Robot
33159c26df Merge pull request #1369 from Liujingfang1/order
add ResourceQuota to the order list
2019-07-18 16:35:51 -07:00
Kubernetes Prow Robot
afc7dbebe5 Merge pull request #1326 from keleustes/residequals-patchtransformer
Residequals patchtransformer
2019-07-18 13:14:19 -07:00
Jerome Brette
f363acf839 Implement code review changes for ResId.Equals instead of ResId.GkvnEquals 2019-07-18 14:13:51 -05:00
Kubernetes Prow Robot
96d5a7401d Merge pull request #1365 from richardmarshall/fix_integration_test
Fix kustomize install in integration test
2019-07-18 11:56:26 -07:00
jingfangliu
403fa20546 add ResourceQuota and LimitRange to the order list 2019-07-18 11:44:46 -07:00
Richard Marshall
ba4d7ddca8 test: Fix kustomize install in integration test 2019-07-17 20:28:47 -07:00
Jerome Brette
5116e2f210 Improve Transformer with Namespace tests.
- Reorganize test into test tables.
- Ensure that every test case, convers SMP and JSONPatch by
  using Deployment as kind first and then "MyCRD" as kind.
- Add tests involving namespaces.
- Add tests involving reordering of patches.
2019-07-17 15:44:44 -05:00
Jerome Brette
9e0f198227 Start to phase out usage ResId.GvknEquals where possible 2019-07-17 15:44:44 -05:00
Kubernetes Prow Robot
30b378a924 Merge pull request #1325 from keleustes/residequals-namereference
NameReference Transformer needs to account for namespace and cluster wide objects.
2019-07-17 13:20:13 -07:00
Kubernetes Prow Robot
3a843f1eca Merge pull request #1362 from Liujingfang1/doc
update the latest version in readme
2019-07-17 13:04:14 -07:00
Jerome Brette
9b40f8ab47 Implement code review comments to NameReferenceTransformer changes.
- Add comments where code with potentially misleading.
- Rename functions according to comments
2019-07-17 14:10:01 -05:00
jingfangliu
dc6dcd8150 update the latest version in readme 2019-07-17 12:05:12 -07:00
Kubernetes Prow Robot
3cb6c7f1f4 Merge pull request #1349 from yujunz/faq
Add FAQ about how to customize configuration
2019-07-17 11:26:11 -07:00
Kubernetes Prow Robot
7632839bc8 Merge pull request #1350 from yujunz/docs/plugins
Convert go plugin example to GPG based
2019-07-17 10:40:37 -07:00
Yujun Zhang
c3ea109b59 Update goPluginGuidedExample.md 2019-07-17 08:19:50 +08:00
Jerome Brette
579995dc8a Address simultaneous transformation of name and namespace
Namereference handler needs to address simulatenous change of
name and namespace in ClusterRoleBinding for instance.
2019-07-16 18:17:33 -05:00
Jerome Brette
b43bd5440d Update Issue 1264 Reproduction Test 2019-07-16 18:17:33 -05:00
Jerome Brette
c4d899f7f3 Improve NameReference Test cases
- Add more NameReference Namespace tests
- Address issue when mixing empty/no namespace and default namespace.
- Address ClusterRoleBinding subjects field pointing at multiple namespaces.
2019-07-16 18:17:33 -05:00
Jerome Brette
7998ee7036 Addresses slice case with notNamespaceable objects 2019-07-16 18:17:33 -05:00
Kubernetes Prow Robot
878960d7b1 Merge pull request #1355 from Liujingfang1/patch
enable extended patch transformer and add tests
2019-07-16 15:58:34 -07:00
jingfangliu
ed0cfc685b add test for extended patch with overlapping patches 2019-07-16 15:16:00 -07:00
Kubernetes Prow Robot
b0a7345123 Merge pull request #1359 from keleustes/imagetag
Address replacement of digest by ImageTransformer
2019-07-16 13:10:49 -07:00
Jerome Brette
580963ea76 Address replacement of digest by ImageTransformer
- See [Issue 1357](https://github.com/kubernetes-sigs/kustomize/issues/1357)
- Add more plugin tests.
2019-07-16 14:03:56 -05:00
Kubernetes Prow Robot
0707deae95 Merge pull request #1356 from keleustes/droppatch
Test tracking issue patchesStrategicMerge elements can be dropped
2019-07-16 10:50:18 -07:00
Yujun Zhang
fb44880b8c Add back GCP KMS example 2019-07-16 20:10:16 +08:00
Jerome Brette
e5ebca6604 Test tracking issue "patchesStrategicMerge elements can be dropped"
- Issue 1354
- $patch: delete is ignored or not depending of the include order
  in the kustomization.yaml
2019-07-15 19:02:52 -05:00
jingfangliu
f5fc9acb84 fix local test failures 2019-07-15 18:59:16 -05:00
jingfangliu
28d1bad3cb fix the ci failure 2019-07-15 18:58:52 -05:00
jingfangliu
6f74419628 fix local test failures 2019-07-15 16:34:13 -07:00
jingfangliu
8121467c1e fix the ci failure 2019-07-15 16:01:23 -07:00
jingfangliu
a85f297f31 enable extended patch transformer and add tests 2019-07-15 15:45:08 -07:00
Kubernetes Prow Robot
76a7816aeb Merge pull request #1348 from yujunz/nameref
Add storage class name ref
2019-07-15 13:17:25 -07:00
Kubernetes Prow Robot
7872405379 Merge pull request #1336 from richardmarshall/fix_test_flags
Remove go testing flags from kustomize help
2019-07-15 13:13:24 -07:00
Kubernetes Prow Robot
6c17a3409f Merge pull request #1346 from Liujingfang1/patchallkinds
add extended patch transformer
2019-07-15 11:45:24 -07:00
Yujun Zhang
f1dbab9dee Convert go plugin example to GPG based 2019-07-14 11:33:37 +08:00
Yujun Zhang
bfafbbf47f Add FAQ about how to customize configuration 2019-07-14 10:39:45 +08:00
Yujun Zhang
08d7c35da7 Add storage class name ref 2019-07-14 10:05:19 +08:00
Kubernetes Prow Robot
f12704f6c1 Merge pull request #1331 from Rjerk/fix-vp-doc
docs/versioningPolicy.md: fix expired urls
2019-07-12 14:41:05 -07:00
Tony Hsu
0edab60b30 Fix typo: kubectl v1.15 -> kubectl v1.14 (#1333)
* Fix typo: kubectl v1.15 -> kubectl v1.14

Match version number to the version in the link.

* Add both kubectl v1.14 and v1.15

* Add both kubectl v1.14 and v1.15
2019-07-12 14:38:10 -07:00
jingfangliu
3c05e2d664 add extended patch transformer 2019-07-12 14:34:08 -07:00
Kubernetes Prow Robot
aa2313c282 Merge pull request #1344 from Liujingfang1/fix
include nameprefix and namesuffix to find matched reference for cluster level kinds
2019-07-12 11:55:06 -07:00
jingfangliu
eeed1954fb include nameprefix and namesuffix to find matched reference for cluster level kinds 2019-07-12 10:27:02 -07:00
Kubernetes Prow Robot
cd00ce7ab1 Merge pull request #1341 from Liujingfang1/refactor
move strategic merge patch transformer to a builtin transformer
2019-07-12 09:25:05 -07:00
jingfangliu
145d07363f add labels in test patch files 2019-07-12 08:56:34 -07:00
jingfangliu
33fff655db move strategic merge patch transformer to a builtin transformer 2019-07-11 13:39:30 -07:00
Jingfang Liu
31ab347da2 refactor the strategic merge patch transformer toward moving it to a plugin (#1340) 2019-07-11 10:22:56 -07:00
Kubernetes Prow Robot
7a48b2ba8e Merge pull request #1338 from yujunz/transformer/config
Fix missing nameReference in default config
2019-07-11 09:32:55 -07:00
Yujun Zhang
876f2a8236 Fix missing nameReference in default config
Related to #1322
2019-07-11 19:46:29 +08:00
Richard Marshall
095333ffb1 Update references to NewEnvForTest 2019-07-10 20:43:50 -07:00
Richard Marshall
0d8d9e2f2b Move plugin EnvForTest manager into new package
Move the EnvForTest manager into an independent package that is not
imported by any non-test code. Previously this code was directly
embedded in the plugins package resulting in testing flags being exposed
in the main kustomize binary.
2019-07-10 17:16:05 -07:00
Kubernetes Prow Robot
9bff2e8883 Merge pull request #1330 from qiujian16/generate-ns-transformer
Generate updated ns transformer
2019-07-10 08:22:28 -07:00
Liu Lan
120ba6b870 docs/versioningPolicy.md: fix expired urls
Signed-off-by: Liu Lan <liulan@umcloud.com>
2019-07-10 11:41:54 +08:00
Jian Qiu
483188ba89 Generate updated ns transformer 2019-07-10 11:07:31 +08:00
Kubernetes Prow Robot
672bda0c9c Merge pull request #1328 from Liujingfang1/cmgenerator
fix the regression on merging configmap with different namespace
2019-07-09 14:22:24 -07:00
jingfangliu
49b32473ca fix the regression on merging configmap with different namespace 2019-07-09 13:39:19 -07:00
Kubernetes Prow Robot
08400d77a6 Merge pull request #1321 from qiujian16/webhook-ns-transform
Enable ns transformer for webhook
2019-07-09 10:08:03 -07:00
Jian Qiu
c912baeb3a Enable ns transformer for webhook
Add namespace transformer for ValidatingWebhookConfiguration
and MutatingWebhookConfiguration
2019-07-09 13:32:33 +08:00
Kubernetes Prow Robot
433733eb0e Merge pull request #1309 from richardmarshall/go_plugin_guide
Fix typo in the go plugin guide
2019-07-08 09:18:35 -07:00
Richard Marshall
f996ac82c7 Fix typo in the go plugin guide 2019-07-03 20:48:07 -07:00
Jeff Regan
efcb7cc5a5 Update README.md 2019-07-03 12:43:17 -07:00
Jeff Regan
bf7b57537b Merge pull request #1306 from monopole/updateV3Notes
Update v3 notes
2019-07-03 12:40:53 -07:00
Jeffrey Regan
6b597f8711 Update v3 notes 2019-07-03 12:40:30 -07:00
Jeff Regan
088739900f Merge pull request #1305 from monopole/tweakDocs
Update goPluginGuidedExample.md
2019-07-03 12:25:21 -07:00
Jeff Regan
3bf13f83d3 Update goPluginGuidedExample.md 2019-07-03 12:24:23 -07:00
Jeff Regan
c64a72f1f9 Update goPluginGuidedExample.md 2019-07-03 11:34:16 -07:00
Jeff Regan
8b60b456ac Update README.md 2019-07-03 11:22:27 -07:00
Jeff Regan
e0bac6ad19 Merge pull request #1302 from mmb/nginx-auth-tls-secret
Add support for nginx.ingress.kubernetes.io/auth-tls-secret
2019-07-03 11:01:14 -07:00
Kubernetes Prow Robot
d841d1bb36 Merge pull request #1270 from sunny0826/master
Chinese localization & fix fields.md
2019-07-03 09:00:35 -07:00
Matthew M. Boedicker
0d87cd6ba1 Add support for nginx.ingress.kubernetes.io/auth-tls-secret 2019-07-02 20:17:16 -07:00
郭旭东
28ad36b02c Merge remote-tracking branch 'upstream/master' 2019-07-03 09:38:44 +08:00
郭旭东
cad8a7bd3f fix zh/fields.md 2019-07-03 09:21:33 +08:00
Jeff Regan
60a990d660 Merge pull request #1297 from arrikto/feature-complex-overlay-composition
Add complex overlay composition test
2019-07-02 13:41:52 -07:00
Kubernetes Prow Robot
cb3751cea6 Merge pull request #1293 from monopole/fix1281
Fix 1281
2019-07-02 09:45:09 -07:00
Ioannis Androulidakis
5ad012e6d9 Add complex overlay composition test
Signed-off-by: Ioannis Androulidakis <ioannis@arrikto.com>
Signed-off-by: Alex Pyrgiotis <apyrgio@arrikto.com>
2019-07-02 19:26:04 +03:00
Jeffrey Regan
8a454de8f9 Fix 1281 2019-07-01 18:09:48 -07:00
Jeff Regan
57b18b7caa Merge pull request #1294 from monopole/repo1281
Add a test combining imagetag and jsonpatch
2019-07-01 18:05:47 -07:00
Jeffrey Regan
701d2c9597 Add a test combining imagetag and jsonpatch 2019-07-01 17:58:46 -07:00
Kubernetes Prow Robot
e7e844bc95 Merge pull request #1291 from monopole/addTest
Add another resmap test.
2019-07-01 11:55:22 -07:00
Jeffrey Regan
0fe95a2f74 Add another resmap test. 2019-07-01 11:17:46 -07:00
Jeff Regan
eb93d8c389 Merge pull request #1289 from monopole/moreTests
Add more json transformer examples.
2019-07-01 09:14:43 -07:00
jregan
8b373ab587 Add more json transformer examples. 2019-07-01 08:52:55 -07:00
Jeff Regan
c352003f3e Merge pull request #1290 from arrikto/feature-diamond-test-harden
Update the diamond composition test case
2019-07-01 08:34:23 -07:00
Alex Pyrgiotis
79d0de7000 Update the diamond composition test case
Refactor the existing base, so that one of the overlays patches an
already present field of the base resource. Previously, all overlays
added a new field in the base deployment, which made this case easier to
solve, with a merge of the produced YAMLs from each overlay.

Also, fix a typo in the comments.

Signed-off-by: Alex Pyrgiotis <apyrgio@arrikto.com>
Signed-off-by: Ioannis Androulidakis <ioannis@arrikto.com>
2019-07-01 14:57:59 +00:00
Jeff Regan
a32d5ce7ab Merge pull request #1288 from monopole/inlineJson
Push json transform code down to plugin.
2019-06-30 17:49:24 -07:00
jregan
5de0673db1 Push json transform code down to plugin. 2019-06-30 17:30:52 -07:00
Jeff Regan
c2b0b6f781 Merge pull request #1286 from monopole/anotherTest
Stacked patching example
2019-06-30 08:58:08 -07:00
jregan
116b37813a stackedOverlays 2019-06-30 08:45:37 -07:00
Jeff Regan
27f0d29734 Merge pull request #1287 from monopole/defineConstants
Define some constants in a test for later reuse.
2019-06-30 08:44:16 -07:00
jregan
f62af4ebf3 Define some constants in a test for later reuse. 2019-06-30 08:42:15 -07:00
Jeff Regan
faa6d0fd0a Merge pull request #1285 from monopole/v1App
Switch Deployment apiVersion to apps/v1 in a couple of tests.
2019-06-30 07:51:53 -07:00
jregan
0554da9d6e Switch to apps/v1 in various tests. 2019-06-30 07:45:29 -07:00
Jeff Regan
fa1fd9fbd7 Merge pull request #1283 from arrikto/feature-diamond-composition-test
Add diamond composition test with multiple patches
2019-06-30 06:56:56 -07:00
Jeff Regan
3dffc30e83 Merge pull request #1280 from sethpollack/generator_metadata
use ObjectMeta
2019-06-30 06:55:52 -07:00
Seth Pollack
2126b6cf23 use ObjectMeta instead of name and namespace fields 2019-06-29 23:30:50 -04:00
Ioannis Androulidakis
2b052fdd55 Add diamond composition test with multiple patches
The purpose of this commit is to demonstrate a composition use case,
that combines multiple overlays that patch the same base resource.

Signed-off-by: Ioannis Androulidakis <ioannis@arrikto.com>
Signed-off-by: Alex Pyrgiotis <apyrgio@arrikto.com>
2019-06-29 22:05:30 +03:00
Jeff Regan
58faa762cb Merge pull request #1275 from Liujingfang1/patches
add function to find all matched patch targets
2019-06-29 09:36:53 -07:00
jingfangliu
349cfff1cb add function to find all matched patch targets 2019-06-28 17:12:02 -07:00
Jeff Regan
558be8b923 Merge pull request #1284 from monopole/objectmeta
Add ObjectMeta type.
2019-06-28 14:56:45 -07:00
Jeffrey Regan
233b3613ae Add ObjectMeta type. 2019-06-28 14:39:56 -07:00
Jeff Regan
615a41d6be Merge pull request #1282 from monopole/repoBug1044
Repo bug 1044
2019-06-28 13:08:39 -07:00
Jeffrey Regan
0ceefcf39d Repo bug 1044 2019-06-28 11:29:48 -07:00
Jeff Regan
16ae64a722 Merge pull request #1279 from monopole/fix972
Fix JSON patch targetting issue.
2019-06-27 17:43:54 -07:00
Jeff Regan
3f239fb4a5 Update bugs.md 2019-06-27 17:40:34 -07:00
Jeffrey Regan
a60d99fdc9 Fix 972 2019-06-27 17:37:12 -07:00
Kubernetes Prow Robot
dd0334536b Merge pull request #1278 from monopole/addDiamondTest
Add diamond base test, improve patching error messages.
2019-06-27 16:53:21 -07:00
Jeffrey Regan
3cef37bdb2 Add diamond base test. 2019-06-27 16:10:58 -07:00
Jeff Regan
ac27e94dff Update README.md 2019-06-27 16:04:15 -07:00
Jeff Regan
0877aa7e0b Merge pull request #1277 from monopole/deleteGetById
Delete deprecated GetById
2019-06-27 15:28:34 -07:00
Jeffrey Regan
07e5a544fe Delete deprecated GetById 2019-06-27 15:26:03 -07:00
Kubernetes Prow Robot
60c04a5f33 Merge pull request #1271 from etiennecoutaud/support_azure_tfs_url
Add suport for _git in git  url
2019-06-27 11:51:22 -07:00
Jeff Regan
b9b9fb1dd2 Merge pull request #1274 from monopole/plainerPluginSecurityDiscussion
Plainer plugin security discussion.
2019-06-27 11:09:08 -07:00
Jeffrey Regan
e1233a0fbc Plainer plugin security discussion. 2019-06-27 11:08:26 -07:00
Etienne Coutaud
cc8203032c Add suport for _git in git url 2019-06-27 11:54:37 +02:00
郭旭东
7117961234 Chinese localization & fix fields.md 2019-06-27 16:52:00 +08:00
Jeff Regan
d410252cf8 Update goPluginCaveats.md 2019-06-26 16:56:46 -07:00
Jeff Regan
4235c57657 Update goPluginCaveats.md 2019-06-26 16:55:33 -07:00
Jeff Regan
e34c1ce192 Merge pull request #1263 from monopole/pluginsDocs
More plugin docs.
2019-06-26 16:38:53 -07:00
Jeffrey Regan
4d399ad89c More plugin docs. 2019-06-26 16:37:26 -07:00
Jeff Regan
9d6ab24388 Merge pull request #1260 from monopole/gomodtidy
A round of go mod tidy.
2019-06-26 13:27:20 -07:00
Jeffrey Regan
ee9f35d451 A round of go mod tidy. 2019-06-26 13:24:40 -07:00
Jeff Regan
45c11ec733 Update README.md 2019-06-26 13:22:22 -07:00
Jeff Regan
0519df4ad5 Merge pull request #1259 from monopole/releasing
Update notes for releasing.
2019-06-26 13:19:03 -07:00
Jeffrey Regan
55585d8da5 Update notes for releasing. 2019-06-26 13:10:41 -07:00
Jeff Regan
b8b49c3124 Merge pull request #1244 from Liujingfang1/patches
add type for extended patches
2019-06-26 11:21:22 -07:00
Jeff Regan
a41471d895 Merge pull request #1254 from monopole/nonnamespace
Fix some minor nits around namespace code.
2019-06-26 10:25:16 -07:00
Jeffrey Regan
877e9ecf64 Fix some minor nits around namespace code. 2019-06-26 10:02:22 -07:00
Kubernetes Prow Robot
150985bb9c Merge pull request #1200 from sunny0826/master
Chinese configGeneration.md dosc
2019-06-26 09:11:16 -07:00
jingfangliu
039f7669df add type for extended patches 2019-06-26 09:01:17 -07:00
Jeff Regan
6caa042b05 Merge pull request #1255 from monopole/fixNits
Fix some random Go nits.
2019-06-25 21:03:38 -07:00
jregan
cc0fffc67b Fix some random Go nits. 2019-06-25 20:46:56 -07:00
郭旭东
50d40ef941 fix zh/configGeneration.md 2019-06-26 09:57:46 +08:00
Jeff Regan
69d40bd740 Merge pull request #1221 from keleustes/mergens
ConfigMap Generators with identical name in different namespaces
2019-06-25 16:31:18 -07:00
Jerome Brette
4272611593 Change key used sort "not namespaceable objects.
- Use "%no_namespace% instead of "cluster-wide"
- Ensure will be no conflict with a kubernetes valid namespace name.
2019-06-25 17:04:55 -05:00
Jerome Brette
74f5e74b89 Consolidate IsClusterKind and IsNamespaceableKind method to avoid duplication 2019-06-25 13:46:49 -05:00
Jerome Brette
2bba0a6aa3 Support for ConfigMap generator with identical names in different namespaces.
- Attempt to account, at build time, for subsequent kubectl apply behavior.
  (empty or no namespace means default).
- Account for the fact that not all objects have a namespace.
- Add new Equal method to ResId address merge name conflict
- Add GroupByName to resources by namespaces to resolve filenames conflict
- Added corresponding unit tests.
- Change the fail test for issue #1155
2019-06-25 13:39:32 -05:00
Jeff Regan
762d3143eb Merge pull request #1242 from taxpon/add-patch-remover
Add patch remover
2019-06-25 09:51:44 -07:00
Jeff Regan
7f22e25dfe Merge pull request #1239 from sethpollack/fix_plugins
allow reuse of plugins
2019-06-25 09:10:05 -07:00
Kubernetes Prow Robot
41c162a65f Merge pull request #1204 from zeusro/master
Chinese translation:jsonpatch.md
2019-06-25 09:02:40 -07:00
Zeusro
ca521946a5 add missing text 2019-06-25 16:50:27 +08:00
Zeusro
b0e53d2b39 Chinese translation:jsonpatch.md 2019-06-25 16:49:41 +08:00
Takuro Wada
5c93722db8 Update pkg structure to avoid circular import 2019-06-25 11:46:01 +09:00
Takuro Wada
d34c82c905 move globPatterns to edit pkg and make it public 2019-06-25 11:21:29 +09: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
Seth Pollack
9cc2c90a4b allow reuse of plugins 2019-06-24 21:09:13 -04:00
Jeff Regan
bc31fa9120 Merge pull request #1247 from monopole/updateReleaseNotes
Update versioning policy.
2019-06-24 17:27:44 -07:00
Jeffrey Regan
7a67645558 Update versioning policy. 2019-06-24 17:26:42 -07:00
Jeff Regan
b0f59358d9 Update v3.0.0.md 2019-06-24 16:17:36 -07:00
Jeff Regan
0e6c7d8af7 Update v3.0.0.md 2019-06-24 16:15:54 -07:00
Jeff Regan
9c20085ca9 Update goPluginGuidedExample.md 2019-06-24 15:27:14 -07:00
Jeff Regan
d48a52055a Update goPluginGuidedExample.md 2019-06-24 15:25:03 -07:00
Jeff Regan
dc433e12fb Merge pull request #1246 from monopole/pluginDocGetsOwnDir
Add another detailed plugin example.
2019-06-24 15:21:04 -07:00
Jeffrey Regan
1740ca6a16 Add another detailed plugin example. 2019-06-24 15:19:49 -07:00
Takuro Wada
2ae8ca1d63 Fix help message to align other cmd 2019-06-24 21:28:44 +09:00
Takuro Wada
674cd89ac9 Add patch remover 2019-06-24 21:25:01 +09:00
Takuro Wada
6ed70add4a Add Delete function to patch pkg 2019-06-24 21:14:26 +09:00
Jeff Regan
ae5ebccec7 Merge pull request #1241 from monopole/hackPluginTesting
Hack for local testing of isolated plugins.
2019-06-23 18:05:23 -07:00
jregan
19c8e23425 Hack for local testing of isolated plugins. 2019-06-23 18:04:20 -07:00
Jeff Regan
b878cd050d Merge pull request #1240 from monopole/v3
Starting v3 release for plugin developers.
2019-06-23 15:18:18 -07: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
Jeff Regan
3127f1adc6 Merge pull request #1238 from monopole/removeSopsEncodedSecretsPlugin
Remove SopsEncodedSecretsPlugin
2019-06-23 10:02:15 -07:00
jregan
a722cca80a Remove SopsEncodedSecretsPlugin 2019-06-23 09:46:45 -07:00
Jeff Regan
0ffd78eab6 Merge pull request #1224 from keleustes/varset
Change the backing data structure of VarSet from slice to map
2019-06-23 09:03:48 -07:00
Jeff Regan
694c868048 Merge pull request #1231 from arnodel/fix-1228
Iterate over fieldspecs for name tranformations (fixes #1228)
2019-06-23 09:02:54 -07:00
Jeff Regan
2da2006e2a Merge pull request #1237 from taxpon/add-metadata-remover
Add metadata remover
2019-06-23 08:56:03 -07:00
Jeff Regan
0bc83ca065 Merge pull request #1227 from leoxiongdev/patch-1
Fix typo
2019-06-23 08:36:08 -07:00
Takuro Wada
ab2643ef14 Fix FakeValidator 2019-06-23 19:59:01 +09:00
Takuro Wada
297812ec11 Fix lint 2019-06-23 19:43:49 +09:00
Takuro Wada
158f754f18 Add remove annotation command 2019-06-23 18:43:52 +09:00
Takuro Wada
da3504105e Add remove label command 2019-06-23 18:43:52 +09:00
Arnaud Delobelle
d3f50695b4 Fix configmap name in test 2019-06-22 08:46:22 +01:00
Arnaud Delobelle
5a9a6ab0f6 Fix typo in test 2019-06-22 08:27:23 +01:00
Arnaud Delobelle
b86e78b7a9 Add test for regression 2019-06-22 08:09:39 +01:00
Ian Howell
b1cdf581d0 Change the backing data structure of VarSet from slice to map
This will speed up most operations performed on a large set of Vars
2019-06-21 17:28:57 -05:00
Jeff Regan
8bf20527be Merge pull request #1232 from monopole/moreVarTestCoverage
More var test coverage.
2019-06-21 14:14:53 -07:00
Jeffrey Regan
3eedc40595 More var test coverage. 2019-06-21 13:53:58 -07:00
Arnaud Delobelle
93db0ef3e9 Iterate over fieldspecs for name tranformations 2019-06-21 21:08:59 +01:00
Jeff Regan
6922dbbc70 Merge pull request #1225 from keleustes/fix/compiler
Fixed unit test failures when GOROOT was unset
2019-06-21 09:52:39 -07:00
Jeff Regan
f1b9b27a15 Merge pull request #1220 from keleustes/downwardapi
FieldPath syntax backward compatibility
2019-06-21 09:36:52 -07:00
Leo Xiong
a755558beb Fix typo 2019-06-21 12:29:31 +12:00
Ian Howell
b8423d0f5f Fixed unit test failures when GOROOT was unset 2019-06-20 16:37:20 -05:00
Jeff Regan
42ef4fbcc1 Merge pull request #1222 from monopole/linuxIn30
Another plugin demo.
2019-06-20 11:47:34 -07:00
Jeffrey Regan
69c11780eb Another plugin demo. 2019-06-20 11:45:26 -07:00
Jerome Brette
c925b43090 FieldSpec Backward Compatibility with K8s Downward API 2019-06-20 09:22:47 -05:00
Kubernetes Prow Robot
a5b97cbd9b Merge pull request #1214 from monopole/sops
A secret generator using sops.
2019-06-19 19:50:48 -07:00
Jeffrey Regan
bcb844663f A secret generator using sops. 2019-06-19 18:55:50 -07:00
Jeff Regan
0905ee293c Merge pull request #1213 from monopole/commitGenerated
Commit generated code for image and namespace transformers.
2019-06-19 18:53:02 -07:00
Jeffrey Regan
3325852aab Commit generated code for image and namespace transformers. 2019-06-19 18:52:24 -07:00
Jeff Regan
c437d99c5f Merge pull request #1210 from monopole/pushTagTransformCodeToPlugin
Push image tag transform code to plugin.
2019-06-19 18:26:31 -07:00
Jeff Regan
cacafc63e8 Merge pull request #1211 from monopole/pushNamespaceTransformerCodeToPlugin
Push namespace transformer code to plugin.
2019-06-19 18:26:05 -07:00
Jeff Regan
b08f3383b8 Merge pull request #1206 from jbrette/namespace
Addresses issue discovered in attempting to patch K8s objects across different namespaces.
2019-06-19 13:07:50 -07:00
Jeffrey Regan
2eccf67b1c Push namespace transformer code to plugin. 2019-06-19 12:57:02 -07:00
Kubernetes Prow Robot
293c8bef54 Merge pull request #1202 from mamoit/patch-1
Typo correction in 2.1.0 release notes
2019-06-19 12:38:19 -07:00
Kubernetes Prow Robot
00c7ae0542 Merge pull request #1199 from ramnar/master
Corrected spelling mistake
2019-06-19 12:36:21 -07:00
Jeffrey Regan
cd656faadf Push image tag transform code to plugin. 2019-06-19 12:24:00 -07:00
Kubernetes Prow Robot
056b95ffa9 Merge pull request #1201 from yujunz/fix-typo
Fix typo in docs
2019-06-19 11:28:34 -07:00
Kubernetes Prow Robot
d211df1e73 Merge pull request #1205 from pyaillet/fix-typo
Fix typo in comment
2019-06-19 08:56:36 -07:00
Jerome Brette
934e036b99 Attempting to patch K8s objects across different namespaces.
- Return an error when findTarget fails.
- Add unit test testing the change.
2019-06-19 08:42:12 -05:00
Zeusro
9fc86f92fa Chinese translation:jsonpatch.md 2019-06-19 21:16:40 +08:00
Pierre-Yves Aillet
49c6bd4141 Fix typo in comment 2019-06-19 14:53:29 +02:00
Miguel Almeida
24011cf2a5 Simple flag typo correction
The flag is load_restrictor and not load_restrictions.
2019-06-19 11:35:33 +01:00
郭旭东
83b284dfde fix configGeneration.md 2019-06-19 17:21:07 +08:00
Yujun Zhang
7c9181317f Fix typo in docs 2019-06-19 15:09:31 +08:00
郭旭东
01b410fe9c Chinese configGeneration.md dosc 2019-06-19 14:36:21 +08:00
ramnar
56ac98468d Corrected spelling mistake
Corrected spelling mistake
2019-06-19 08:22:55 +05:30
Jeff Regan
658ebeaa21 Merge pull request #1197 from keleustes/showcasevariables
Demonstrate new capabilities in pkg/target testing
2019-06-18 19:22:27 -07:00
Jeff Regan
59aa898533 Merge pull request #1198 from sunny0826/master
update docs/zh/README.md
2019-06-18 19:21:37 -07:00
Jeff Regan
c88f87cee2 Merge pull request #1196 from keleustes/helperimprovment
Improve robutness of helper code
2019-06-18 18:59:15 -07:00
郭旭东
cc663bb08c update docs/zh/README.md 2019-06-19 09:26:44 +08:00
Jeff Regan
63d647df18 Update secretGeneratorPlugin.md 2019-06-18 16:50:48 -07:00
Jerome Brette
e3a46cb6ce Leverage new variables during testing
Extract the HTTP port (int) from the container section end
use it in the service definition.

Also enable variable replacement for Service object.
2019-06-18 18:37:20 -05:00
Jerome Brette
4556eb3a0c Improve robutness of helper code
As per request, changed usage of pointer to int into plain int.
Use -1 value where nil use to be used.
2019-06-18 18:06:38 -05:00
Jeff Regan
26ed9b7c58 Fix date of release v2.1.0 2019-06-18 15:30:37 -07:00
Jeff Regan
8ff0b5423d Update v2.1.0.md 2019-06-18 15:27:27 -07:00
Jeff Regan
0fbced95a8 Merge pull request #1195 from monopole/updateReleaseLinks
Update release note links.
2019-06-18 15:25:09 -07:00
Jeffrey Regan
66b816aabc Update release note links. 2019-06-18 15:24:10 -07:00
Jeff Regan
af67c893d8 Merge pull request #1194 from monopole/moveKustomizeToCmd
Move kustomize main to cmd directory.
2019-06-18 14:40:09 -07:00
Jeff Regan
71f44d646f Update v_2.1.0.md 2019-06-18 14:39:46 -07:00
Jeff Regan
9edecffcc8 Update v_2.1.0.md 2019-06-18 14:25:47 -07:00
Jeffrey Regan
d2c93065d5 Move kustomize main to cmd directory. 2019-06-18 14:17:51 -07:00
Jeff Regan
7dd02c1766 Merge pull request #1111 from keleustes/master
Improvment var and varRefs handling
2019-06-18 14:17:27 -07:00
Jeff Regan
93a97950e7 Merge pull request #1193 from monopole/moarMods
More release note tweaks.
2019-06-18 13:34:34 -07:00
Jeffrey Regan
f17698a8ea More release note tweaks. 2019-06-18 13:33:56 -07:00
Kubernetes Prow Robot
2cb9f81bab Merge pull request #1189 from monopole/deprecateBasesField
Deprecate 'bases:' field.
2019-06-18 13:23:51 -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
cc531af665 Deprecate 'bases:' field. 2019-06-18 10:36:58 -07:00
Jeff Regan
0dbe78149d Merge pull request #1192 from monopole/movePluginator
Move pluginator main.go from plugin to cmd directory.
2019-06-18 10:36:25 -07:00
Jeffrey Regan
4bc31f4b2a Move pluginator to cmd directory. 2019-06-18 10:16:46 -07:00
Jeff Regan
a5253adb9c Merge pull request #1187 from rvodden/master
Added test to verify usage of multiline strip chomp in configMapGener…
2019-06-18 09:54:47 -07:00
Jeff Regan
ae3700a193 Merge pull request #1191 from monopole/homebrewUpdate
Tell homebrew to update.
2019-06-18 09:53:15 -07:00
Jeffrey Regan
a56604154d Tell homebrew to update. 2019-06-18 09:39:40 -07:00
Richard Vodden
000f81b21c Added test to verify usage of multiline strip chomp in configMapGenerator 2019-06-18 17:19:11 +01:00
Jeff Regan
a9583fc6ec Merge pull request #1188 from monopole/fixTest
Fix test broken by the change in ordering.
2019-06-18 07:49:26 -07:00
Jeffrey Regan
57eecd7497 Fix test broken by the change in ordering. 2019-06-18 07:30:29 -07:00
Jeff Regan
6803cc4788 Merge pull request #1186 from monopole/moveWindowsPrecommit
Put windows test script next to pre-commit.sh
2019-06-17 16:30:11 -07:00
Jeffrey Regan
2796e54540 Put windows test script next to pre-commit.sh 2019-06-17 16:29:40 -07:00
Jeff Regan
06c23b7742 Merge pull request #852 from kenmaglio/windows-precommit
Windows Tests - Precommit Script
2019-06-17 16:26:28 -07:00
Jeff Regan
7ce6181bce Merge pull request #610 from twz123/transformer-no-create-arrays
Proposal: Make transformer configs array-aware
2019-06-17 16:22:09 -07:00
Jeff Regan
ec31bcbe62 Merge pull request #1185 from monopole/unsort
Expected raw kustomize ordering in tests.
2019-06-17 16:15:28 -07:00
Jeffrey Regan
0b555e1b2c Modify tests to present expected data in unsorted order.
Modify all `build` tests to use the raw,
non-sorted output of build.  This makes every test
provide coverage for how kustomize re-orders (or
doesn't reorder) resources during processing.

Going forward, the ordering of resources in
_expected_ output should match the depth-first
ordering specified in the `resources:` field used
in the test's kustomization file.

The only exception to this rule would be tests
that actually confirmed some other output
ordering, e.g. the test of the
`LegacyOrderTransformer` plugin.

Fixes #756
Related #821
2019-06-17 16:02:23 -07:00
Jeff Regan
ed21e77fb1 Merge pull request #1181 from damienr74/fix-replica-transformer
Make the replica transformer `kind` aware.
2019-06-17 12:37:39 -07:00
Damien Robichaud
3f8b1fe05b Make the replica transformer kind aware.
The previous implementation had a bug and poorly handled
types that should not have a `spec: replica:` field.

Documentation is updated to reflect the change in behavior,
and better highlights the cases where a patch should be
used instead of this shorthand.
2019-06-17 11:41:43 -07:00
Damien Robichaud
8d4b6452d4 Make the replica transformer kind aware.
The previous implementation had a bug and poorly handled
types that should not have a `spec: replica:` field.

Documentation is updated to reflect the change in behavior,
and better highlights the cases where a patch should be
used instead of this shorthand.
2019-06-17 11:33:31 -07:00
Jeff Regan
05e3dead7b Merge pull request #1183 from monopole/maintainOrder
Simplify code base.
2019-06-17 10:59:44 -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
Jeff Regan
624aa5290e Merge pull request #1180 from monopole/justTheTestRefactor
Move the rmBuilder test helper to a test package.
2019-06-13 16:23:49 -07:00
Jeffrey Regan
8d9897d5a5 Add the rmBuilder test helper. 2019-06-13 16:15:43 -07:00
Jeff Regan
16a9975e84 Merge pull request #1175 from monopole/errorIfNotEqualLists
Add some utilities.
2019-06-12 20:51:01 -07:00
jregan
755dd3d024 Add some utilities. 2019-06-12 20:43:39 -07:00
Jeff Regan
ba49fd4c18 Merge pull request #1178 from monopole/goLinterUpdate
Update golinter to 1.17.1
2019-06-12 20:40:41 -07:00
jregan
08b6f6f4e4 Update golinter to 1.17.1 2019-06-12 20:33:07 -07:00
Jeff Regan
3128b25236 Merge pull request #1174 from monopole/addOriginalNameToResource
Add originalName field to resource.
2019-06-12 16:43:28 -07:00
Jeffrey Regan
5e054c9d31 Add originalName field to resource. 2019-06-12 16:30:03 -07:00
Jeff Regan
4bb4a85037 Merge pull request #1149 from qiujian16/var-reference
Keep var refernce in resources
2019-06-12 09:50:06 -07:00
Jeff Regan
b24d813f0f Merge pull request #1173 from monopole/prefixSuffixPlugin
Push suffix/prefix code to plugin.
2019-06-11 20:46:28 -07:00
Jian Qiu
7e12918f75 Keep var refernce in resources 2019-06-12 10:51:19 +08:00
jregan
11bb176a3f Push suffix/prefix code to plugin. 2019-06-11 19:37:06 -07:00
Jeff Regan
fcc3082231 Merge pull request #1172 from monopole/renamePrefixSuffixTransformer
Rename the prefix/suffix transformer.
2019-06-11 17:57:15 -07:00
jregan
49d94f5318 Rename the prefix/suffix transformer. 2019-06-11 17:47:23 -07:00
Kubernetes Prow Robot
fa23026b80 Merge pull request #1171 from monopole/addReorderFlag
Add --reorder flag.
2019-06-11 13:26:19 -07:00
Jeffrey Regan
0fa2d9c32c Add --reorder flag. 2019-06-11 12:52:53 -07:00
Kubernetes Prow Robot
15a77fd2bb Merge pull request #1169 from monopole/improveNameTransformComments
Improve performance in name transform code.
2019-06-10 17:10:15 -07:00
Jeffrey Regan
9c36ac28fa Improve comments in name transform code. 2019-06-10 16:58:16 -07:00
Kubernetes Prow Robot
e1e622d985 Merge pull request #1165 from monopole/hoser
Add test for ordered transformers.
2019-06-07 18:09:06 -07:00
Jeff Regan
3e86ebc3cf Merge pull request #1166 from monopole/cover1155WithTest
Cover #1155 with a test.
2019-06-07 16:28:42 -07:00
Jeffrey Regan
6d309b52a5 Introduce stacked transformers. 2019-06-07 16:16:58 -07:00
Jeffrey Regan
52faa01ecf Cover #1155 with a test. 2019-06-07 16:11:54 -07:00
Kubernetes Prow Robot
a79c888e0c Merge pull request #1163 from monopole/sortingPlugin
Add a sorting plugin, as an example.
2019-06-07 15:42:00 -07:00
Jeffrey Regan
449175e3a6 Add a sorting plugin. 2019-06-07 15:06:12 -07:00
Jeff Regan
2fce1a6d25 Merge pull request #1162 from monopole/addMergeMethodToVarSet
Add Merge (one Var) method to VarSet
2019-06-07 13:55:34 -07:00
Jeffrey Regan
798b61c8ef Add copy method to VarSet 2019-06-07 13:22:07 -07:00
Kubernetes Prow Robot
84efd367d2 Merge pull request #1161 from monopole/addCopyToVarSet
Add copy method to VarSet
2019-06-07 13:13:59 -07:00
Jeffrey Regan
d9b0c4c84c Add copy method to VarSet 2019-06-07 13:01:34 -07:00
Kubernetes Prow Robot
c9300edead Merge pull request #1160 from matti/patch-1
Update inventory_object.md
2019-06-07 07:36:04 -07:00
Matti Paksula
4502e8fffb Update inventory_object.md 2019-06-07 17:00:43 +03:00
Jeff Regan
51d82bece3 Merge pull request #1159 from monopole/minorRenames
Rename ErrorIfNotEqual to ErrorIfNotEqualSets
2019-06-06 20:29:52 -07:00
jregan
0e4f9acb6e Rename ErrorIfNotEqual to ErrorIfNotEqualSets 2019-06-06 20:20:48 -07:00
Jeff Regan
aa2d8b20cd Merge pull request #1158 from monopole/hoohah
Preserve order when merging.
2019-06-06 20:14:54 -07:00
Jeffrey Regan
c63ebbdfc4 Preserve order when merging. 2019-06-06 20:01:39 -07:00
Kubernetes Prow Robot
c094780aae Merge pull request #1154 from monopole/maintainResourcesInLoadOrder
Maintain resources in a list.
2019-06-06 16:19:59 -07:00
Jeffrey Regan
4162dbc2d8 Maintain resources in order loaded. 2019-06-06 15:55:57 -07:00
Jingfang Liu
c250f75d1d enable go module in the integration test (#1153) 2019-06-06 09:35:25 -07:00
Kubernetes Prow Robot
af57fc3ece Merge pull request #1152 from Liujingfang1/patchfix
fix the bug for patching CRDs
2019-06-04 11:53:54 -07:00
Kubernetes Prow Robot
985abd1456 Merge pull request #1148 from Liujingfang1/examples
update examples/README.md
2019-06-04 11:27:54 -07:00
jingfangliu
0375137296 fix the bug for patching CRDs 2019-06-04 10:20:24 -07:00
jingfangliu
e4956c5500 update examples/README.md 2019-06-03 16:09:18 -07:00
Jeff Regan
53377cdddc Merge pull request #1145 from monopole/invTransformerPlugin
Convert inventory transformer to plugin, reduce k8sdeps.
2019-06-02 11:01:05 -07:00
Jeffrey Regan
81c98c855f Convert inventory transformer to plugin, reduce k8sdeps. 2019-06-02 10:49:01 -07:00
Jeff Regan
115a0bc560 Merge pull request #1144 from monopole/invField
Add entry for inventory in fields.md
2019-05-31 13:56:46 -07:00
Jeffrey Regan
2744e058b6 Add entry for inventory in fields.md 2019-05-31 13:55:23 -07:00
Jeff Regan
b6139f74de Merge pull request #1139 from damienr74/implement-replica-transform
Implement replica transformer as patch alternative
2019-05-31 13:43:59 -07:00
Damien Robichaud
d925939795 Add documentation for the replicas transform 2019-05-31 13:29:04 -07:00
Damien Robichaud
d4842ebd90 Cleanup the replica plugin implementation. 2019-05-31 13:28:51 -07:00
Damien Robichaud
5000a2e503 Implement replica transformer as patch alternative 2019-05-31 13:10:34 -07:00
Jeff Regan
109988d105 Merge pull request #797 from cartyc/update-docs
Translated kustomization.yaml into markdown in fields.md.
2019-05-31 12:17:30 -07:00
Chris Carty
b07bea40f7 added field tables 2019-05-31 12:14:58 -07:00
Chris Carty
e287f615f4 readded kustomization.yaml 2019-05-31 11:11:34 -07:00
Chris Carty
d2103dbf39 updated grouping and added brief descriptions of sections 2019-05-31 11:11:01 -07:00
Chris Carty
7a54d998d4 added links to section headings 2019-05-31 11:11:01 -07:00
Chris Carty
3168b2a1ed added link to examples 2019-05-31 11:09:54 -07:00
Chris Carty
e0d2fa5701 Translated kustomization.yaml into markdown in fields.md. Updated links to point to fields.md 2019-05-31 11:09:54 -07:00
Kubernetes Prow Robot
4b4c799129 Merge pull request #1143 from Liujingfang1/plugindoc
update validation transformer example text
2019-05-31 10:42:30 -07:00
jingfangliu
b2c8752211 update validation transformer example text 2019-05-31 09:58:48 -07:00
Kubernetes Prow Robot
4e9436eb80 Merge pull request #1116 from Liujingfang1/plugindoc
add example for transformer plugin
2019-05-31 09:32:30 -07:00
Ken Maglio
8c133ef048 Removes mdrip testing for Windows 2019-05-30 23:30:19 -05:00
jingfangliu
142879ec30 add example for transformer plugin 2019-05-30 17:08:12 -07:00
Kubernetes Prow Robot
c4f79eff51 Merge pull request #1141 from monopole/releaseNotes
Update 2.1 release notes.
2019-05-30 17:02:23 -07:00
jregan
1dd448e65c Update 2.1 release notes before release. 2019-05-30 15:33:30 -07:00
Jeff Regan
ab3fed06c7 Merge pull request #1112 from Liujingfang1/validator
add validation transformer
2019-05-30 13:38:18 -07:00
Jingfang Liu
b4dbac1b84 add validation transformer 2019-05-30 10:10:16 -07:00
Jeffrey Regan
e1b59c93de 2.1 release notes 2019-05-29 16:58:34 -07:00
Kubernetes Prow Robot
0adfd2751e Merge pull request #1137 from monopole/hashTransformerOutOfk8sdeps
Move hashing transformer out of k8sdeps.
2019-05-29 14:08:20 -07:00
Jeffrey Regan
fd2248e7c2 Move hashing transformer out of k8sdeps. 2019-05-29 13:51:41 -07:00
Jeff Regan
dd75392d98 Merge pull request #1136 from monopole/updateReleaseForGoModules
Use go modules in cloud builder.
2019-05-29 11:31:33 -07:00
Jeffrey Regan
af2b101fe2 Use go modules in cloud builder. 2019-05-29 11:21:40 -07:00
Kubernetes Prow Robot
62cef3de98 Merge pull request #1117 from sunny0826/master
chinese helloworld doc
2019-05-29 10:52:27 -07:00
Tom Wieczorek
03e518f0ea Merge branch 'master' into transformer-no-create-arrays 2019-05-29 12:18:59 +02:00
郭旭东
7765bdd967 fix some doc 2019-05-29 15:22:41 +08:00
郭旭东
cd19d4262b Merge remote-tracking branch 'upstream/master' 2019-05-29 14:08:40 +08:00
Jeff Regan
4812ddff9f Merge pull request #1134 from monopole/renameBinToTravis
Rename ./bin dir to ./travis.
2019-05-28 22:05:26 -07:00
Jeff Regan
df52b51f67 Merge pull request #1133 from monopole/hasher
Move basic hashing code out of k8sdeps.
2019-05-28 21:57:43 -07:00
jregan
a2e4f6cf68 Rename ./bin dir to ./travis. 2019-05-28 21:56:59 -07:00
jregan
ee728d58f5 Move hashing code out of k8sdeps. 2019-05-28 21:46:46 -07:00
Jeff Regan
6be6ade6d7 Merge pull request #1131 from monopole/updateMinecraft
Update minecraft version in example.
2019-05-28 18:40:13 -07:00
Jeff Regan
d4305ab9da Merge pull request #1130 from monopole/envToEnvs
Fix yaml in generator examples.
2019-05-28 18:34:14 -07:00
Jeffrey Regan
ca478016c9 Update minecraft version in example. 2019-05-28 18:32:23 -07:00
Jeffrey Regan
a7a2589e81 Fix yaml in generator examples. 2019-05-28 18:21:07 -07:00
Jeff Regan
02e4f7305d Merge pull request #1120 from wlezzar/fix-commonLabels-spec
Fix commonLabels spec for volumeClaimTemplates
2019-05-28 17:53:18 -07:00
Jeff Regan
f777ba8aa9 Merge pull request #1129 from monopole/idiomFixes
Idiom fixes.
2019-05-28 17:48:55 -07:00
Jeff Regan
7e9eaf41c9 Merge pull request #1128 from monopole/localBuild
Add script to run cloud build 'locally'.
2019-05-28 17:26:22 -07:00
Jeff Regan
bb9b3163ee Add script to run cloud build 'locally'. 2019-05-28 17:09:06 -07:00
wlezzar
e6d1de0d72 fix commonLabels spec for volumeClaimTemplates 2019-05-28 22:27:28 +02:00
Jeff Regan
e2a660c787 Merge pull request #1123 from qiujian16/webhook-reference
Add Webhookconfiguration in default name references
2019-05-28 09:53:17 -07:00
Tom Wieczorek
c9a5c03eaa Convert legacy file based test to in-memory 2019-05-28 11:27:21 +02:00
Tom Wieczorek
c2eda0a172 Merge branch 'master' into transformer-no-create-arrays 2019-05-28 11:27:04 +02:00
Tom Wieczorek
c470982ce5 Make transformer configs array-aware
If path segments end with the special marker `[]` in transformer configs, this
indicates that the respective path segment is supposed to be an array. That
information may be used to suppress the meaningless creation of non-existent
paths that should be arrays, not objects.
2019-05-28 11:26:33 +02:00
Jian Qiu
68f6b0be6e Add Webhookconfiguration in default name references 2019-05-28 14:02:32 +08:00
jregan
02f379536c Idiom fixes.
- func/struct names prefixed with package name
- public funcs/structs that should be private
2019-05-27 17:54:44 -07:00
Jeff Regan
e239d5f909 Merge pull request #1121 from monopole/lessK8sdeps
Move 400loc from k8sdeps to loader
2019-05-27 15:56:27 -07:00
jregan
47c965481f Reduce k8ds deps 2019-05-27 15:37:03 -07:00
Jeff Regan
3af0f9776f Merge pull request #1118 from monopole/deleteKvPluginCode
Delete the KV plugin code.
2019-05-25 19:29:55 -07:00
Jeff Regan
c116a28e67 Merge pull request #1109 from nzoueidi/907
Add support for escaping characters in Doc
2019-05-24 18:55:20 -07:00
Jeffrey Regan
6a10654618 Delete the KV plugin code. 2019-05-24 16:49:16 -07:00
Kubernetes Prow Robot
a42b0bd574 Merge pull request #1115 from Liujingfang1/examples
reorganize the examples layout
2019-05-24 10:47:28 -07:00
郭旭东
404884e295 chinese helloworld doc 2019-05-24 13:31:11 +08:00
Jingfang Liu
e17d303392 reorganize the examples layout 2019-05-23 13:50:30 -07:00
Jeff Regan
e4205c125c Merge pull request #1104 from mgoltzsche/master
Order ValidatingWebhookConfig last.
2019-05-23 09:43:22 -07:00
Kubernetes Prow Robot
fdee15e523 Merge pull request #1093 from sunny0826/master
translate example list
2019-05-23 07:28:30 -07:00
Naeil ZOUEIDI
c9d903cc36 Add support for escaping characters in Doc 2019-05-23 04:56:03 -04:00
Jeff Regan
e5a0a12ffd Merge pull request #1105 from monopole/updatePluginDocs
Rewrite plugin docs.
2019-05-22 21:27:10 -07:00
jregan
78cdff6d09 Remove kv plugins from docs. 2019-05-22 21:13:45 -07:00
郭旭东
a64baed428 fix link 2019-05-23 09:38:16 +08:00
Kubernetes Prow Robot
d8f3bffe63 Merge pull request #1103 from monopole/testAllThePlugins
Test all the plugins.
2019-05-22 16:38:24 -07:00
Max Goltzsche
a09b42b364 Order ValidatingWebhookConfig last.
Fixes the cert-manager example of #821.
2019-05-23 00:48:01 +02:00
jregan
fe67bcdb8b Cut more ties to k8sdeps
Add tests for all the plugins.
2019-05-22 14:17:36 -07:00
Jeff Regan
7dc1eae40f Merge pull request #1102 from monopole/refactorFactory
bye bye baseFactory
2019-05-22 14:10:44 -07:00
jregan
e13896496e Cut more ties to k8sdeps 2019-05-22 14:03:30 -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
Jeff Regan
fb872be04a Merge pull request #1099 from qiujian16/add-storageclass-nameref
Add name reference of storageClass
2019-05-22 07:34:59 -07:00
Jian Qiu
8f413f523c Add name reference of storageClass 2019-05-22 14:43:15 +08:00
郭旭东
89243aed37 add zh dir 2019-05-22 09:40:41 +08:00
Kubernetes Prow Robot
f212deab4d Merge pull request #1097 from monopole/namespaceTransformer
Add builtin namespace transformer plugin
2019-05-21 15:56:05 -07:00
Jeffrey Regan
79906d73d0 Add builtin namespace transformer plugin 2019-05-21 13:56:36 -07:00
Jeff Regan
d4e3cd31a4 Merge pull request #1096 from monopole/kusttargetCleanup
Cleanup kusttarget.
2019-05-21 11:41:40 -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
Jeff Regan
5f93266e2c Merge pull request #1095 from monopole/formatGeneratedCode
Format generated code.
2019-05-21 11:37:38 -07:00
Jeffrey Regan
9b6f8f0c74 Format generated code. 2019-05-21 11:35:41 -07:00
jregan
a352ff3923 True and false are mysterious. 2019-05-21 10:58:43 -07:00
Kubernetes Prow Robot
812ae77257 Merge pull request #1091 from qiujian16/fix-1017
Allow nil label and annotaion
2019-05-21 09:02:52 -07:00
郭旭东
b4efc833c7 translate example list 2019-05-21 15:26:49 +08: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
Jeff Regan
72f565d55d Merge pull request #1089 from monopole/tinyFixNits
Fix some nits.
2019-05-20 20:17:29 -07: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
Kubernetes Prow Robot
897d434673 Merge pull request #1088 from monopole/jsonPatchTransformer
Add builtin JSON patch transformer
2019-05-20 16:18:39 -07:00
Jeffrey Regan
0df5883853 Add builtin JSON patch transformer 2019-05-20 15:38:46 -07:00
Kubernetes Prow Robot
84c5e44345 Merge pull request #1087 from monopole/addAnnotationTransformer
Add builtin annotation transformer.
2019-05-20 09:27:16 -07:00
jregan
aafc23a615 Add annotation transformer. 2019-05-19 19:04:29 -07:00
Jeff Regan
49bd56d012 Merge pull request #1086 from monopole/addLabelTransformer
Add builtin label transformer plugin.
2019-05-19 18:30:10 -07:00
jregan
45901219b7 Add builtin label transformer. 2019-05-19 18:20:18 -07:00
Jeff Regan
6ba6f305cc Merge pull request #1085 from monopole/onePluginPerDir
One plugin per dir.
2019-05-19 17:52:01 -07:00
jregan
5653ae69e4 One plugin per dir. 2019-05-19 17:32:02 -07:00
Jeff Regan
31534fe47d Merge pull request #1084 from monopole/simplifyPluginTesting
Simplifications to the plugin test code.
2019-05-18 12:02:15 -07:00
Jeffrey Regan
3a85fcd365 Simplify some of the plugin testing code. 2019-05-17 16:13:55 -07:00
Kubernetes Prow Robot
f9c631e9ee Merge pull request #1079 from monopole/nameTransformer
Add builtin NameTransformer plugin.
2019-05-16 13:32:29 -07:00
Jeffrey Regan
621bb7c6c5 Add builtin NameTransformer plugin. 2019-05-16 12:34:08 -07:00
Kubernetes Prow Robot
9590eaf342 Merge pull request #1075 from monopole/pluginDogfooding
Dogfood the plugin framework.
2019-05-16 11:26:30 -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
Jeff Regan
c8be17c91f Merge pull request #1077 from monopole/minecraftUpgrade
Upgrade version of minecraft used in tests.
2019-05-16 10:07:01 -07:00
Kubernetes Prow Robot
c6476d16e7 Upgrade version of minecraft used in tests. 2019-05-16 10:06:24 -07:00
Kubernetes Prow Robot
14668f794d Merge pull request #1074 from Benjamintf1/patch-1
Update order of resources to include psps
2019-05-15 11:58:21 -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
Kubernetes Prow Robot
ac9f2ded6e Merge pull request #1073 from kbhawkey/fix-empty-yaml-read
add test for empty patch file
2019-05-14 10:29:15 -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
Jeff Regan
858c7493df Merge pull request #1070 from monopole/deleteUnused
Delete some code.
2019-05-13 12:42:59 -07:00
Jeff Regan
8b433b0ff9 Merge pull request #1072 from monopole/standaloneServiceGenTest
Standalone service generator test
2019-05-13 12:33:08 -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
Jingfang Liu
7fa02ce5b3 add document to explain inventory field (#997) 2019-05-13 12:03:30 -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
Jeff Regan
27324c8236 Merge pull request #1067 from monopole/noKunstruct
Convert example plugins to accept bytes instead of unstruct.
2019-05-12 13:10:56 -07:00
Jeffrey Regan
2e71a3b862 Convert plugins to accept bytes instead of unstruct. 2019-05-12 12:58:56 -07:00
Jeff Regan
06acd3caa9 Merge pull request #1066 from monopole/addSedTransformerTest
Add SedTransformerTest
2019-05-12 11:34:57 -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
Kubernetes Prow Robot
8eee69bd8f Merge pull request #1056 from sunny0826/master
Translate kustomization.yaml
2019-05-10 09:16:00 -07:00
Nestor
e4159d9411 allow to set image without a tag 2019-05-10 17:35:15 +02:00
郭旭东
7ab4d284ee fix translation 2019-05-10 09:34:41 +08:00
郭旭东
3e6ee23a17 fix README 2019-05-09 09:43:48 +08:00
郭旭东
faaf600276 translate kustomization.yaml & update zh/README 2019-05-09 09:42:50 +08:00
Nestor
ca6228b526 add remove resource subcommand 2019-05-08 15:34:29 +02:00
郭旭东
16924d7913 translate kustomization.yaml 2019-05-08 18:54:07 +08:00
Jeff Regan
540e4023da typo in README 2019-05-08 01:41:48 -07:00
Jeff Regan
2ecb2e3c80 Merge pull request #1054 from monopole/docFixes
add older release notes
2019-05-08 01:39:30 -07:00
jregan
2675bf4b73 add older release notes 2019-05-08 01:37:51 -07:00
Jeff Regan
01df12cf3c Merge pull request #1051 from monopole/fixNits
Fix a plugin nit.
2019-05-07 17:58:15 -07: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
Jeff Regan
03ad8efcba Merge pull request #1046 from monopole/shareableKustTestHarness
Make kusttestharness shareable.
2019-05-07 14:56:07 -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
Kubernetes Prow Robot
8c5d4128e0 Merge pull request #1041 from monopole/introduceEnvs
Introduce envs field.
2019-05-06 18:21:39 -07:00
Jeff Regan
f2295acfdd Update v_2.1.0.md 2019-05-06 15:16:44 -07:00
Jeffrey Regan
529db0493b Introduce envs field. 2019-05-06 14:35:48 -07:00
guoxudong
a8c476f7c0 add the Chhinese translation of docs list & install (#1022)
* Chinese docs list

* translate INSTALL.md

* supplement

* translate workflows.md

* fix

* update README & INSTALL

* Fix bad links

* squash all the commits of Chinese docs
2019-05-02 08:46:15 -07:00
Jesse Newland
f38d0c690c Apply LimitRange resources before workloads 2019-05-02 08:40:14 -05:00
Kubernetes Prow Robot
e42933ec54 Merge pull request #1006 from Liujingfang1/inventory
add inventory package and refactor inventory transformer
2019-05-01 11:09:58 -07:00
Jingfang Liu
ad7ca6977b address comments 2019-05-01 09:17:36 -07:00
Jeff Regan
0045d7b716 Update plugins.md 2019-04-30 11:26:52 -07:00
Jeff Regan
64bd069290 Update plugins.md 2019-04-30 11:19:36 -07:00
Jeff Regan
70def86613 fix a link 2019-04-30 10:43:08 -07:00
Jeff Regan
cff5349426 Merge pull request #1020 from monopole/chartExample
Helm chart generator plugin example.
2019-04-30 10:20:37 -07:00
Jeff Regan
54d1c557b2 Update plugins.md 2019-04-30 09:44:53 -07:00
Jeff Regan
a889f97fd1 fix some example ptrs 2019-04-30 09:42:50 -07:00
Jeff Regan
9ffe20a18b Merge pull request #1031 from monopole/bugReportPage
Add bug report page.
2019-04-30 09:35:48 -07:00
Jeffrey Regan
9bd456c6df Add bug report page. 2019-04-30 09:34:45 -07:00
Jeff Regan
a43dffdeda Merge pull request #1030 from monopole/startReleaseNotes
start v2.1 release notes
2019-04-30 07:10:21 -07:00
Jeffrey Regan
61cf67fb95 start v2.1 release notes 2019-04-30 07:09:26 -07:00
Jeff Regan
09f2157a92 Merge pull request #1025 from monopole/updateGlossary
doc/glossary updates for v2.1
2019-04-29 19:54:44 -07:00
Jeffrey Regan
ca4aea173c doc/glossary updates for v2.1 2019-04-29 19:52:03 -07:00
Jeffrey Regan
76d370a8f2 Chart last mile example 2019-04-29 13:53:51 -07:00
Jeff Regan
f4364eb990 Merge pull request #1024 from kubernetes-sigs/change-language-in-remote-demo
Update remoteBuild.md
2019-04-29 10:12:39 -07:00
Jeff Regan
865348695f Update remoteBuild.md 2019-04-29 10:06:41 -07:00
Jeff Regan
2ec8189c1c Update remoteBuild.md 2019-04-29 09:59:00 -07:00
Kubernetes Prow Robot
a5dfc65440 Merge pull request #828 from kenmaglio/add-choco-documentation
Adds documentation for choco package for windows
2019-04-29 08:26:21 -07:00
Kubernetes Prow Robot
45302f0790 Merge pull request #1021 from max-sixty/patch-1
Update strategic-merge link
2019-04-29 08:24:25 -07:00
Maximilian Roos
1afc6c775b Update strategic-merge link
The existing link has been deprecated
2019-04-26 21:44:30 -04:00
Kubernetes Prow Robot
ca4d5ed42b Merge pull request #1019 from monopole/addIfToInflator
Mods to chart inflator plugin
2019-04-26 15:56:22 -07:00
Jeffrey Regan
cd9572e0bb hey 2019-04-26 15:48:41 -07:00
Jeff Regan
ac3ea4d6f3 Merge pull request #1014 from rohitsardesai83/replace_ghodss_yaml_with_sigsk8sio_yaml_dep
Remove dependency on ghodss/yaml
2019-04-26 09:50:51 -07:00
Jeff Regan
030824b196 Merge pull request #1016 from monopole/frog
Make plugin dir match Go conventions.
2019-04-26 09:07:19 -07:00
jregan
cfb0c5efad Make plugin dir match Go conventions. 2019-04-25 20:30:10 -07:00
rohitsardesai83
b67d713bc0 Remove dependency on ghodss/yaml 2019-04-25 23:47:01 +05:30
Kubernetes Prow Robot
0ac48f60a5 Merge pull request #1011 from Liujingfang1/execdir
pass loader root to exec plugins
2019-04-24 19:46:44 -07:00
Jingfang Liu
445f739234 add test for ensuirng the loader root is correctly passed 2019-04-24 18:32:03 -07:00
Jingfang Liu
fc8063f752 pass loader root to exec plugins 2019-04-24 12:09:25 -07:00
Jingfang Liu
d5abe39d53 add inventory package and refactor inventory transformer 2019-04-24 11:07:06 -07:00
Kubernetes Prow Robot
520acc7d97 Merge pull request #1008 from Liujingfang1/resid
add ItemId type
2019-04-23 17:30:00 -07:00
Jeff Regan
ae0510f648 Update chartinflatorexecplugin_test.go 2019-04-23 17:23:55 -07:00
Jeff Regan
0f50be877c Update ChartInflatorExec 2019-04-23 17:05:12 -07:00
Jingfang Liu
5b18c4de0c add ItemId type 2019-04-23 16:31:48 -07:00
Jeff Regan
72fd31fd20 Update FAQ.md 2019-04-23 16:29:32 -07:00
Jeff Regan
256ffdb932 Merge pull request #1007 from monopole/collectInternal
Collect existing internal pkgs under one roof.
2019-04-23 12:01:40 -07:00
Jeffrey Regan
8991bcb399 Collect existing internal pkgs under one roof. 2019-04-23 11:53:50 -07:00
Jeff Regan
185ae510e8 Update README.md 2019-04-23 11:24:14 -07:00
Kubernetes Prow Robot
40303cb329 Merge pull request #1005 from monopole/addLoaderTest
Add a plugin loader test.
2019-04-22 15:40:06 -07:00
Kubernetes Prow Robot
38ec207609 Merge pull request #1004 from Liujingfang1/prune
change field name: prune -> inventory
2019-04-22 15:14:07 -07:00
Jeffrey Regan
1545e07dd6 Add a plugin loader test. 2019-04-22 15:00:32 -07:00
Kubernetes Prow Robot
f123380917 Merge pull request #1003 from monopole/simplifyPluginLoader
Simplify plugin loader code.
2019-04-22 11:27:45 -07:00
Jingfang Liu
b4fc1e4357 change field name: prune -> inventory 2019-04-22 11:25:14 -07:00
jregan
76a3179868 Simplify plugin loader code.
* use one place to build plugin file names,
 * use one loader instance,
 * test for plugin enabled flag in just one place to
   avoid errors and reduce if statements,
 * don't return private objects,
 * factor goplugin loading to a method,
 * fix a related test that was commented out.
2019-04-22 10:13:40 -07:00
Kubernetes Prow Robot
c9bf70fd4b Merge pull request #1002 from monopole/deleteKustomizationError
Delete kustomizationerror.
2019-04-22 09:53:45 -07:00
jregan
9a85071085 Delete kustomizationerror.
Do a longstanding TODO to remove kustomizationerror.

It wasn't used much, and it wasn't used consistently,
because it's complicated to decided when it's worth
proceeding to accumulate errors when one already knows
that one has a fatal error in the kustomization.  Its
use was blocking refactoring for simplicity and making
tests harder to write.

Removing it lets us reinstate the cyclomatic complexity
check in KustTarget.

Also added more info to the affected error messages.
2019-04-21 16:10:58 -07:00
Jeff Regan
a6f41bb96d Merge pull request #1000 from monopole/faq
Add faq
2019-04-20 07:50:10 -07:00
Jeffrey Regan
3f2acc90aa Add faq 2019-04-20 07:47:31 -07:00
Jeff Regan
aba9f7d1e5 Merge pull request #998 from monopole/addLoadRestrictorFlag
Add load_restrictor flag.
2019-04-20 07:09:01 -07:00
Jeffrey Regan
3b8c5ee96d Add load_restrictor flag. 2019-04-19 17:33:51 -07:00
Kubernetes Prow Robot
a5bb5479fb Merge pull request #995 from monopole/removeLocalLoadRestrictions
Remove local load restrictions.
2019-04-19 16:27:54 -07:00
Jeffrey Regan
3c58c9d132 Remove local load restrictions. 2019-04-19 15:47:13 -07:00
Kubernetes Prow Robot
1b1f91580e Merge pull request #996 from monopole/addTestShowingSharedPatchesDisallowed
Add test showing shared patches disallowed
2019-04-19 14:59:55 -07:00
Jeffrey Regan
644dc4b9a7 Add test showing shared patches disallowed. 2019-04-19 14:42:30 -07:00
Jeffrey Regan
96707645e2 Add test showing shared patches disallowed. 2019-04-19 14:39:02 -07:00
Jeff Regan
b878e5f10d Merge pull request #993 from monopole/fixNits
Fix some comment nits.
2019-04-19 09:29:18 -07:00
Jeffrey Regan
a914570240 Fix some comment nits. 2019-04-19 09:26:54 -07:00
Kubernetes Prow Robot
b3d2ab29e9 Merge pull request #992 from sunny0826/master
docs add kubectl command
2019-04-19 09:09:55 -07:00
郭旭东
3ff5c793e3 docs add kubectl command 2019-04-19 18:09:01 +08:00
Kubernetes Prow Robot
c752660aa6 Merge pull request #990 from monopole/removeSomeDupes
Remove some duped code.
2019-04-18 11:51:27 -07:00
Jeff Regan
efded10e26 Merge pull request #971 from pohly/base-renaming-json-patch
tests: demonstrate issue with JSON patch when base adds name prefix
2019-04-18 11:48:55 -07:00
Jeffrey Regan
8767495b5a Remove some duped code. 2019-04-18 11:37:42 -07:00
Patrick Ohly
403ede788c tests: demonstrate issue with JSON patch when base adds name prefix
The expectation is that the base entity can be referenced by its name
with prefix, because the overlay shouldn't have to know how the base
is generated. But currently the entity is only found when using the
name without prefix.

Related-To: #972
2019-04-18 20:36:39 +02:00
Jeff Regan
c444f93eb5 Merge pull request #960 from zeeZ/individual-output
Write individual files to output path if it is a directory
2019-04-18 11:26:14 -07:00
Kubernetes Prow Robot
ed146f656e Merge pull request #988 from mengqiy/nscluster
fix namespace transformer for cluster-scoped resources
2019-04-18 11:16:04 -07:00
Mengqi Yu
bcb697eb0b fix namespace transformer for cluster-scoped resources 2019-04-18 11:03:19 -07:00
Kubernetes Prow Robot
3ac66049c7 Merge pull request #989 from Liujingfang1/prune
update PruneString for resources
2019-04-18 10:54:02 -07:00
Kubernetes Prow Robot
7a1a231041 Merge pull request #984 from afirth/20190516_vars_for_secretName
Vars should expand in ingress/spec/tls/secretName
2019-04-18 10:52:06 -07:00
Jingfang Liu
748c88c276 update PruneString for resources 2019-04-18 10:39:22 -07:00
Mengqi Yu
6f4b104c9e add admission webhook types in the default cluster-scoped resource list 2019-04-18 10:30:04 -07:00
Kubernetes Prow Robot
867201a075 Merge pull request #980 from monopole/helmChartInflatorExec
Helm chart generator exec plugin
2019-04-18 08:54:09 -07:00
Jeffrey Regan
2545ea1019 Helm chart generator exec plugin 2019-04-17 19:07:20 -07:00
Alastair Firth
5be42092af Vars should expand in ingress/spec/tls/secretName
https://github.com/kubernetes-sigs/kustomize/issues/799
2019-04-16 23:36:05 +02:00
Kubernetes Prow Robot
50c076eb3f Merge pull request #983 from Liujingfang1/exec
add the unstructured to ENV of exec plugins
2019-04-16 13:49:10 -07:00
Jingfang Liu
fb9e00bf33 add the unstructured to ENV of exec plugins 2019-04-16 13:12:42 -07:00
Kubernetes Prow Robot
b9007fcc29 Merge pull request #974 from Liujingfang1/exec
add support for exec plugins
2019-04-16 10:39:09 -07:00
Jingfang Liu
f6e01cfda7 add support for exec plugins 2019-04-16 09:26:38 -07:00
Christian
9203478a8a Write individual files to output path if it is a directory 2019-04-13 09:46:43 +02:00
Kubernetes Prow Robot
28cb6daec7 Merge pull request #968 from monopole/switchToVGo
Switch to vgo
2019-04-12 09:38:47 -07:00
Jeffrey Regan
e191ff53dd Switch to vgo 2019-04-11 22:25:37 -07:00
Kubernetes Prow Robot
177297c0ef Merge pull request #959 from Liujingfang1/execplugins
add goplugin for exec generators and transformers
2019-04-09 15:48:11 -07:00
Jingfang Liu
e5d730e1fe address comments 2019-04-09 15:42:08 -07:00
Jingfang Liu
ba43ecbcb7 add goplugin for exec generators and transformers 2019-04-09 13:13:21 -07:00
Kubernetes Prow Robot
ee68a9c450 Merge pull request #957 from monopole/justTheFactsMaam
Define a plugin compiler.
2019-04-08 18:33:04 -07:00
jregan
175c754f61 Define a plugin compiler. 2019-04-08 18:05:31 -07:00
Kubernetes Prow Robot
e8eed838b5 Merge pull request #926 from Liujingfang1/prune
generate configmap for pruning
2019-04-08 15:24:27 -07:00
Jingfang Liu
e9a3f9f5f6 address comments 2019-04-08 15:17:18 -07:00
Jingfang Liu
826affb8dd generate configmap for pruning 2019-04-08 14:10:49 -07:00
Kubernetes Prow Robot
4937b1c75e Merge pull request #955 from monopole/addSecretGenerator
Add secret generator.
2019-04-08 09:02:30 -07:00
jregan
ffc16d51e0 Add secret generator. 2019-04-06 18:38:22 -07:00
Jeff Regan
1623f1e4c0 Merge pull request #954 from monopole/genGen
Consolidate some generator and transformer code.
2019-04-06 18:38:04 -07:00
jregan
b32e041bfe Remove some duped code. 2019-04-06 16:14:12 -07:00
Kubernetes Prow Robot
38029d1836 Merge pull request #951 from Liujingfang1/generatorplugins
add support for generator go-plugins
2019-04-06 13:40:26 -07:00
Jeff Regan
b2dd74ab97 Merge pull request #953 from monopole/cleanPluginBuilds
Cleanup plugin builds.
2019-04-06 13:23:16 -07:00
jregan
16fe7ced6a Cleanup plugin builds. 2019-04-06 13:16:46 -07:00
Kubernetes Prow Robot
cb4af7a9d4 Merge pull request #950 from 2opremio/564-add-force-flag-to-annotations-and-labels
Add --force flag to modify annotations and labels
2019-04-05 14:05:52 -07:00
Jingfang Liu
7493732176 add generator plugins 2019-04-05 13:51:56 -07:00
Alfonso Acosta
2cf8371add Add --force flag to modify annotations and labels
This change adds a new flag (`--force`) to commands `edit add annotation` and
`edit add label` so that annotations and labels are modified if they already
existed.
2019-04-05 22:49:28 +02:00
Jeff Regan
a575c24a24 Merge pull request #948 from bells17/fix-path
Fix path
2019-04-05 12:56:15 -07:00
Kubernetes Prow Robot
9e8d06e7ce Merge pull request #946 from Liujingfang1/moreplugins
add support for transformer goplugins
2019-04-05 11:25:20 -07:00
Jingfang Liu
4f1a2350ce add transformer plugins 2019-04-05 10:16:10 -07:00
Daiki Hayakawa
cefb64b6a9 Fix path 2019-04-05 18:02:37 +09:00
jregan
440d036176 some transformer plugins 2019-04-04 13:23:41 -07:00
Kubernetes Prow Robot
53f0deec8f Merge pull request #941 from Liujingfang1/gentran
add generators/transformers fields in kusotmization.yaml
2019-04-03 16:44:48 -07:00
Kubernetes Prow Robot
3c495e3b23 Merge pull request #939 from kbhawkey/doc-images-take2
add tutorial for custom images transformer
2019-04-03 14:36:49 -07:00
Jingfang Liu
deaf0779a1 add generators/transformers fields in kusotmization.yaml 2019-04-03 14:05:25 -07:00
Jeff Regan
fd7a353df6 Merge pull request #938 from monopole/tweakDoc
Expound on plugin caveats
2019-04-01 09:40:53 -07:00
Karen Bradshaw
927b497feb fix tests 2019-03-31 19:05:35 -04:00
Karen Bradshaw
237c54f47e add tutorial for custom images transformer 2019-03-31 16:29:52 -04:00
Kubernetes Prow Robot
8c23db47a7 Merge pull request #936 from Liujingfang1/note
add note for availability in kubectl
2019-03-30 18:38:34 -07:00
jregan
7971ac1cb8 Tweak secret docs. 2019-03-30 18:22:43 -07:00
Yujun Zhang
2490e605c3 Updates in image transformer (#911)
- Decouple `mutateImage` from `updateContainers` to be reused as `mutateFunc`
- Ignore default image transform error for CRD which may contain non-array type `containers` field

Related to #890, #904, fixes #890
2019-03-29 13:11:07 -07:00
Jingfang Liu
21a0cba43e fix the regression of building remote url (#935) 2019-03-29 13:10:11 -07:00
Kubernetes Prow Robot
42d9287985 Merge pull request #931 from michaelheyvaert/fix-cronjob-projected-volume-namerefs
fix configmap/secret name references for cronjobs with projected volumes
2019-03-29 09:28:23 -07:00
Michael Heyvaert
4848987a1f fix configmap/secret name references for cronjobs with projected volumes 2019-03-29 09:00:00 +01:00
Jingfang Liu
53a22cbe9b add note for availability in kubectl 2019-03-28 15:22:49 -07:00
Jeff Regan
c3700e0c88 Merge pull request #934 from monopole/tweakPluginDoc
Improve plugin doc.
2019-03-28 12:51:49 -07:00
Jeffrey Regan
58d9a51040 Improve plugin doc. 2019-03-28 12:50:19 -07:00
Jeff Regan
8f395ad86f Merge pull request #925 from monopole/addGoPluginExample
Add goplugin KV generator example.
2019-03-28 10:24:06 -07:00
Jeffrey Regan
99391157ec Add goplugin KV generator example. 2019-03-28 09:55:44 -07:00
Jeff Regan
99406d4412 Merge pull request #933 from monopole/fixTravisMaybe
Update travis file.
2019-03-28 09:54:30 -07:00
Jeffrey Regan
c1dea6676f Update travis file. 2019-03-28 09:42:18 -07:00
Kubernetes Prow Robot
afa4664511 Merge pull request #920 from monopole/fix918
fix a bool check
2019-03-26 11:03:22 -07:00
Jeffrey Regan
267eec5509 Fix 918 2019-03-26 10:47:31 -07:00
Jeff Regan
9764eb2f83 Merge pull request #919 from monopole/accumulatorPkg
Move accumulator code to its own package.
2019-03-26 10:04:46 -07:00
Jeffrey Regan
9a12b55139 Move accumulator code to its own package. 2019-03-26 09:53:52 -07:00
Kubernetes Prow Robot
f8cffef977 Merge pull request #889 from sethpollack/edit_add_plugins
update edit add secrets/configmaps to use plugins
2019-03-21 13:51:37 -07:00
Seth Pollack
822420e4ab fix mergeFlags 2019-03-21 14:58:06 -04:00
Seth Pollack
b60fca05bd update edit add secrets/configmaps to use plugins 2019-03-20 09:24:10 -04:00
Kubernetes Prow Robot
1a35071672 Merge pull request #895 from Liujingfang1/patchnamespace
skip adding namespace when the object is empty
2019-03-19 15:42:22 -07:00
Jingfang Liu
bfc3655bad skip adding namespace when the object is empty 2019-03-19 15:34:29 -07:00
Kubernetes Prow Robot
2c0c0c9497 Merge pull request #841 from yujunz/transformers/image
Support custom configuration for image transformer
2019-03-19 14:08:22 -07:00
Kubernetes Prow Robot
46bd38e89d Merge pull request #891 from sethpollack/envfiles
add builtin envfiles plugin
2019-03-18 12:58:21 -07:00
Seth Pollack
9fc4d388ce add builtin envfiles plugin 2019-03-18 13:58:38 -04:00
Jeff Regan
2965134f89 Merge pull request #892 from monopole/defaultToBuiltin
Make builtin the default pluginType
2019-03-18 10:29:22 -07:00
Jeffrey Regan
3a7c8a03f4 Make builtin the default pluginType 2019-03-18 10:21:24 -07:00
Kubernetes Prow Robot
449b1b68e0 Merge pull request #888 from sethpollack/files
add builtin files plugin
2019-03-18 09:46:20 -07:00
Seth Pollack
dd59eb38d0 add test case 2019-03-17 20:44:07 -04:00
Seth Pollack
a8465c95e1 add builtin files plugin 2019-03-17 17:22:52 -04:00
Kubernetes Prow Robot
df2f67b191 Merge pull request #883 from sethpollack/builtins
add builtin plugin for literals
2019-03-17 14:05:09 -07:00
Seth Pollack
7764dee59d Merge branch 'master' into builtins 2019-03-17 17:01:06 -04:00
Jeff Regan
6465a36176 Merge pull request #887 from monopole/addNannyFlag
Put goplugins behind flag.
2019-03-17 13:46:03 -07:00
jregan
103c1b3a4f Put goplugins behind flag. 2019-03-17 13:39:48 -07:00
Seth Pollack
29cbec37b8 move parse helpers to util 2019-03-17 12:34:52 -04:00
Kubernetes Prow Robot
2c9e4507a7 Merge pull request #861 from kbhawkey/fix-spelling-transformerconfig
correct spelling, minor word ordering
2019-03-17 06:38:55 -07:00
Kubernetes Prow Robot
d5d5c076a7 Merge pull request #882 from sethpollack/xdg_home
honor XDG_CONFIG_HOME
2019-03-17 06:36:55 -07:00
Kubernetes Prow Robot
f09bbff35c Merge pull request #884 from vreon/fix-varrefs
Fix incorrect and missing varReferences
2019-03-17 06:12:56 -07:00
Kubernetes Prow Robot
2627e2507b Merge pull request #885 from yujunz/imagetransformer/test
Convert image transformer test to a more readable format
2019-03-17 06:08:55 -07:00
Seth Pollack
1bd7afe6e7 fix linter 2019-03-17 08:53:49 -04:00
Yujun Zhang
e6c1b14108 Add test for transformers/image custom config 2019-03-17 16:59:41 +08:00
Yujun Zhang
7130e3ff1d Leave defautconfig empty for images
`containers` and `initContainers` of *ANY* kind in *ANY*
path are builtin supported in code
2019-03-17 16:43:31 +08:00
Yujun Zhang
abf538d80d Keep backward compatibility for image transformer 2019-03-17 16:43:31 +08:00
Yujun Zhang
f311ba8d4f Support custom config for image transformer 2019-03-17 16:43:31 +08:00
Yujun Zhang
3e85c4589b Load default config for image transformer 2019-03-17 16:43:31 +08:00
Yujun Zhang
d0cf047381 Convert image transformer test to a more readable format 2019-03-17 16:41:42 +08:00
Jesse Dubay
31091a8df2 Fix missing varrefs for CronJob, Job, ReplicaSet 2019-03-16 19:15:56 -07:00
Jesse Dubay
e207ae4c01 Fix incorrect default varrefs for CronJob volumeMounts 2019-03-16 19:12:58 -07:00
Jesse Dubay
3011f18047 Sort default varReference config by kind, path 2019-03-16 19:11:42 -07:00
Seth Pollack
388d5c2d7c add builtin plugins 2019-03-16 21:21:15 -04:00
Seth Pollack
5c4719651e honor XDG_CONFIG_HOME 2019-03-16 20:46:37 -04:00
Karen Bradshaw
f850ca63f4 remove extra comment 2019-03-16 16:49:16 -04:00
Karen Bradshaw
65886f1258 address comments 2019-03-16 16:40:30 -04:00
Karen Bradshaw
942e36e19f a few more changes 2019-03-16 16:40:29 -04:00
Karen Bradshaw
7b82154c4c correct spelling, minor word ordering 2019-03-16 16:40:29 -04:00
Kubernetes Prow Robot
284efc709c Merge pull request #760 from sethpollack/plugins
add secret and configmap generator plugins
2019-03-15 18:00:58 -07:00
Seth Pollack
56965a0046 fix test 2019-03-15 17:33:17 -04:00
Seth Pollack
18f6328284 add secret and configmap generator plugins 2019-03-15 14:28:18 -04:00
Jeff Regan
e7be999bc9 Merge pull request #879 from monopole/removeTheSet
Secret/configmap factory cleanup.
2019-03-15 10:17:29 -07:00
jregan
c06b95077d Secret/configmap factory cleanup. 2019-03-15 09:25:59 -07:00
Kubernetes Prow Robot
c4da063934 Merge pull request #877 from YP28/fix-typo-in-namereference
fix typo in namereference where serviceaccount name would not resolve
2019-03-14 08:46:29 -07:00
Yordi Pauptit
62d3200e4f fix typo in namereference where serviceaccount name would not resolve 2019-03-14 09:36:21 +01:00
Kubernetes Prow Robot
9a419824ae Merge pull request #874 from CodeLingoBot/rewrite
Fix function comments based on best practices from Effective Go
2019-03-12 14:50:39 -07:00
Kubernetes Prow Robot
a94eab0398 Merge pull request #867 from yujunz/docs/versioning-policy
Fix field names
2019-03-12 14:48:39 -07:00
Kubernetes Prow Robot
01b8ab8524 Merge pull request #872 from kbhawkey/fix-set-image-help-msg
fix help msg for set image cmd
2019-03-11 14:44:37 -07:00
Karen Bradshaw
fa552d7773 fix help msg for set image cmd 2019-03-11 17:23:30 -04:00
Kubernetes Prow Robot
7acbd4d3e0 Merge pull request #870 from YP28/job-initctr-varref
Add Job initContainer to varreference config
2019-03-11 10:39:29 -07:00
Kubernetes Prow Robot
9811123e2e Merge pull request #866 from yujunz/edit-fix
Fix error message
2019-03-11 10:13:28 -07:00
Yordi Pauptit
f7cd44be42 add job initcontainer to varreference config 2019-03-11 15:13:58 +01:00
CodeLingo Bot
9a4692e6ee Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-03-11 00:45:21 +00:00
Yujun Zhang
3d0e29075d Fix markdownlint warnings 2019-03-09 17:02:39 +08:00
Yujun Zhang
0f571b9120 Fix field names 2019-03-09 16:58:32 +08:00
Yujun Zhang
3a44508d6f Fix error message
Closes #862
2019-03-09 16:43:32 +08:00
Kubernetes Prow Robot
5294355c98 Merge pull request #864 from mnatsu31/fix-typo-namereference
Fix typo in namereference path for cronjobs initContainers.
2019-03-08 09:25:30 -08:00
mnatsu31
559efd6477 Fix typo in namereference path for cronjobs initContainers. 2019-03-08 13:20:34 +09:00
Kubernetes Prow Robot
a59577c08d Merge pull request #857 from pst/fastergitclone
Reduce time required for cloning remote bases
2019-03-06 21:24:57 -08:00
Philipp Strube
4f429d6b86 Reduce time required for cloning remote bases
This commit changes git/cloner.go from cloning the whole history
and then checking out the desired ref to a implementation that
only downloads the history for the desired ref.

It does so by first initializing an empty repository, setting the
source repository as a remote, fetching just the desired ref and
then hard resetting the empty local repo to that ref.

This reduces the time it takes to build the multibases example
as a remote base at ref v2.0.3 from an avg of 8s with the
current implementation to an avg of 2s out of 10 runs each, by
drastically decreasing the data transferred.

The improvement should increase as repositories grow.
2019-03-06 19:31:24 +01:00
Ken Maglio
5e7ddc8616 Adds precommit for windows + documentation 2019-03-05 12:08:11 -06:00
Jeff Regan
a6f6514412 Merge pull request #842 from narayanan/annotation-with-colon
Fix for #818 - Added support for quoted values
2019-03-04 17:40:12 -08:00
Jeff Regan
31ee38b1a1 Merge pull request #833 from Liujingfang1/crd_errmsg
improve error message for loading files listed under crds
2019-03-04 17:36:43 -08:00
Jeff Regan
46c7d6d39a Merge pull request #832 from Liujingfang1/jsonpatch
improve error message in json patch transformer
2019-03-04 17:35:37 -08:00
Jingfang Liu
78cbff16ef improve error message in json patch transformer 2019-03-04 16:43:24 -08:00
Jingfang Liu
28cefb3bd1 improve error message for loading files listed under crds 2019-03-04 16:32:01 -08:00
Narayanan Singaram
e666630d36 Simplify map conversion logic 2019-03-04 13:50:49 -08:00
Narayanan Singaram
ed2ad860c6 Move trim quotes logic to separate function 2019-03-04 13:19:18 -08:00
Kubernetes Prow Robot
a341c24b2a Merge pull request #837 from narayanan/image-with-port
Fix for #831 - Ignore domain when finding the image tag
2019-03-04 11:21:14 -08:00
Kubernetes Prow Robot
0101d6e393 Merge pull request #844 from yujunz/configmaps/test
Add configmaps test for json string
2019-03-04 11:04:39 -08:00
Kubernetes Prow Robot
e429d8ca10 Merge pull request #835 from pwittrock/master
Run kustomize tests on OSx
2019-03-04 10:03:00 -08:00
Yujun Zhang
45ba785641 Add configmaps test for json string 2019-03-03 10:21:03 +08:00
Narayanan Singaram
ea3d5e68db Fix for #818 - Added support for quoted values 2019-03-02 12:23:55 -08:00
Narayanan Singaram
eb75203926 Fix for #831 - Ignore domain when finding the image tag 2019-03-01 23:23:32 -08:00
Phillip Wittrock
1303ea3969 Run kustomize tests on OSX 2019-02-28 20:03:23 -08:00
Ken Maglio
bb69e9e70b Updates documentation for support and source 2019-02-28 21:45:40 -06:00
Kubernetes Prow Robot
16d1b20ed6 Merge pull request #830 from Liujingfang1/doc
update transformerconfigs/crd example
2019-02-27 15:05:00 -08:00
Jingfang Liu
b0c3cd75e1 update the doc for crds: the files in this list should be openAPI definition 2019-02-27 14:11:15 -08:00
Jingfang Liu
f4eef1dc0b update transformerconfigs/crd example 2019-02-27 13:26:58 -08:00
Kubernetes Prow Robot
76c6655520 Merge pull request #829 from monopole/fix317
Log warning about well-defined but unused variables.
2019-02-27 11:18:39 -08:00
Kubernetes Prow Robot
d5c8734555 Merge pull request #822 from Liujingfang1/webhooks
Add webhooks to order list of gvk
2019-02-26 21:55:10 -08:00
Kubernetes Prow Robot
62ee138173 Merge pull request #825 from PrasadG193/update-dep-golang/x/net
Update golang/x/net dependency to release-branch.go1.11
2019-02-26 21:49:37 -08:00
Jeffrey Regan
ff6cd3ca55 Report unused variables. 2019-02-26 21:04:36 -08:00
Ken Maglio
852e7ed5aa Typo Fix 2019-02-26 17:19:33 -06:00
Jeff Regan
b7e8042a02 Merge pull request #827 from monopole/fix826
Improve error handling during var resolution.
2019-02-26 14:14:14 -08:00
jregan
6bfd7cff72 Improve error handling during var resolution. 2019-02-26 14:05:38 -08:00
Prasad Ghangal
9d77cbea8c Update golang/x/net dependency to release-branch.go1.11 2019-02-27 00:44:10 +05:30
Jingfang Liu
8bbe147c14 Add webhooks to order list of gvk 2019-02-26 10:39:23 -08:00
Kubernetes Prow Robot
b67179e951 Merge pull request #820 from st1t/remove-imagetag
Change imagetag to image in docs/eschewedFeatures.md
2019-02-25 08:50:55 -08:00
Kubernetes Prow Robot
47237aa7a2 Merge pull request #813 from yujunz/varref
Add Pod initContainer to var reference
2019-02-25 08:48:49 -08:00
Shota Ito
5e6c06fb61 Change imagetag to image in docs/eschewedFeatures.md 2019-02-25 20:23:36 +09:00
Yujun Zhang
901455eb0b Add Pod initContainer to var reference 2019-02-24 11:36:09 +08:00
Jeff Regan
f8c80b7335 Merge pull request #812 from monopole/moreGeneratorTests
More generator tests.
2019-02-23 04:48:37 -08:00
Kubernetes Prow Robot
8db82d27e9 Merge pull request #811 from narg95/fix_new_tmp_confirmdir
fix absolute path for temp folder in MacOs
2019-02-22 17:31:12 -08:00
Nestor
1eab47b63f fix abs path with symlinks
Signed-off-by: Nestor <nesterran@gmail.com>
2019-02-22 18:29:53 +01:00
Kubernetes Prow Robot
c4656b71e5 Merge pull request #786 from ChrsMark/master
Change ExpandFileSource to work with key=val patterns
2019-02-22 07:14:07 -08:00
Kubernetes Prow Robot
711d3d3515 Merge pull request #809 from narg95/prevent_panic_image_trasformer
prevent panic on image transformer
2019-02-22 07:05:16 -08:00
Jeffrey Regan
0488f570cb More generator tests. 2019-02-22 06:52:41 -08:00
Nestor
0e459ebac8 prevent panic on image transformer
Signed-off-by: Nestor <nesterran@gmail.com>
2019-02-22 08:55:38 +01:00
Ken Maglio
1d65f24b04 adds documentation for choco package 2019-02-21 19:54:48 -06:00
Kubernetes Prow Robot
70719a8f65 Merge pull request #807 from Agilicus/add-generator-options
Add doc indicating existing of 'behavior' in configMapGenerator
2019-02-21 09:20:31 -08:00
Don Bowman
773c1f2199 Make requested wording changes from PR for behavior document
Signed-off-by: Don Bowman <don@agilicus.com>
2019-02-21 11:53:12 -05:00
Don Bowman
bf1c801a5e Add doc indicating existing of 'behavior' in configMapGenerator
It appears from the code that configMapGenerator can take
a parameter of 'behavior' which is 'merge','create','replace'.
Add note to the 'docs/kustomization.yaml' indicating so.

Signed-off-by: Don Bowman <don@agilicus.com>
2019-02-21 11:31:54 -05:00
Kubernetes Prow Robot
e1420b408c Merge pull request #762 from dimitropoulos/patch-1
typo: makes verb number agree with subject
2019-02-19 16:26:03 -08:00
Kubernetes Prow Robot
88a7471039 Merge pull request #796 from monopole/moreResIDTests
Add more resid test coverage.
2019-02-19 13:44:12 -08:00
Kubernetes Prow Robot
3c58cf0bf0 Merge pull request #789 from mrbrownt/runtime-version
Pulling goos and goarch from runtime
2019-02-19 09:07:27 -08:00
Chris Mark
77eebb89fd Review changes
Signed-off-by: Chris Mark <chrismarkou92@gmail.com>
2019-02-18 09:28:04 +02:00
jregan
d4d993a53c Add more resid test coverage. 2019-02-16 14:26:43 -08:00
Jeff Regan
ef3b0672c5 Merge pull request #795 from monopole/deleteExtraCopyright
Delete extraneous copyright.
2019-02-16 11:56:40 -08:00
jregan
0f30c09cbf Delete extraneous copyright. 2019-02-16 11:52:12 -08:00
Kubernetes Prow Robot
6f670a8f38 Merge pull request #782 from narg95/varref_in_maps_values
add support for varref in maps values
2019-02-15 14:53:21 -08:00
Nestor
8c93f7ba74 add support for varref in maps values 2019-02-14 08:02:32 +01:00
Todd Brown
7d3735b19e Adding goos and goarch from runtime 2019-02-13 10:59:35 -06:00
Chris Mark
f5f8e49fa3 Add explanatory comments and format
Signed-off-by: Chris Mark <chrismarkou92@gmail.com>
2019-02-13 09:38:13 +02:00
Chris
1382d87d7f Change ExpandFileSource to work with key=val patterns
Signed-off-by: Chris <chrismarkou92@gmail.com>
2019-02-13 09:30:06 +02:00
Kubernetes Prow Robot
e65b45f969 Merge pull request #790 from laverya/allow-all-kind-List-types
Allow all kind list types
2019-02-12 15:18:33 -08:00
Andrew Lavery
d72b16235a add a test for a list with no 'items:' provided 2019-02-12 15:07:46 -08:00
Andrew Lavery
3118ccfd05 add tests for *List kinds and empty lists 2019-02-12 12:45:28 -08:00
Andrew Lavery
fdba7df3c1 if the kind matches '*List$', treat it as a list 2019-02-12 12:28:08 -08:00
Kubernetes Prow Robot
02d753027a Merge pull request #788 from Liujingfang1/doc
fix invalid relative path in kustomization.yaml
2019-02-12 09:22:32 -08:00
Jingfang Liu
1a43759ac3 fix invalid relative path in kustomization.yaml 2019-02-12 08:57:56 -08:00
Kubernetes Prow Robot
7574f07be3 Merge pull request #785 from monopole/blackBoxTests
Switch to black box testing of KustTarget and Resource
2019-02-11 18:36:51 -08:00
Jeffrey Regan
48717f3f30 Switch to black box testing of KustTarget and Resource 2019-02-11 16:40:09 -08:00
Jeff Regan
74d3e92b55 Merge pull request #783 from monopole/testKustFileMissingMessage
Test missing kust file message
2019-02-11 10:18:54 -08:00
Kubernetes Prow Robot
f66024b1c1 Merge pull request #781 from saromanov/loop-refactoring
transformers/image: loop refactoring
2019-02-11 10:15:11 -08:00
Kubernetes Prow Robot
bf4e09a400 Merge pull request #761 from narg95/varref_mountpath
add volumeMounts/mountPath to varreference
2019-02-11 08:16:36 -08:00
Nestor
d968c0b4b1 add varref mountpath test case 2019-02-11 07:52:45 +01:00
Nestor
9837b5b429 add volumeMounts/mountPath to varreference
Signed-off-by: Nestor <nesterran@gmail.com>
2019-02-11 07:52:45 +01:00
jregan
1a03dcabde Test missing file report 2019-02-10 15:37:11 -08:00
Kubernetes Prow Robot
6fb11493ad Merge pull request #780 from monopole/addGitUrl
Add more git url regression coverage
2019-02-08 15:08:29 -08:00
Jeffrey Regan
1f063d6712 Add more git url regression coverage 2019-02-08 14:58:34 -08:00
Sergey
cebcd8a44d transformers/image: loop refactoring 2019-02-08 18:42:47 +05:00
Kubernetes Prow Robot
ce7e5ee2c3 Merge pull request #771 from alexbrand/fix-error-msg
Improve error msg returned when no kustomization file is found
2019-02-07 15:01:49 -08:00
Alexander Brand
242b9209d8 Improve error msg returned when no kustomization file is found
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
2019-02-07 17:09:57 -05:00
Kubernetes Prow Robot
92bd809bc8 Merge pull request #779 from monopole/bitbucket
Add nil ptr check
2019-02-07 10:28:04 -08:00
Jeffrey Regan
ccc4461827 Fix nil ptr bug 2019-02-07 10:11:45 -08:00
Kubernetes Prow Robot
9de524da7d Merge pull request #773 from monopole/kvpairToPair
Rename kv.KVPair to kv.Pair
2019-02-07 09:43:31 -08:00
Jeffrey Regan
7c8db24656 Rename kv.KVPair to kv.Pair 2019-02-06 16:45:44 -08:00
Jeff Regan
d720e9ef49 Fix some typos in versioning policy 2019-02-06 12:36:48 -08:00
Jeff Regan
9e69b9dcc4 Typos in versioning 2019-02-06 10:59:44 -08:00
Jeff Regan
4f7b0c1a21 Merge pull request #752 from Liujingfang1/doc
add documentation for kustomize 2.0.0
2019-02-05 17:22:09 -08:00
Jingfang Liu
fc5c7264cf add documentation for kustomize 2.0.0 2019-02-05 16:27:41 -08:00
Jeff Regan
ede407e6a2 Merge pull request #764 from sethpollack/kv
refactor kv pairs
2019-02-05 13:02:50 -08:00
Seth Pollack
e41ca934ac move package and add tests 2019-02-05 15:38:52 -05:00
Kubernetes Prow Robot
0184d5b697 Merge pull request #763 from Liujingfang1/kversion
allow apiVersion and Kind to be empty or specific values
2019-02-05 09:46:34 -08:00
Seth Pollack
e14ebc0adf refactor kv pairs 2019-02-04 17:19:57 -05:00
Jingfang Liu
e905704b0c allow apiVersion and Kind to be empty or specific values 2019-02-04 13:08:09 -08:00
Jeff Regan
f8060f3575 Merge pull request #753 from monopole/versionPolicy
Versioning policy.
2019-02-04 13:04:33 -08:00
Jeffrey Regan
120e7b5744 Versioning policy 2019-02-04 13:01:49 -08:00
Dimitri Mitropoulos
b15b20467c typo: changes verb number to agree with subject 2019-02-04 14:48:43 -05:00
Dimitri Mitropoulos
1d005d47b5 typo: makes verb number agree with subject
also changed `one` to `someone` to be more English-as-a-Second-Language friendly
2019-02-04 14:44:04 -05:00
Jingfang Liu
d8585334cc minor fix: incorrect apiVersion and add NoOpTransformer for vars (#757) 2019-02-04 09:44:33 -08:00
Kubernetes Prow Robot
6444981796 Merge pull request #751 from laverya/fix-invalid-type-encountered-nil
Accept a wider variety of kubernetes yaml values
2019-02-01 14:09:22 -08:00
Kubernetes Prow Robot
713c06354f Merge pull request #748 from Liujingfang1/version
add group name as kustomize.config.k8s.io
2019-02-01 13:54:36 -08:00
Jeff Regan
5e2c947cf8 Merge pull request #755 from Liujingfang1/generators
Combine generatorArgs and generatorOptions into options of Resource
2019-02-01 13:31:21 -08:00
Jeff Regan
92ede0d3c9 Merge pull request #754 from mgoodness/apiservice-nameref
Add Service nameReference to APIService
2019-01-31 15:33:23 -08:00
Jingfang Liu
84057436d6 Combine generatorArgs and generatorOptions into options of Resource 2019-01-31 15:32:32 -08:00
Michael Goodness
bf18cf2d9e Add Service nameReference to APIService
Signed-off-by: Michael Goodness <mgoodness@gmail.com>
2019-01-31 09:20:49 -06:00
Kubernetes Prow Robot
7913e5f5bc Merge pull request #749 from rndstr/document-smp-crd
Document SMP behavior for custom resources
2019-01-30 16:11:06 -08:00
Roli Schilter
f550540318 Document SMP behavior for custom resources
Documents how strategic merge patches are treated as json merge patches
when dealing with custom resources.
2019-01-30 15:59:01 -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
Jingfang Liu
199763dec8 add group name to kustomize.config.k8s.io 2019-01-30 09:48:12 -08:00
Kubernetes Prow Robot
093801479c Merge pull request #745 from greut/patch-1
examples: typo
2019-01-30 08:48:09 -08:00
Yoan Blanc
cdcc0052a6 examples: typo 2019-01-30 16:45:17 +01:00
Kubernetes Prow Robot
b6d4101808 Merge pull request #744 from laverya/skip-empty-object-validation
Skip empty object validation
2019-01-29 14:37:52 -08:00
Kubernetes Prow Robot
83f4fa2190 Merge pull request #743 from monopole/deleteDeadCode
Delete some dead code and fix nits.
2019-01-29 14:36:04 -08:00
jregan
35daae1715 Delete some dead code and fix nits. 2019-01-29 14:13:46 -08:00
Andrew Lavery
1997606372 add empty objects test for kunstruct SliceFromBytes 2019-01-29 13:17:03 -08:00
Andrew Lavery
209b115b7c ignore yaml files that do not include any entries 2019-01-29 13:17:03 -08:00
Kubernetes Prow Robot
93515517b8 Merge pull request #728 from monopole/disallowDownloadedKustomizationsFromLocalBases
Disallow cloned kustomization from using a local base outside the clone dir.
2019-01-29 11:49:03 -08:00
Jeffrey Regan
8c2bff2c91 Disallow cloned kustomization from using a local base outside the clone dir. 2019-01-29 10:31:52 -08:00
Jeff Regan
00e9657025 Merge pull request #740 from monopole/replaceStringWithRepoSpec
Replace all repo uri strings with git.RepoSpec.
2019-01-28 16:48:44 -08:00
Jeffrey Regan
31691f0330 Replace all repo uri strings with git.RepoSpec. 2019-01-28 15:31:42 -08:00
Kubernetes Prow Robot
bb74a42e04 Merge pull request #737 from monopole/moreGitUrlParsingCoverage
Add better error reporting to NewRepoSpecFromUrl
2019-01-28 14:48:00 -08:00
Jeffrey Regan
731a2a683e add another hostname to test 2019-01-28 14:27:59 -08:00
Kubernetes Prow Robot
95fd0c5530 Merge pull request #717 from asauber/remove-namespace-prefix-message
Remove warning for using prefix/suffix in conjunction with a Namespace
2019-01-28 11:48:54 -08:00
Andrew Sauber
79d357b460 remove warning for using prefix/suffix in conjunction with a Namespace 2019-01-28 14:42:04 -05:00
jregan
3ddc20f72c Increase git url parsing coverage. 2019-01-28 10:27:49 -08:00
Kubernetes Prow Robot
4179b8e6c8 Merge pull request #734 from FaKod/master
added DaemonSet for Var
2019-01-28 09:10:34 -08:00
Kubernetes Prow Robot
da23b6fce1 Merge pull request #733 from PascalBourdier/typo-doc
typo in doc
2019-01-28 09:01:16 -08:00
Christopher Schmidt
feb0502cb4 added DaemonSet 2019-01-28 12:39:44 +01:00
Pascal Bourdier
af8a169619 typo in doc
fix it
2019-01-28 11:57:43 +01:00
Jeff Regan
68ca28879d Merge pull request #731 from monopole/introRepoSpec
Introduce RepoSpec.
2019-01-27 08:24:49 -08:00
jregan
ad400cd13d Introduce RepoSpec.
This PR closes a TODO in the fileLoader type to
replace the string representing a git repo url
with a struct called holding validated fields.

New struct is called RepoSpec.

It holds what we need in coming PRs for remote
repo base containment checks, and will also allow
the overlay cycle prevention code to take into
account different host schemes or branches.

The struct is in a new file called repospec.go.
The new file is mostly just a code move of url
parsing code that was in cloner.go.  Git "blame"
history preserved through the move.

No change in execution (see final commit by itself).
2019-01-27 07:47:52 -08:00
jregan
90b863d124 Move cloner_tmp back to cloner. 2019-01-27 07:26:30 -08:00
jregan
9b7ddd6684 Merge in cloner_tmp, preserving blame history. 2019-01-27 07:26:30 -08:00
jregan
bcb939c19d Move cloner to repospec. 2019-01-27 07:26:30 -08:00
jregan
e2102dec3c Move cloner to cloner_tmp. 2019-01-27 07:26:30 -08:00
Jeff Regan
2ef16dce90 Merge pull request #730 from monopole/initializeGitPackage
Move git code to its own pkg.
2019-01-26 17:11:03 -08:00
jregan
1d9a20b391 Move git code to its own pkg. 2019-01-26 17:06:48 -08:00
Jeff Regan
d953eca630 Merge pull request #726 from monopole/refactorLoader
Add more coverage for loader and strengthen type safety
2019-01-25 16:11:38 -08:00
Jeff Regan
6651e488d6 Merge pull request #709 from sethpollack/secret
add add secret command
2019-01-25 16:10:24 -08:00
Jeffrey Regan
fd3cd47562 Fix copyright, add TODOs 2019-01-25 16:05:40 -08:00
jregan
dcb5682594 Add more coverage for loader and strengthen type safety. 2019-01-25 14:43:28 -08:00
Kubernetes Prow Robot
0bd2a1e232 Merge pull request #722 from Liujingfang1/removeDeprecates
remove patches and imageTags from kustomization.yaml
2019-01-25 14:41:06 -08:00
Jeff Regan
4d77c9f940 Merge pull request #721 from Liujingfang1/filename
support different filenames for kustomization file
2019-01-25 14:34:06 -08:00
Jingfang Liu
c461f1f766 remove patches and imageTags from kustomization.yaml 2019-01-25 14:26:17 -08:00
Jeff Regan
fbcae2b770 Merge pull request #724 from monopole/moveCleanedAbs
Cover CleanedAbs with tests.
2019-01-25 12:51:16 -08:00
Jeffrey Regan
c21dfefbdf Cover CleanedAbs 2019-01-25 12:21:03 -08:00
Seth Pollack
a0c22b8216 add add secret command 2019-01-25 12:32:14 -05:00
Jingfang Liu
f7a59178a8 support different filenames for kustomization file 2019-01-24 15:08:28 -08:00
Jeff Regan
028724df08 Merge pull request #718 from monopole/tweakVarDoc
Tweak documentation on 'vars' directive.
2019-01-23 17:26:11 -08:00
Jeffrey Regan
51bbf57e95 Tweak documentation on directive. 2019-01-23 17:23:29 -08:00
Jeff Regan
3e4ec3a12c Merge pull request #715 from narg95/feature/add-images-docu
add 'images' documentation
2019-01-23 15:07:48 -08:00
Jeff Regan
a9dff35a24 Merge pull request #707 from narg95/feature/add-set-image-command
add set image command
2019-01-23 09:29:57 -08:00
Kubernetes Prow Robot
1cf8156c0c Merge pull request #716 from Deepomatic/fix-typo_generatorOptions_doc
Fix typo in generatorOptions example doc
2019-01-23 08:51:46 -08:00
Thomas Riccardi
f1b8fdec7f Fix typo in generatorOptions example doc 2019-01-23 10:49:39 +01:00
Nestor
62d096e57d add 'images' documentation
deprecate 'imageTags' documentation
2019-01-23 09:32:04 +01:00
Nestor
e49bd3ab1d improve image command messages 2019-01-23 08:03:19 +01:00
Jeff Regan
1edfdea5e8 Merge pull request #714 from monopole/deleteField
DataSources is now common to Secrets and ConfigMaps.
2019-01-22 19:09:59 -08:00
jregan
d141b2421c DataSources is now common to Secrets and ConfigMaps. 2019-01-22 18:57:11 -08:00
Kubernetes Prow Robot
244b3a2c59 Merge pull request #713 from monopole/moreTestOnLoader
Add more loader tests.
2019-01-22 15:45:46 -08:00
Jeffrey Regan
2e6bdd4041 Add more loader tests. 2019-01-22 14:08:28 -08:00
Kubernetes Prow Robot
077d554b76 Merge pull request #712 from monopole/readmeFix
Add bug writing instructions to README.
2019-01-22 13:28:12 -08:00
Kubernetes Prow Robot
4e058f8ece Merge pull request #711 from Liujingfang1/kind
add apiversion and kind to docs/kustomization.yaml
2019-01-22 12:57:14 -08:00
Jeffrey Regan
d4b90c8f4e Add bug writing instructions to README. 2019-01-22 11:30:55 -08:00
Jingfang Liu
fed8195eb2 add apiversion and kind to docs/kustomization.yaml 2019-01-22 11:02:35 -08:00
Nestor
b22e43a4a7 add set image command 2019-01-21 11:01:15 +01:00
Kubernetes Prow Robot
2c1be17fe7 Merge pull request #704 from narg95/feature/add-image-transformer
Add image transformer
2019-01-18 09:17:06 -08:00
Kubernetes Prow Robot
56ce6b8ba4 Merge pull request #706 from monopole/explicitlyCallOutEschewedSedBehavior
Add sed-like behavior to the eschewed feature list.
2019-01-18 09:00:27 -08:00
jregan
78bac973f7 Add sed-like behavior to the eschewed feature list. 2019-01-17 16:38:41 -08:00
Kubernetes Prow Robot
bfd61a7605 Merge pull request #699 from Liujingfang1/fix657
Allow namespaced object to refer cluster level object
2019-01-17 14:04:47 -08:00
Kubernetes Prow Robot
c40e3d12e8 Merge pull request #674 from ryane/binaryData
configmap binarydata support
2019-01-17 13:37:29 -08:00
Kubernetes Prow Robot
7568531118 Merge pull request #679 from Liujingfang1/options
make BuildOptions exported
2019-01-17 11:49:34 -08:00
ryane
87411590c5 configmap binarydata comments and small tweaks
the BinaryData map is nil until the generator finds a file with contents that
needs injected into the BinaryData field of the configmap
2019-01-17 13:19:06 -05:00
ryane
d4170797ae configmap binarydata support 2019-01-17 13:12:46 -05:00
Nestor
6616b25d66 fix comment 2019-01-17 16:02:14 +01:00
Nestor
6d56c1750f fix issues from code review 2019-01-17 15:50:34 +01:00
Kubernetes Prow Robot
4e2c4b94e3 Merge pull request #703 from Liujingfang1/changeSecretG
replace commands/envcommand by DataSource in SecretGenerator
2019-01-16 13:47:59 -08:00
Kubernetes Prow Robot
0be9815d27 Merge pull request #690 from fassmus/CloneBaseFromPrivateGit
Remove git:: prefix for all git URLs not only GitLab
2019-01-16 13:40:20 -08:00
Jingfang Liu
f7c34ccb52 Remove filesystem from ConfigMapGenerator and SecretGenerator 2019-01-16 13:33:06 -08:00
Kubernetes Prow Robot
549290c447 Merge pull request #700 from monopole/restrictLoading
Restrict loading to root or below.
2019-01-16 11:48:01 -08:00
Jingfang Liu
2fa4a34589 replace commands/envcommand by DataSource in SecretGenerator 2019-01-16 11:17:34 -08:00
Jeffrey Regan
14af70d148 Restrict loading to root or below. 2019-01-16 11:13:37 -08:00
Nestor
6dd599a983 Add image transformer 2019-01-16 16:32:53 +01:00
Florian Assmus
176ad74a1c Add unit test for additional git url patterns 2019-01-15 22:53:36 +01:00
Jingfang Liu
38f0ca9f03 Allow namespaced object to refer cluster level object 2019-01-14 15:54:09 -08:00
Jeff Regan
4d60f9229b Merge pull request #698 from monopole/cleanup
Small cleanups, no change in exec.
2019-01-14 15:44:20 -08:00
Jeffrey Regan
ea1dd08a8c Small cleanups, no change in exec. 2019-01-14 15:35:03 -08:00
Kubernetes Prow Robot
73624da253 Merge pull request #697 from grodrigues3/remove-grod
remove myself from maintainers
2019-01-14 15:10:31 -08:00
Garrett Rodrigues
78a2884b79 remove myself from maintainers 2019-01-14 14:06:02 -08:00
Kubernetes Prow Robot
e24968c679 Merge pull request #691 from monopole/fix606
Don't force all config to be explicit.
2019-01-11 15:22:55 -08:00
Jeffrey Regan
60dc3aa09d Don't force all config to be explicit. 2019-01-11 11:34:12 -08:00
Florian Assmus
94be867a54 Remove git:: prefix for all urls not only GitLab 2019-01-11 13:41:29 +01:00
Jingfang Liu
b9ab948ef2 make BuildOptions exported 2019-01-07 13:52:52 -08:00
Jeff Regan
a5c6938c65 Fix link 2019-01-07 13:02:05 -08:00
Jeff Regan
5d0c7aa6a9 Merge pull request #678 from monopole/drainMoreCode
Drain more code from kusttarget.
2019-01-06 14:51:34 -08:00
jregan
032fffe111 Drain more code from kusttarget. 2019-01-06 14:44:46 -08:00
Kubernetes Prow Robot
1b726b26cd Merge pull request #673 from monopole/introduceResAccumulator
Introduce ResAccumulator to carry data up customization stack.
2019-01-04 19:26:56 -08:00
jregan
50a8b27854 Introduce ResAccumulator. 2019-01-04 15:26:07 -08:00
Kubernetes Prow Robot
aeb2adbcfb Merge pull request #668 from monopole/deleteFileBasedTestCode
Delete deprecated file-based build test code.
2019-01-04 10:59:06 -08:00
Jeff Regan
746c7b0b5b Merge pull request #671 from monopole/fixCommentNits
Fix some comments and format nits.
2018-12-30 07:44:39 -08:00
jregan
93ad371400 Fix some comments and format nits. 2018-12-30 07:40:30 -08:00
jregan
d98afdc229 Delete deprecated file-based build test code. 2018-12-29 15:12:09 -08:00
Jeff Regan
80f3afc1ff Merge pull request #667 from monopole/convertGeneratorsNamespaceTest
Convert namespaced generators to in-memory.
2018-12-29 15:08:02 -08:00
jregan
b16a7364fd Convert namespaced generators to in-memory. 2018-12-29 15:03:26 -08:00
Jeff Regan
4b543169c8 Merge pull request #666 from monopole/convertConfigMapTests
Convert configmap tests to in-memory.
2018-12-29 14:56:39 -08:00
jregan
b7e1f8da72 Convert configmap tests to in-memory. 2018-12-29 14:51:59 -08:00
Jeff Regan
97507a92a3 Merge pull request #665 from monopole/convertCrd
Convert CRD tests to in-memory.
2018-12-29 14:30:27 -08:00
jregan
a838b85426 Convert CRD tests to in-memory. 2018-12-29 14:26:28 -08:00
Jeff Regan
92fc368ede Merge pull request #664 from monopole/fix658
Check for config merge conflicts and duplication.
2018-12-29 08:42:53 -08:00
jregan
8c994725cb Check for config merge conflicts and duplication. 2018-12-29 08:31:59 -08:00
Jeff Regan
20b13a03e0 Merge pull request #663 from monopole/convertGeneratorTests
Convert generator merge and replace tests to in-memory.
2018-12-28 09:14:28 -08:00
jregan
9dcbee1d48 Convert generator merge and replace tests to in-memory. 2018-12-28 09:09:26 -08:00
Jeff Regan
77ac84c468 Merge pull request #661 from monopole/convertVarTests
Convert variable tests to in-memory.
2018-12-28 08:31:32 -08:00
jregan
8b76799dd9 Convert variable tests to in-memory. 2018-12-28 08:24:29 -08:00
Jeff Regan
bab0421c6c Merge pull request #660 from monopole/convertMultiPatchTest
Convert multi-patch test to in-memory.
2018-12-28 07:43:21 -08:00
jregan
95203c58c4 Convert multi-patch test to in-memory. 2018-12-28 07:39:21 -08:00
Jeff Regan
ad7c90b904 Merge pull request #659 from monopole/moreConfigTests
More custom transform coverage.
2018-12-28 06:43:47 -08:00
jregan
4583c4a9de More custom transform coverage. 2018-12-28 06:38:05 -08:00
Jeff Regan
428cef54c1 Merge pull request #655 from monopole/makeTestHarness
Make KustTarget test harness to reduce boilerplate.
2018-12-24 11:42:36 -08:00
jregan
037f898f81 Make KustTarget test harness to reduce boilerplate. 2018-12-24 11:38:49 -08:00
Kubernetes Prow Robot
541754df8d Merge pull request #654 from Liujingfang1/v1beta1
change current version from v1 to v1beta1
2018-12-20 15:57:45 -08:00
Jingfang Liu
1cd99ab68e change current version from v1 to v1beta1 2018-12-20 15:32:06 -08:00
Jingfang Liu
6f566d7a38 Revert "add apiVersion and kind to docs and examples" (#653) 2018-12-20 15:19:39 -08:00
hyww
4b25963c93 List of strategic merge patches (#637)
* support List of strategic merge patches

* add test for List of patches

* handle List in SliceFromBytes

* add test for List of patches with anchor/reference

* reorganize kunstruct validate
2018-12-20 10:08:18 -08:00
Kubernetes Prow Robot
900152f724 Merge pull request #644 from Liujingfang1/kind
add apiVersion and kind to docs and examples
2018-12-19 15:20:00 -08:00
Jeff Regan
048c1dde97 Merge pull request #647 from monopole/yaTest
Yet another kusttarget test.
2018-12-18 17:09:45 -08:00
Jeffrey Regan
949fd51463 Yet another kusttarget test. 2018-12-18 17:04:46 -08:00
Jingfang Liu
dd17174b35 fix typos (#645) 2018-12-18 12:51:30 -08:00
Jingfang Liu
0d14e89549 add apiVersion and kind in README.md for examples 2018-12-18 11:22:18 -08:00
Jingfang Liu
64372a786b add apiVersion and kind to example kustomizations 2018-12-18 11:21:42 -08:00
Jingfang Liu
819b2e99d0 add apiVersion and kind to docs/kustomization.yaml 2018-12-18 11:00:50 -08:00
Kubernetes Prow Robot
d8e703d0f5 Merge pull request #643 from monopole/moarTests
More fully in-memory integration tests.
2018-12-18 10:49:46 -08:00
Jeffrey Regan
47a04f2648 More fully in-memory integration tests. 2018-12-18 10:26:19 -08:00
Jeff Regan
4af125fa2d Merge pull request #631 from monopole/addKustTargetGetAllVarsTest
Forbid Var name collisions in a kustomization stack
2018-12-17 15:37:41 -08:00
jregan
0665371590 Forbid Var name collisions in a kustomization stack 2018-12-17 15:19:58 -08:00
Jeffrey Regan
ecb83c6ae1 Add KustTarget.getAllVars Test 2018-12-17 14:54:55 -08:00
Jeff Regan
c4264daf6a Merge pull request #640 from monopole/someLargeKustTargetTests
Convert file system based test to in-memory.
2018-12-17 14:45:59 -08:00
jregan
243cbae411 Convert file system based test to in-memory. 2018-12-17 12:45:50 -08:00
Kubernetes Prow Robot
186dd20ad6 Merge pull request #639 from monopole/addSecretFactoryTest
Add secret factory test
2018-12-17 12:29:16 -08:00
Jeffrey Regan
d4ba22191a Avoid unnecessary shell execution in secretFactory. 2018-12-17 11:01:18 -08:00
Jeffrey Regan
29694e5b6a Add test for secretfactory. 2018-12-17 10:56:22 -08:00
Jeff Regan
a99f415f36 Merge pull request #636 from monopole/simplifyRefVars
Simplify refvar transformer.
2018-12-16 09:29:04 -08:00
jregan
54d6cf7087 Simplify refvar transformer. 2018-12-16 09:27:58 -08:00
Jeff Regan
e487e494f9 Merge pull request #635 from monopole/nameTransformerDocs
Improve name transformer docs.
2018-12-16 09:26:26 -08:00
jregan
11a19906b9 Improve name transformer docs. 2018-12-16 09:21:54 -08:00
Jeff Regan
65100e13b3 Merge pull request #632 from Liujingfang1/editfix
add apiVersiond and kind in tests to reduce test noise
2018-12-15 17:28:14 -08:00
Jeff Regan
3b52fd5019 Merge pull request #633 from Liujingfang1/giturl
improve url parsing function in gitcloner
2018-12-15 17:26:09 -08:00
Jingfang Liu
20e37eaf65 improve url parsing function in gitcloner 2018-12-14 15:26:39 -08:00
Jingfang Liu
b6b2fb9c62 add apiVersiond and kind in tests to reduce test noise 2018-12-14 14:58:13 -08:00
Kubernetes Prow Robot
b971e6a1da Merge pull request #630 from Liujingfang1/editfix
fix the missing fields in all edit commands
2018-12-14 14:47:06 -08:00
Kubernetes Prow Robot
087c4976b6 Merge pull request #625 from monopole/fix602
Reduce log messages.
2018-12-14 13:26:33 -08:00
Jingfang Liu
d0e4db74b7 fix the missing fields in all edit commands 2018-12-14 13:11:04 -08:00
Jeff Regan
f7414fec08 Merge pull request #628 from babiel/cronjob-jobtemplate-labels
Add spec/jobTemplate/metadata/labels to common labels transformer
2018-12-14 09:25:27 -08:00
Maximilian Gaß
8cecccbc88 Add spec/jobTemplate/metadata/labels to common labels transformer 2018-12-14 14:52:25 +01:00
Kubernetes Prow Robot
441f45e1cc Merge pull request #626 from monopole/fix616
Fix incorrect use of filepath.Separator
2018-12-13 16:45:27 -08:00
Jeffrey Regan
48e8a3aec3 Fix incorrect use of filepath.Separator 2018-12-13 16:38:39 -08:00
Kubernetes Prow Robot
3fe07888ce Merge pull request #624 from monopole/fix596
Allow directory substrings in cycle check.
2018-12-13 16:35:06 -08:00
Jeffrey Regan
77b44f570a Reduce log noise. 2018-12-13 16:29:11 -08:00
Jeffrey Regan
352ec69556 Allow directory substrings in cycle check. 2018-12-13 15:57:49 -08:00
Kubernetes Prow Robot
bd83773a1e Merge pull request #622 from monopole/meddling
Add some resId tests to support refactor.
2018-12-13 14:44:01 -08:00
Kubernetes Prow Robot
bf8b435457 Merge pull request #621 from Liujingfang1/editfix
Add subcommand: edit fix
2018-12-13 14:42:31 -08:00
Jeffrey Regan
e9b19281b2 Add some resId tests to support refactor. 2018-12-13 14:19:04 -08:00
Jingfang Liu
986c85e728 Add subcommand: edit fix 2018-12-13 14:09:55 -08:00
Kubernetes Prow Robot
8e72931a8b Merge pull request #619 from Seth-Karlo/small_typo_fix
Tiny but noticeable typo fix
2018-12-13 13:01:16 -08:00
Kubernetes Prow Robot
aeda4172e4 Merge pull request #620 from monopole/reduceSizeOfEmptyFieldMarkers
Reduce size of missing field markers.
2018-12-13 11:35:33 -08:00
Jeffrey Regan
d40f52e953 Reduce size of missing field markers. 2018-12-13 11:12:51 -08:00
Kubernetes Prow Robot
3e47a2c0a7 Merge pull request #618 from Liujingfang1/version
Add enforcement message for apiVersion and kind
2018-12-13 10:10:21 -08:00
Andy Repton
3b9cd6bedd Tiny but noticeable typo fix 2018-12-13 18:26:53 +01:00
Jingfang Liu
0759136d3f Add enforcement message for apiVersion and kind 2018-12-12 15:25:59 -08:00
Kubernetes Prow Robot
f0f8aad2bb Merge pull request #612 from Liujingfang1/gitloader
add handling function for remote url hostname
2018-12-12 10:11:51 -08:00
Jingfang Liu
259cecd4b8 add handling function for remote url hostname 2018-12-11 14:33:10 -08:00
Kubernetes Prow Robot
38873aa0fa Merge pull request #614 from richardmarshall/projected_volume_secrets
Add projected secret path to transformer config
2018-12-10 14:35:01 -08:00
Richard Marshall
506c4a330d Add projected secret path to transformer config
Projected volumes can include values sourced from secrets that might be
managed by kustomize. To support this use case this patch updates the
name reference transformer configuration to include a field spec for
projected secrets.
2018-12-10 12:41:58 -08:00
Kubernetes Prow Robot
63e4e5ccaa Merge pull request #609 from monopole/typeFix
Extract common generator args to common type.
2018-12-07 13:41:51 -08:00
Jeffrey Regan
cbcc976828 Extract common generator args to common type. 2018-12-07 13:27:19 -08:00
Jeff Regan
1ce1b82f6f Merge pull request #599 from tomaszkiewicz/generators-namespace
Add namespace for config map and secret generators
2018-12-07 12:48:11 -08:00
Kubernetes Prow Robot
b92e9ab075 Merge pull request #608 from monopole/fixNits
Require relocatable kustomizations and fix some nits.
2018-12-07 11:19:39 -08:00
Kubernetes Prow Robot
cfdae37ef5 Merge pull request #600 from Liujingfang1/apiservice
add APIService to cluster level kinds
2018-12-07 11:12:40 -08:00
Jeffrey Regan
108b3e497b Require relocatable kustomizations and fix some nits. 2018-12-07 10:46:35 -08:00
Kubernetes Prow Robot
bff228815f Merge pull request #584 from brushmate/vars-for-ingress
Add support for variable subsitution in Ingress hosts
2018-12-07 10:31:52 -08:00
Steffen Kreutz
252cf3723c Add support for variable subsitution in Ingress hosts 2018-12-07 10:02:08 +01:00
Jingfang Liu
5b88179406 add APIService to cluster level kinds 2018-12-05 10:50:24 -08:00
luktom
6ad5d9f55b Add namespace for config map and secret generators 2018-12-05 11:36:23 +01:00
Jeff Regan
8a8331bf57 Merge pull request #592 from Liujingfang1/namereference
resolve namereference in an array
2018-12-04 15:51:00 -08:00
Jingfang Liu
931f43f8d7 resolve namereference in an array 2018-12-04 15:42:26 -08:00
Jeff Regan
3c1e52bf94 Merge pull request #591 from Liujingfang1/msg
improve error message when failing to find an object to patch
2018-12-04 13:46:43 -08:00
Jingfang Liu
a62d15e746 improve error message when failing to find an object to patch 2018-12-03 09:30:31 -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
k8s-ci-robot
593f9231ae Merge pull request #583 from monopole/fix560
Ignore empty fields targeted by transformations.
2018-11-29 08:07:01 -08:00
zoncoen
59df8a0dda update docs, examples, comments 2018-11-29 22:29:52 +09:00
Jeffrey Regan
6b93973bad Fix #560 (kinda/sorta) 2018-11-28 16:46:10 -08:00
k8s-ci-robot
df3ec571fb Merge pull request #582 from monopole/preFix560
Add test for mutatefield
2018-11-28 16:38:31 -08:00
k8s-ci-robot
f03fad7a96 Merge pull request #563 from Liujingfang1/crdexample
update crd example by using configurations file list
2018-11-28 14:59:22 -08:00
Jeff Regan
f714e9faf3 another tweak 2018-11-28 14:55:48 -08:00
Jeff Regan
3e1a3d83da Minor tweaks 2018-11-28 14:53:33 -08:00
Jeffrey Regan
8ba2ea9ca7 Add test for mutatefield 2018-11-28 11:01:50 -08:00
zoncoen
7dc8ef1028 update build command testdata 2018-11-26 14:00:26 +09:00
Jeff Regan
ef51cceff5 Merge pull request #579 from monopole/deleteHashicorpCloner
Delete hashicorp cloner.
2018-11-22 17:11:12 -08:00
jregan
a40c2502de Delete hashicorp cloner. 2018-11-22 16:58:59 -08:00
Jeff Regan
0201f9cba8 Merge pull request #578 from monopole/turnOnSimpleCloner
Turn off hashicorp cloner, turn on simple cloner.
2018-11-22 16:56:56 -08:00
jregan
7c1277f24c Turn off hashicorp cloner. 2018-11-22 16:48:24 -08:00
Jeff Regan
29f03dfb55 Merge pull request #577 from monopole/fixCloner
Deal with branch spec in simpleGitCloner.
2018-11-22 16:47:51 -08:00
jregan
02d2d38c21 Deal with branch spec in simpleGitCloner. 2018-11-22 16:42:28 -08:00
k8s-ci-robot
6757efe290 Merge pull request #547 from Liujingfang1/base_var
POC: allow accessing labels and annotations in vars
2018-11-22 15:32:36 -08:00
Jeff Regan
5990af8ced Merge pull request #576 from monopole/removeStrayComment
Remove stray comment.
2018-11-22 10:39:39 -08:00
jregan
6cddc25f0e Remove stray comment. 2018-11-22 10:39:18 -08:00
Jeff Regan
8bd773b536 Merge pull request #574 from monopole/simpleGitCloner
Introduce simple git cloner.
2018-11-22 10:33:43 -08:00
jregan
d9ba209543 Introduce simple git cloner. 2018-11-22 10:24:35 -08:00
Jeff Regan
c51646e3db Merge pull request #573 from monopole/enforceRelocatability
Enforce relocatable kustomizations.
2018-11-22 09:15:08 -08:00
jregan
4f9d00c021 Enforce relocatabile kustomizations. 2018-11-22 09:07:05 -08:00
Jeff Regan
0042c4be54 Merge pull request #571 from monopole/fileRename
Rename gitloader to gitcloner.
2018-11-22 08:46:41 -08:00
jregan
910eb322e0 Rename gitloader to gitcloner. 2018-11-22 08:41:59 -08:00
Jeff Regan
064b768176 Merge pull request #570 from monopole/hotYoga
Add test coverage to gitloader.
2018-11-22 08:37:20 -08:00
jregan
4daa655516 Add test coverage to gitloader. 2018-11-22 08:27:25 -08:00
Jeff Regan
d6910e9788 Merge pull request #569 from monopole/fsRemoveAll
Add removeAll to fakeFs
2018-11-22 06:59:21 -08:00
jregan
eed16afb00 Add removeAll to fakeFs 2018-11-22 06:53:44 -08:00
Jingfang Liu
6ec77b27da update crd example by using configurations file list 2018-11-20 10:31:44 -08:00
k8s-ci-robot
621ed52bab Merge pull request #556 from zoncoen/name-suffix-2
Add nameSuffix field to kustomization.yaml
2018-11-20 08:50:22 -08:00
zoncoen
b8c2ed20d1 fix the command usage 2018-11-20 17:09:40 +09:00
k8s-ci-robot
19ad9c2d46 Merge pull request #544 from Liujingfang1/config
Remove -t flag in build and add configurations field in kustomization file
2018-11-19 16:04:44 -08:00
k8s-ci-robot
41cc210fa0 Merge pull request #546 from Liujingfang1/var
update docs for vars
2018-11-19 10:29:59 -08:00
zoncoen
3488b542ac add edit command option for editing name suffix 2018-11-19 12:09:54 +09:00
zoncoen
04a030bcf0 enable nameSuffix field of kustomization.yaml 2018-11-19 12:09:47 +09:00
Jingfang Liu
25415c5501 Remove -t flag in build and add configurations field in kustomization.yaml 2018-11-16 13:44:18 -08:00
Jingfang Liu
a094be45d9 update vendor_kustomize.sh with run-in-gopath.sh (#545) 2018-11-16 13:27:20 -08:00
k8s-ci-robot
fdb8a7d74a Merge pull request #550 from zoncoen/name-suffix-1
Enable namePrefixTransformer to append name suffix
2018-11-16 09:07:44 -08:00
zoncoen
d481dbad62 combine transformers 2018-11-15 18:49:36 +09:00
zoncoen
c1e7f1b957 fix the order of YAMLs
If suffix is empty string, ResId.String() retuns name with "noSuffix".
2018-11-15 18:29:11 +09:00
zoncoen
93094c78eb add transformer for appending suffix 2018-11-14 12:46:58 +09:00
zoncoen
a14609f730 add suffix field to ResId 2018-11-14 12:44:33 +09:00
zoncoen
a8984578e4 refactor test code for readability 2018-11-14 12:36:28 +09:00
Jingfang Liu
51e9fec65d allow accessing labels and annotations in vars 2018-11-13 15:56:06 -08:00
k8s-ci-robot
38b7f42f9e Merge pull request #543 from giannello/patch-1
Add StorageClass to the list of ordered objects
2018-11-13 11:38:12 -08:00
Jingfang Liu
e574948577 update docs for vars 2018-11-13 11:32:10 -08:00
Giuseppe Iannello
ebf1efe07e Add StorageClass to the list of ordered objects
StorageClasses can be configured as `default`, so that PVCs can use them without an explicit reference.
This change adds StorageClasses close to the beginning of the compiled output.
2018-11-13 14:51:48 +01:00
Jingfang Liu
83bc67c8ad remove glog dependency from kustomize code (#542) 2018-11-12 11:35:00 -08:00
k8s-ci-robot
1648eceb47 Merge pull request #541 from mooncak/fix_typos
Fix typos: expectd->expected, cluser->cluster
2018-11-12 08:23:30 -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
k8s-ci-robot
5b35443533 Merge pull request #537 from Liujingfang1/vendor
update vendor_kustomize.sh
2018-11-07 19:21:03 -08:00
k8s-ci-robot
e089a56e05 Merge pull request #536 from Liujingfang1/mergenil
Update TransformerConfig.Merge function to handle nil
2018-11-07 19:19:33 -08:00
k8s-ci-robot
5c4a778e6a Merge pull request #535 from monopole/deleteSomeDeps
Simplify some code and add a de-looping TODO.
2018-11-07 14:28:11 -08:00
Jingfang Liu
e0ec8028eb Update TransformerConfig.Merge function to handle nil 2018-11-07 14:05:40 -08:00
Jeff Regan
578ff2e45c Merge pull request #533 from Liujingfang1/config
fix incorrect path in default namereference configs
2018-11-07 14:02:10 -08:00
Jeffrey Regan
d04877a9e7 Simplify some code and add TODOs. 2018-11-07 13:58:14 -08:00
Jingfang Liu
727b5ebd7f update vendor_kustomize.sh 2018-11-07 13:45:38 -08:00
Jeff Regan
af1e1e6942 Merge pull request #534 from monopole/typoRepair
Add/fix some documentation and vars names.
2018-11-07 12:42:59 -08:00
Jeffrey Regan
d05bb6b199 Add/fix some documentation and vars names. 2018-11-07 12:36:25 -08:00
Jeff Regan
ba953484bf Merge pull request #522 from Liujingfang1/name
make sure the objects loaded have name and kind
2018-11-07 12:18:50 -08:00
Jeff Regan
fdf78b1d7d Merge pull request #501 from Liujingfang1/generatoroptions
Add example for generatorOptions
2018-11-07 10:55:30 -08:00
Jeff Regan
95fed47c1c Update generatorOptions.md 2018-11-07 10:53:46 -08:00
Jingfang Liu
4cf916e6f4 fix incorrect path in default namereference configs 2018-11-07 10:04:49 -08:00
k8s-ci-robot
23bf326d93 Merge pull request #530 from twz123/patch-1
Update default var reference link
2018-11-05 11:12:04 -08:00
k8s-ci-robot
bcd4d185a7 Merge pull request #529 from pst/patch-1
Fix typo in namereference path for cronjobs
2018-11-05 11:10:38 -08:00
Tom Wieczorek
57a5fa593c Update default var reference link
It has moved recently.
2018-11-05 18:15:04 +01:00
Philipp Strube
421ca3fb3c Fix typo in namereference path for cronjobs
Fix namereference for CronJob `path: spec/jobTemplate/spec/template/spec/containers/env/valueFrom/configMapKeyRef/name`
2018-11-05 14:07:32 +01:00
k8s-ci-robot
29945c2c7a Merge pull request #528 from laverya/fallback-to-string-sort-in-gvk-comparison-if-indices-equal
add fallback for GVK comparison
2018-11-02 13:07:56 -07:00
Andrew Lavery
9d82d54c5b add fallback for GVK comparison
only return comparison of 'Kind' indices if they do not match
otherwise fall back to GVK string comparison
this reduces output instability
2018-11-01 12:22:21 -07:00
Jingfang Liu
4827d9984f Add example for generatorOptions 2018-10-30 13:53:26 -07:00
Jeff Regan
d718fe3ee1 Merge pull request #525 from monopole/renameDisableHash
Rename disableHash to disableNameSuffixHash
2018-10-30 11:42:57 -07:00
Jeffrey Regan
a8fbe35ecf Rename disableHash to disableNameSuffixHash 2018-10-30 11:36:00 -07:00
Jingfang Liu
5947f696ff make sure the objects loaded have name and kind 2018-10-29 14:59:56 -07:00
k8s-ci-robot
40e0bbeec2 Merge pull request #502 from Liujingfang1/yml
add support .yml extension for kusotmization file
2018-10-29 12:33:16 -07:00
Jingfang Liu
ecbf3c5f51 add support .yml extension for kusotmization file 2018-10-29 12:21:00 -07:00
k8s-ci-robot
dfa952f0d5 Merge pull request #520 from monopole/loadingWithHistory
Consult history in fileloader.
2018-10-29 11:27:11 -07:00
jregan
793577d044 Consult history in fileloader.
Fixes #366

To reproduce #366, add

```
bases:
- .
```

to `examples/helloWorld/kustomization.yaml`, attempt to build it, and enjoy the stack overflow.

This PR fixes this by adding history to file loaders,
allowing one to avoid cycles in overlay->base
relationships.  To make entry points clearer, this PR
exposes only two public ways to make a fresh
(no-history) loader

 * rooted at `/`
 * rooted at the process's current working directory.

When making a new loader from an existing loader,
retaining history along an overlay trace, the only
allowed use is to go deeper into a file hierarchy, or
go up and over to a never before visited sibling. This
fix can probably be defeated by devious symbolic links.
2018-10-29 11:10:21 -07:00
Jeff Regan
1224dc0c87 Merge pull request #517 from monopole/testCleanup
Improve test coverage.
2018-10-28 14:17:44 -07:00
jregan
885c1952a4 Improve test coverage. 2018-10-28 13:52:25 -07:00
k8s-ci-robot
383b3e798b Merge pull request #516 from kubernetes-sigs/revert-488-prefix
Revert "Skip adding nameprefix to namespace"
2018-10-26 16:07:54 -07:00
Jingfang Liu
1020167e22 Revert "Skip adding nameprefix to namespace" 2018-10-26 14:42:27 -07:00
k8s-ci-robot
3c242f58da Merge pull request #515 from kubernetes-sigs/revert-500-namespace
Revert "create namespace resource if not found"
2018-10-26 14:25:03 -07:00
Jingfang Liu
f8a18ce662 Revert "create namespace resource if not found" 2018-10-26 14:01:53 -07:00
k8s-ci-robot
6a917c5f36 Merge pull request #508 from ryane/fix-507
kustomize build loads transformer configs when path argument omitted
2018-10-26 11:10:14 -07:00
k8s-ci-robot
7af1f206aa Merge pull request #513 from sethpollack/patch-1
fix spelling
2018-10-26 10:48:29 -07:00
k8s-ci-robot
0714abfe79 Merge pull request #511 from BenTheElder/export-factory
make k8sdeps.NewFactory() importable
2018-10-26 10:43:55 -07:00
Seth Pollack
6037734641 fix spelling 2018-10-25 22:28:22 -04:00
Benjamin Elder
76ba38cec5 make k8sdeps.NewFactory() importable 2018-10-25 17:21:58 -07:00
k8s-ci-robot
5c918dc56a Merge pull request #510 from ryane/fix-509
fix goreleaser version injection
2018-10-25 16:52:10 -07:00
k8s-ci-robot
292ed0e605 Merge pull request #503 from BenTheElder/prune-vendor
Prune vendor
2018-10-25 16:27:29 -07:00
ryane
e97960c2f0 fix goreleaser version injection
version command and vars moved into misc package
2018-10-25 10:47:10 -04:00
ryane
9f73341271 kustomize build loads transformer configs when path argument omitted 2018-10-25 09:56:46 -04:00
Benjamin Elder
163515c5a0 dep ensure 2018-10-24 17:24:58 -07:00
Benjamin Elder
41845522f6 enable dep pruning and gitignore macOS DS_Store 2018-10-24 17:15:07 -07:00
k8s-ci-robot
ec86b30d2b Merge pull request #498 from Liujingfang1/doc
Add example for transformer configurations: crd
2018-10-24 12:13:53 -07:00
Jingfang Liu
a90c957463 Add example for transformer configurations: crd 2018-10-24 12:08:48 -07:00
k8s-ci-robot
18a2321ddd Merge pull request #500 from Liujingfang1/namespace
create namespace resource if not found
2018-10-23 15:33:16 -07:00
Jingfang Liu
a5f0d457ec create namespace resource if not found 2018-10-23 13:46:03 -07:00
k8s-ci-robot
368b7f3939 Merge pull request #497 from Liujingfang1/generatoroptions
Allow setting shell and timeout in generatorOptions
2018-10-22 16:15:06 -07:00
k8s-ci-robot
e4dfbe79e1 Merge pull request #496 from Liujingfang1/master
enable preserving order with generatorOptions
2018-10-22 16:13:01 -07:00
Jingfang Liu
fdf5fa58d3 Allow setting shell and timeout in generatorOptions 2018-10-22 16:10:56 -07:00
Jingfang Liu
9ef96e9bb2 enable preserving order with generatorOptions 2018-10-22 16:01:46 -07:00
k8s-ci-robot
a8e393496f Merge pull request #495 from monopole/testFieldOrdering
Test field output ordering.
2018-10-19 17:32:54 -07:00
Jeffrey Regan
6b302443e6 Test field output ordering. 2018-10-19 16:20:23 -07:00
Jeff Regan
3fdf7a0b88 Merge pull request #494 from Liujingfang1/generatoroptions
allow add labels/annotations to generated resources
2018-10-19 16:01:53 -07:00
Jingfang Liu
0cb02f1448 allow add labels/annotations to generated resources 2018-10-19 15:40:06 -07:00
k8s-ci-robot
8b09afdf3e Merge pull request #493 from Liujingfang1/options
skip hash transformer when DisableHash is set to true
2018-10-19 15:25:14 -07:00
Jingfang Liu
23963e854a skip hash transformer when DisableHash is set to true 2018-10-19 14:44:23 -07:00
k8s-ci-robot
04167cf77e Merge pull request #487 from monopole/deletePenultimateUseOfDeprecatedField
Delete penultimate use of Patches field.
2018-10-19 14:28:05 -07:00
k8s-ci-robot
6f0a01fcf4 Merge pull request #490 from Liujingfang1/options
Add generatorOptions in Kustomization type
2018-10-19 14:18:42 -07:00
Jingfang Liu
0824433260 Add generatorOptions in Kustomization type 2018-10-19 14:12:33 -07:00
Jeffrey Regan
3e0f5ea327 Delete penultimate use of Patches field. 2018-10-19 11:26:05 -07:00
k8s-ci-robot
a4be48eb32 Merge pull request #488 from Liujingfang1/prefix
Skip adding nameprefix to namespace
2018-10-19 10:02:43 -07:00
Jingfang Liu
90d03b0afe Skip adding nameprefix to namespace 2018-10-18 13:52:11 -07:00
k8s-ci-robot
37802e1026 Merge pull request #485 from monopole/deleteSomeUnnecessaryParmPassing
Delete some unnecessary parameter passing.
2018-10-18 11:57:28 -07:00
k8s-ci-robot
16add04ccf Merge pull request #477 from Liujingfang1/sa
skip filtering resmap when the resource is a cluster level resource
2018-10-18 11:21:10 -07:00
Jingfang Liu
90c88d7f96 skip filtering resmap when the resource is a cluster level resource 2018-10-18 11:09:24 -07:00
Jeffrey Regan
2b0e2725f9 Delete some unnecessary parameter passing. 2018-10-18 10:59:59 -07:00
k8s-ci-robot
66bbae586f Merge pull request #483 from Liujingfang1/fieldspec
add commonLabel fieldpath for volumeClaimTemplates
2018-10-18 10:46:27 -07:00
k8s-ci-robot
d2ac2df372 Merge pull request #482 from Liujingfang1/validators
fix kustomize edit add label bug
2018-10-18 10:45:06 -07:00
Jingfang Liu
d5aed20f0a add commonLabel fieldpath for volumeClaimTemplates 2018-10-18 10:25:19 -07:00
k8s-ci-robot
42fcdef9f0 Merge pull request #481 from monopole/deleteExec
Delete unused exec package.
2018-10-18 10:12:37 -07:00
Jingfang Liu
482811460d fix kustomize edit add label bug 2018-10-18 10:01:18 -07:00
Jeffrey Regan
8fd93030b4 Delete unused exec package. 2018-10-18 09:54:45 -07:00
k8s-ci-robot
5db1ef23fe Merge pull request #475 from Liujingfang1/namespace
add namespace to id when create resmap from files
2018-10-17 16:45:00 -07:00
Jingfang Liu
14fc54e323 add namespace to id when create resmap from files 2018-10-17 16:22:19 -07:00
Jeff Regan
3d1d1f0bb8 Merge pull request #478 from monopole/messWithTypesDoc
Improve kustomization.go comments.
2018-10-17 14:24:39 -07:00
jregan
a5f56027b5 Improve kustomization.go comments. 2018-10-17 14:24:20 -07:00
k8s-ci-robot
bad3ccddc3 Merge pull request #473 from Liujingfang1/script
add script build/vendor_kustomize.sh
2018-10-16 17:26:43 -07:00
Jingfang Liu
da35a219d1 add script build/vendor_kustomize.sh 2018-10-16 15:53:04 -07:00
Jingfang Liu
8209aeea6d fix copyright misalignment (#472) 2018-10-16 11:02:47 -07:00
Jeff Regan
2d2315c4c4 Merge pull request #471 from Liujingfang1/dep
downgrade the transitive dependency to be consistent with kubernetes
2018-10-16 10:01:16 -07:00
Jingfang Liu
c6a78cee92 change github.com/aws/aws-sdk-go to be the same revision in kubernetes 2018-10-16 09:35:05 -07:00
Jingfang Liu
e0958159f3 change golang.org/x/net to be the same revision as used in kubernetes 2018-10-16 09:35:04 -07:00
Jingfang Liu
9d804ba3a8 fix lint errors in internal (#469) 2018-10-15 13:38:32 -07:00
Jingfang Liu
808df20cdb add missing lines after copyright (#468) 2018-10-15 12:02:41 -07:00
k8s-ci-robot
c46d2ce791 Merge pull request #467 from monopole/deleteSomeKunstructCode
Delete some kunstruct code in favor of apimachinery code.
2018-10-15 10:57:38 -07:00
jregan
f20528be35 Delete some kunstruct code in favor of apimachinery code. 2018-10-15 10:23:03 -07:00
k8s-ci-robot
5253747c00 Merge pull request #466 from monopole/improveGetFieldValueCoverage
Improve unstruct test coverage and error messages.
2018-10-15 09:58:19 -07:00
jregan
aaee97c0fa Improve unstruct test coverage and error messages. 2018-10-15 09:44:00 -07:00
Jeff Regan
d82c40c9fe Merge pull request #465 from monopole/moveYamlCheck
Move yaml check to file in which it is called.
2018-10-15 09:40:31 -07:00
jregan
dcc9c4d31a Move yaml check to file in which it is called. 2018-10-15 09:20:01 -07:00
k8s-ci-robot
3b119fb707 Merge pull request #463 from monopole/moarTesting
Objectify nbrSlice code.
2018-10-12 17:22:55 -07:00
Jeffrey Regan
b198b65d52 Objectify nbrSlice code. 2018-10-12 16:27:50 -07:00
k8s-ci-robot
f94974cc2c Merge pull request #462 from monopole/fixTransformConfigNames
Fix names/doc in transformation config code.
2018-10-12 13:41:49 -07:00
Jeffrey Regan
d9f9a51e55 Fix names/doc in transformation config code. 2018-10-12 13:36:22 -07:00
Jeff Regan
111f41785f Merge pull request #458 from camilosampedro/master
Notes on mySql example
2018-10-12 09:52:48 -07:00
Camilo Sampedro
e65995cd32 Notes on mySql example
mySql example was not running without the persistent disk nor the secret
called as it should.
2018-10-12 14:35:21 +09:00
k8s-ci-robot
ea9d5e3670 Merge pull request #455 from Liujingfang1/factory
Add KustFactory as a wrapper of all factories
2018-10-11 16:06:45 -07:00
Jingfang Liu
40b2bf76ae Add KustFactory as a wrapper of all factories 2018-10-11 13:51:27 -07:00
k8s-ci-robot
6fa110d4fd Merge pull request #457 from Liujingfang1/split
split k8sdeps package into sub packages
2018-10-11 11:36:00 -07:00
Jingfang Liu
d33d154e14 split k8sdeps package into sub packages 2018-10-11 11:30:46 -07:00
Jeff Regan
483d329556 Merge pull request #456 from Liujingfang1/configmap
use fake filesystem in configmapandsecret tests
2018-10-11 11:24:43 -07:00
Jingfang Liu
f3e4615a33 use FakeFileSystem in configmapandsecret tests 2018-10-11 11:04:26 -07:00
Jeff Regan
9106cee216 Merge pull request #454 from yanc0/literals-documentation
Literals documentation configMap Generation
2018-10-11 09:18:20 -07:00
Yann
2d26d95a98 fix indent 2018-10-11 09:16:14 +02:00
Yann
5745d030fb Add literals in configMapGenerator example 2018-10-11 09:14:06 +02:00
Jeff Regan
9f7eccc68f Merge pull request #453 from monopole/docFix
Update ptrs to DAM doc.
2018-10-10 16:20:58 -07:00
Jeffrey Regan
3fe047f79c Update ptrs to DAM doc. 2018-10-10 16:16:15 -07:00
k8s-ci-robot
9897ce8bf2 Merge pull request #452 from Liujingfang1/config
move transformerconfig package to transformers/config
2018-10-10 15:17:06 -07:00
Jingfang Liu
c33a97fcf2 move transformerconfig package to transformers/config 2018-10-10 15:12:32 -07:00
k8s-ci-robot
ca4a5d33f0 Merge pull request #451 from Liujingfang1/hash
add MakeHashTransformer in TransformerFactory; remove hash interface
2018-10-10 14:10:48 -07:00
Jingfang Liu
2953dad221 add MakeHashTransformer in TransformerFactory; remove hash interface 2018-10-10 14:05:13 -07:00
Jeff Regan
f35a11ff37 Merge pull request #450 from monopole/crdToFactory
Move crd package to transformerconfig.factory.
2018-10-10 13:29:25 -07:00
Jeffrey Regan
8534107fc8 Move crd package to transformerconfig.factory. 2018-10-10 13:14:43 -07:00
k8s-ci-robot
681e2bf213 Merge pull request #449 from monopole/tcFactory
Consolidate TransformerConfig creation to factory.
2018-10-10 13:04:07 -07:00
Jeffrey Regan
2283c06971 Consolidate transformer config creation to factory. 2018-10-10 12:33:19 -07:00
Jeff Regan
bb9435a604 Merge pull request #448 from Liujingfang1/decoder
remove decoder interface since it is only used inside k8sdeps
2018-10-10 12:01:15 -07:00
Jingfang Liu
96091dfcf5 remove decoder interface since it is only used inside k8sdeps 2018-10-10 11:08:23 -07:00
k8s-ci-robot
cf4a1ba083 Merge pull request #446 from Liujingfang1/gvk
remove dependency on apimachinery from gvk package
2018-10-09 17:26:42 -07:00
Jingfang Liu
4c7b63a215 remove dependency on apimachinery from gvk package 2018-10-09 16:25:25 -07:00
k8s-ci-robot
1e04a0e943 Merge pull request #445 from Liujingfang1/typemeta
copy TypeMeta from apimachinery
2018-10-09 16:18:09 -07:00
Jingfang Liu
f7353b1295 copy TypeMeta from apimachinery 2018-10-09 16:10:17 -07:00
k8s-ci-robot
dbf04985c4 Merge pull request #444 from Liujingfang1/configmap
hide core/v1 behind interface
2018-10-09 16:00:09 -07:00
Jingfang Liu
f783486057 hide core/v1 behind interface 2018-10-09 15:50:52 -07:00
Jeff Regan
0faef46773 Merge pull request #443 from ryancox/use-go-1.11
Use Go 1.11 for CI Builds
2018-10-09 15:02:54 -07:00
Ryan Cox
cbd7a1bb58 Use Go 1.11 2018-10-09 14:44:05 -07:00
k8s-ci-robot
19ac0e9327 Merge pull request #426 from schweikert/add_jsonpatch_yaml_test
Add jsonpatch yaml test
2018-10-09 13:26:51 -07:00
David Schweikert
b5cf3a2146 add yaml-version of jsonpatch tests 2018-10-09 21:04:34 +02:00
Jeff Regan
5cf0cbe041 Merge pull request #440 from monopole/fix428
Maintain fields of TransformerConfig in sorted order.
2018-10-09 10:47:55 -07:00
jregan
df5c3ab91e Maintain fields of TransformerConfig in sorted order.
Not needed for execution, just makes logging and tests deterministic.
Related to #428
2018-10-09 10:14:57 -07:00
Jeff Regan
5b95db2208 Merge pull request #441 from monopole/replantTree
Replant tree (needed for example tests).
2018-10-09 10:09:36 -07:00
Jeffrey Regan
22d955b3a9 Replant tree (needed for example tests). 2018-10-09 10:05:50 -07:00
Jeff Regan
b7fa38e2e7 Merge pull request #437 from ryancox/golangci-lint
port to golangci and make travisci improvements
2018-10-09 09:36:05 -07:00
Jeff Regan
b16c85888e Merge pull request #435 from Liujingfang1/flakytest
fix the flaky test in crd package
2018-10-09 09:33:20 -07:00
Ryan Cox
261d64ec1d port to golangci and make travisci improvements 2018-10-09 00:58:34 -07:00
Jingfang Liu
62f7cdbb43 fix the flaky test in crd package 2018-10-08 16:06:35 -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
Jeff Regan
fd3cd64e11 Merge pull request #433 from Liujingfang1/patchtransformer
hide patch transformer behind interface
2018-10-08 15:32:49 -07:00
k8s-ci-robot
536cd8d45e Merge pull request #432 from monopole/mergeResmapFactoryCode
Gather resmap factory code into one file.
2018-10-08 15:17:46 -07:00
Jingfang Liu
78de5374ed hide patch transformer behind interface 2018-10-08 15:15:03 -07:00
Jeffrey Regan
aff76e0d0e Gather resmap factory code into one file. 2018-10-08 15:09:22 -07:00
k8s-ci-robot
0f4ab07324 Merge pull request #431 from Liujingfang1/error
remove apimachinery dependency from internal/error package
2018-10-08 14:54:40 -07:00
Jingfang Liu
08da2455dd remove apimachinery dependency from internal/error package 2018-10-08 14:32:24 -07:00
Jingfang Liu
8e0c55f9fa remove apimachinery dependency from crd package (#430) 2018-10-08 14:27:18 -07:00
Jeff Regan
00b4beda91 Merge pull request #429 from monopole/kunstructedFactory
Further isolate unstructured with factories.
2018-10-08 14:26:32 -07:00
Jeffrey Regan
1af119db80 Further isolate unstructured with factories. 2018-10-08 14:21:48 -07:00
jregan
4eb2757847 Further isolate unstructured with factories. 2018-10-08 11:52:38 -07:00
k8s-ci-robot
3cdfbd843b Merge pull request #423 from monopole/hideUnstruct
Hide unstructured.Unstructured behind interface.
2018-10-08 11:21:45 -07:00
jregan
0f5a39f328 Hide unstructured.Unstructured behind interface. 2018-10-08 11:12:06 -07:00
k8s-ci-robot
9c8302b2d2 Merge pull request #427 from ryancox/resmap-tests
add tests for resmap
2018-10-08 10:57:22 -07:00
Ryan Cox
e5ea1b0a19 typo 2018-10-08 10:16:10 -07:00
Ryan Cox
e6558fb9fc PR comments 2018-10-08 10:13:05 -07:00
k8s-ci-robot
b67f8d2b7b Merge pull request #425 from schweikert/mac_sed
use 'sed -i.bak' instead of 'sed -i' to make it compatible with macos…
2018-10-08 08:53:24 -07:00
k8s-ci-robot
5c92f09dd0 Merge pull request #422 from schweikert/issue_368
unify processing of JSON6902 patches for both json and yaml format
2018-10-08 08:35:15 -07:00
Ryan Cox
f2f1125e44 add tests for resmap 2018-10-07 21:57:20 -07:00
David Schweikert
6d4ad82262 use 'sed -i.bak' instead of 'sed -i' to make it compatible with macos sed 2018-10-07 22:26:15 +02:00
Jeff Regan
7cf5f8caae Merge pull request #421 from Liujingfang1/hash
Add hash interface
2018-10-05 14:33:17 -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
Jingfang Liu
5036a12a65 Add hash interface 2018-10-05 13:29:06 -07:00
k8s-ci-robot
489f6e2e67 Merge pull request #416 from monopole/residPackage
Move ResId to its own package.
2018-10-05 13:13:52 -07:00
Jeffrey Regan
c9887e8c15 WIP residPackage 2018-10-05 12:58:48 -07:00
Jeff Regan
239db504ff Merge pull request #418 from Liujingfang1/hash
combine HashComfigMap and HashSecret to Hash
2018-10-05 12:58:31 -07:00
Jeff Regan
9b7ce3b6ba Merge pull request #419 from monopole/deleteMakeUnstruct
Delete unused unstruct code.
2018-10-05 12:46:13 -07:00
Jeffrey Regan
3b86e64faf Delete unused unstruct code. 2018-10-05 12:39:45 -07:00
Jingfang Liu
c3ae23d3a5 combine HashComfigMap and HashSecret to Hash 2018-10-05 12:02:58 -07:00
k8s-ci-robot
73e28ca556 Merge pull request #411 from Liujingfang1/hash
decouple configmapandsecret and hash packages
2018-10-05 09:39:18 -07:00
Jeff Regan
a634da4d19 Merge pull request #415 from monopole/nits
Fix some go nits.
2018-10-05 07:38:37 -07:00
Jeffrey Regan
a3dce9409b Fix some go nits. 2018-10-05 07:33:54 -07:00
Jingfang Liu
a9cf1975ca decouple configmapandsecret and hash packages 2018-10-04 16:17:23 -07:00
k8s-ci-robot
51ece9412e Merge pull request #407 from monopole/cmdSplit
Improve command package isolation.
2018-10-03 20:09:45 -07:00
Jeff Regan
b37258edf0 Merge pull request #406 from schweikert/fix_issue_335
error out if patchesJson6902 target can't be found, fixes #335
2018-10-03 16:32:48 -07:00
Jeffrey Regan
bb9fafa6cc Improve command package isolation. 2018-10-03 16:29:04 -07:00
Jeff Regan
f5fee4decf Merge pull request #405 from monopole/generaterIsolation
Isolate generator calls.
2018-10-03 16:28:36 -07:00
David Schweikert
279826f6d6 error out if patchesJson6902 target can't be found, fixes #335 2018-10-03 21:53:45 +02:00
Jeffrey Regan
56e11b57e3 Isolate generator calls. 2018-10-03 12:09:53 -07:00
k8s-ci-robot
6d65049221 Merge pull request #404 from monopole/deprecationFix
Deal with field deprecation immediately after load.
2018-10-03 11:24:13 -07:00
Jeffrey Regan
65ee4e4f2a Deal with field deprecation immediately after load. 2018-10-03 10:55:35 -07:00
k8s-ci-robot
a1538c5610 Merge pull request #403 from monopole/isolateK8sdeps
Isolate k8sdeps to top level internal.
2018-10-03 10:54:40 -07:00
Jeffrey Regan
e32e5c21d7 Isolate k8sdeps to top level internal. 2018-10-03 10:21:43 -07:00
k8s-ci-robot
132cdad7c4 Merge pull request #400 from Liujingfang1/decoder
Add validator interface
2018-10-02 17:14:37 -07:00
Jingfang Liu
fa89a0ab4d Add validator interface 2018-10-02 15:09:19 -07:00
k8s-ci-robot
ad093555a6 Merge pull request #398 from monopole/injectDecoder
Introduce k8sdeps package to isolate k8s deps.
2018-10-02 13:41:55 -07:00
k8s-ci-robot
2fbccdd05b Merge pull request #394 from Liujingfang1/var
use local types in var reference
2018-10-02 11:52:43 -07:00
k8s-ci-robot
eb985a8af0 Merge pull request #397 from Liujingfang1/issue395
fix kustomize edit add label bug
2018-10-02 11:48:49 -07:00
jregan
8f150d84ae Introduce k8sdeps package to isolate k8s deps. 2018-10-02 11:36:53 -07:00
Jingfang Liu
74d8575097 fix kustomize edit add label bug 2018-10-02 10:44:35 -07:00
Jingfang Liu
71c3cf163e use local types in var reference 2018-10-02 10:25:28 -07:00
k8s-ci-robot
b95423285f Merge pull request #393 from monopole/resourceTests
Add tests for patch/resource reading.
2018-10-01 14:47:51 -07:00
jregan
24733315d7 Add tests for patch/resource reading. 2018-10-01 14:25:15 -07:00
Jeff Regan
fbc38d0c60 Merge pull request #390 from monopole/fixPatchNaming
Spelling nits.
2018-10-01 11:24:25 -07:00
k8s-ci-robot
8b5c4aa591 Merge pull request #391 from Liujingfang1/string
change sets.NewString() to []string
2018-10-01 11:13:52 -07:00
jregan
c9aff4c47a Spelling nits. 2018-10-01 10:56:35 -07:00
Jingfang Liu
8a8f35863c change sets.NewString() to []string 2018-10-01 10:53:39 -07:00
k8s-ci-robot
9a5d759230 Merge pull request #389 from Liujingfang1/pathconfig
add command to save the default transformer configurations to local files
2018-10-01 10:24:45 -07:00
Jingfang Liu
94c3b1212e add command to save the default transformer configurations to local files 2018-10-01 09:48:38 -07:00
k8s-ci-robot
c129a3d3b8 Merge pull request #385 from monopole/fixNits
Fix some Go nits.
2018-09-30 18:40:07 -07:00
jregan
6d935b6a4a Fix some Go nits. 2018-09-28 18:08:36 -07:00
k8s-ci-robot
8f903b6e3f Merge pull request #384 from monopole/renameApp
Rename Application to KustTarget
2018-09-28 14:34:38 -07:00
jregan
78139957d2 Rename Application to KustTarget 2018-09-28 14:07:01 -07:00
Jeff Regan
ffffbedf41 Merge pull request #383 from Liujingfang1/buildflag
Add flag to load transfomer configurations from files
2018-09-28 14:02:52 -07:00
Jingfang Liu
fb6130e1e0 Add flag to load transfomer configurations from files 2018-09-28 13:57:29 -07:00
k8s-ci-robot
4c94f3ec38 Merge pull request #382 from Liujingfang1/pathconfig
enable crd testcase
2018-09-28 11:33:47 -07:00
Jingfang Liu
d67425daf1 enable crd testcase 2018-09-28 10:48:16 -07:00
k8s-ci-robot
48065cc694 Merge pull request #381 from monopole/simplify
Simplify default config construction.
2018-09-28 10:31:23 -07:00
jregan
f35e16bd8d Simplify default config code. 2018-09-28 10:20:20 -07:00
k8s-ci-robot
986c7cc31b Merge pull request #380 from Liujingfang1/pathconfig
remove hard coded pathconfig
2018-09-28 10:01:41 -07:00
Jingfang Liu
078c90cabe remove hard coded pathconfig 2018-09-28 09:28:39 -07:00
k8s-ci-robot
30597252c7 Merge pull request #379 from Liujingfang1/pathconfig
Modify PathConfig.PathSlice method and add tests
2018-09-27 16:30:47 -07:00
Jingfang Liu
d8b27ef8fe Modify PathConfig.PathSlice method and add tests 2018-09-27 15:36:37 -07:00
k8s-ci-robot
19197a490e Merge pull request #378 from monopole/stringStuff
Increase sort determinism.
2018-09-27 13:46:23 -07:00
Jeffrey Regan
317833aeff Increase sort determinism. 2018-09-27 13:29:00 -07:00
k8s-ci-robot
acf989f1be Merge pull request #377 from Liujingfang1/pathconfig
Refactor crd package to depend on transformerconfig
2018-09-27 13:07:14 -07:00
Jingfang Liu
7ab710889c Refactor crd package to depend on transformerconfig 2018-09-27 10:39:29 -07:00
Jeff Regan
8ef87309a2 Merge pull request #315 from nikhita/fix-template-files
Move template files from docs/ to root
2018-09-27 09:30:33 -07:00
k8s-ci-robot
20fa90a137 Merge pull request #376 from monopole/gvk
Introduce gvk package to isolate apimachinery schema.
2018-09-26 16:45:15 -07:00
Jeffrey Regan
fb355eb320 Introduce gvk package to isolate apimachinery schema. 2018-09-26 15:02:38 -07:00
k8s-ci-robot
8aa0cc145c Merge pull request #375 from monopole/resIdTest
Add resid tests.
2018-09-26 13:49:36 -07:00
k8s-ci-robot
e276fc71c7 Merge pull request #373 from Liujingfang1/pathconfigmore
add default configurations for different transformers
2018-09-26 13:41:44 -07:00
Jeff Regan
119c3e3b24 Merge pull request #367 from OpenSourceZombie/patch-2
missing : after patchesJson6902 in the example file kustomization.yaml
2018-09-26 13:40:31 -07:00
Jeffrey Regan
67adc56c73 Add resid tests. 2018-09-26 13:31:25 -07:00
k8s-ci-robot
97a771d1e2 Merge pull request #374 from Liujingfang1/integrationtest
fix integration test script
2018-09-26 11:38:53 -07:00
Jingfang Liu
c27279ce7a fix integration test script 2018-09-26 11:20:10 -07:00
Jingfang Liu
13c368a2db add default configurations for different transformers 2018-09-26 11:11:29 -07:00
Jeff Regan
2f47e298d2 Merge pull request #371 from monopole/oddHgStuff
Goland wants these vendored hg files.
2018-09-25 11:56:41 -07:00
Jeffrey Regan
188ede2cd4 Goland wants these vendored hg files. 2018-09-25 11:55:55 -07:00
Jeff Regan
f23419fde6 Merge pull request #361 from Liujingfang1/pathconfig
Add transformer config package
2018-09-25 11:50:42 -07:00
theShirbiny
c614f4b5de missing : after patchesJson6902 2018-09-24 17:55:32 +02:00
k8s-ci-robot
3266716584 Merge pull request #356 from liuhuiping2013/master
remove metadata.creationTimestamp field from configMapGenerator
2018-09-21 09:46:02 -07:00
Jingfang Liu
8cc6df51f3 Add transformerconfig package and default configs 2018-09-19 11:14:14 -07:00
Jeff Regan
6b1ffe13a0 Merge pull request #357 from greghaynes/fix/install-sigs.k8s.io
Update install doc to use sigs.k8s.io
2018-09-18 13:50:29 -07:00
Gregory Haynes
ce3daf254f Update install doc to use sigs.k8s.io
When using go get github.com/kubernetes-sigs/kustomize running kustomize
panics with 'log_dir redefined'.
2018-09-18 19:03:06 +00:00
liuhuiping
6c5a75bf73 remove metadata.creationTimestamp field from configMapGenerator 2018-09-18 18:35:40 +08:00
k8s-ci-robot
58492e2d83 Merge pull request #349 from Liujingfang1/master
fix the release and build files
2018-09-13 12:00:36 -07:00
Jingfang Liu
a9f44aa259 fix the release and build files 2018-09-13 11:51:47 -07:00
k8s-ci-robot
b17d7fbbfd Merge pull request #339 from lswith/master
treat sub paths correctly
2018-09-13 09:24:09 -07:00
Luke Swithenbank
d78e77fb92 fix remote build's for subdirectories 2018-09-13 09:56:04 +10: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
Jeff Regan
a377ec1dde Merge pull request #342 from Liujingfang1/master
remove dependency on internal error
2018-09-12 11:08:52 -07:00
Jingfang Liu
87e9964091 Merge pull request #341 from ebriand/patch-1
Fix typo in multibases readme
2018-09-12 09:17:21 -07:00
Jingfang Liu
60d8334fed remove dependency on internal error 2018-09-11 15:23:30 -07:00
Eric Briand
71f5105a86 Fix typo on staging 2018-09-11 13:33:28 +02:00
Jeff Regan
09a62efe88 Merge pull request #331 from burdiyan/master
Implement support for digests in imageTags
2018-09-10 10:57:53 -07:00
Alexandr Burdiyan
6dbf4b5b60 Apply code review recommendations 2018-09-10 11:48:47 +02:00
Alexandr Burdiyan
5401bd367b Implement support for digests in imageTags
This commit adds a new field to imageTags transformer
so that digests can be used instead of image tags if needed.

Closes https://github.com/kubernetes-sigs/kustomize/issues/326
2018-09-10 11:21:53 +02:00
Jeff Regan
f7def79764 Merge pull request #333 from monopole/deleteCode
Remove duplicate code.
2018-09-09 13:51:54 -07:00
jregan
cda909a609 Remove duplicate code. 2018-09-09 12:33:23 -07:00
k8s-ci-robot
6f61cadf9f Merge pull request #325 from Liujingfang1/master
Add examples and docs for patchesJson6902
2018-09-07 13:14:34 -07:00
Jingfang Liu
1c616b1962 Add examples and docs for patchesJson6902 2018-09-07 11:55:12 -07:00
Jeff Regan
849343fb41 Merge pull request #324 from Liujingfang1/master
Enable jsonpath transformers in application
2018-09-06 14:18:47 -07:00
Jingfang Liu
8810027d89 Enable jsonpath transformers in application 2018-09-06 14:02:30 -07:00
k8s-ci-robot
548ea8a9fb Merge pull request #323 from Liujingfang1/master
remove inline json patch format
2018-09-06 13:36:19 -07:00
Jingfang Liu
81b5cf65d6 remove inline json patch format 2018-09-06 11:18:19 -07:00
Jeff Regan
dc9ae64646 Merge pull request #321 from Liujingfang1/multibases
filter by namespace, prefix and detect conflict when resolving name reference
2018-09-05 16:10:53 -07:00
Jingfang Liu
829cb2baa3 address comments 2018-09-05 16:08:24 -07:00
Jingfang Liu
7b301446fa filter by namespace and nameprefix in namereference transformer 2018-09-05 13:17:44 -07:00
Jingfang Liu
4a297fa138 improve idslice 2018-09-05 13:02:51 -07:00
Jingfang Liu
7811d9f2bc Add multibases test with namereference conflict 2018-09-05 13:01:56 -07:00
Jingfang Liu
21ff81b758 Add multibases test with namereference nonconflict 2018-09-05 13:01:15 -07:00
Jingfang Liu
485bbddd3e Merge pull request #320 from Liujingfang1/master
remove go get varcheck
2018-09-04 15:43:59 -07:00
Jingfang Liu
6dc80293a6 remove go get varcheck 2018-09-04 15:07:38 -07:00
Jeff Regan
b649ad5c69 Merge pull request #310 from Liujingfang1/patchtransformer
Update patch factory and add multi transformer with checking conflicts
2018-09-04 09:32:08 -07:00
Jingfang Liu
d782abb214 Update patch factory and add multi transformer with checking conflicts 2018-09-04 09:13:26 -07:00
k8s-ci-robot
95f5becee1 Merge pull request #312 from monopole/fixSomeImports
Remove some unnecessary import renames.
2018-09-04 08:31:31 -07:00
Nikhita Raghunath
cdb78cbdd3 Move template files from docs/ to root 2018-09-01 20:22:22 +05:30
k8s-ci-robot
694d809f33 Merge pull request #313 from monopole/fixMarkdownLinks
Fix some busted documentation links.
2018-08-31 18:30:41 -07:00
k8s-ci-robot
df3c3c3357 Merge pull request #314 from monopole/noCleanup
Remove unread variable.
2018-08-31 18:29:25 -07:00
Jeffrey Regan
99e770b05a Remove unused variable. 2018-08-31 17:25:00 -07:00
Jeffrey Regan
340cb2b385 Remove unnecessary import aliases. 2018-08-31 17:20:03 -07:00
Jeffrey Regan
cdbd83a645 Fix some busted documentation links. 2018-08-31 17:05:32 -07:00
Jeff Regan
fab2a5a5d7 Merge pull request #311 from monopole/updateDeps
Add gopkg.in/yaml.v2 to Gopkg.lock
2018-08-31 16:24:16 -07:00
Jeffrey Regan
8da2f37181 Add gopkg.in/yaml.v2 to Gopkg.lock 2018-08-31 16:20:18 -07:00
k8s-ci-robot
c906a0c16e Merge pull request #309 from monopole/cleanupAddLabels
Simplify addmetadata.
2018-08-31 16:13:31 -07:00
Jeffrey Regan
93618166b6 Cleanup addmetadata. 2018-08-31 15:58:36 -07:00
k8s-ci-robot
babfb3faa9 Merge pull request #300 from Liujingfang1/patchtransformer
Add transformer to apply json patch6902
2018-08-31 12:07:17 -07:00
Jingfang Liu
cedf215445 add PatchJson6902Factory to make transformer 2018-08-31 10:21:58 -07:00
Jeff Regan
51a4907f89 Merge pull request #307 from khrisrichardson/apimachinery-validation
use apimachinery for annotation/label validation
2018-08-31 09:42:47 -07:00
Khris Richardson
6457162383 use apimachinery for annotation/label validation 2018-08-31 07:40:00 -07:00
Jingfang Liu
7f0e9e3a6a Add patchJson6902 transformer 2018-08-30 15:34:42 -07:00
Jingfang Liu
95cf508b2b Add github.com/krishicks/yaml-patch to vendor 2018-08-30 13:45:25 -07:00
Jeff Regan
4a565ffdb8 Merge pull request #303 from gitirabassi/all-git-repos
if the prefix of the base is 'git::' will make the use of go-getter to download repo
2018-08-30 10:06:46 -07:00
Jeff Regan
17f1779a48 Merge pull request #302 from gitirabassi/storageClassSecret
Storage class secret
2018-08-30 10:03:03 -07:00
gitirabassi
a76cb0b008 force using the git protocol to downlaod every kind of repo non just from github 2018-08-30 11:02:03 +02:00
gitirabassi
9700bc3298 added all the documented secret for storageclasses 2018-08-29 23:05:40 +02:00
gitirabassi
ce31dac24f added storageclass paramether secret for glusterfs configuration with kustomize 2018-08-29 22:55:32 +02:00
k8s-ci-robot
a81b2e32e0 Merge pull request #299 from Liujingfang1/patch
change patches to patchesStrategicMerge in tests and examples
2018-08-28 13:57:00 -07:00
Jingfang Liu
b713d5a1cc change patches to patchesStrategicMerge in tests and examples 2018-08-28 09:40:34 -07:00
k8s-ci-robot
e11ba17248 Merge pull request #286 from Liujingfang1/master
Add patchesJson6902 and patchesStategicMerge to kustomization
2018-08-27 16:09:49 -07:00
Jingfang Liu
3d9d4bd36f address comments 2018-08-27 15:44:42 -07:00
Jingfang Liu
6a3e3c3a71 Add JSONPatch to kustomization 2018-08-27 13:52:21 -07:00
Jeff Regan
633c43a672 Merge pull request #292 from babiel/pdb-matchlabels
Disable creation of PDB matchLabels
2018-08-24 09:27:41 -07:00
Maximilian Gaß
0833693372 Disable creation of PDB matchLabels
Allow for using matchExpressions on its own
2018-08-24 13:51:05 +02:00
Jeff Regan
77c07ba96e Merge pull request #290 from philoserf/patch-1
trivial: Change dep constraint to an override
2018-08-23 17:07:44 -07:00
Mark Ayers
6847bb7924 trivial: Change dep constraint to an override
fixes #289
2018-08-23 15:58:27 -07:00
k8s-ci-robot
f0deaf707d Merge pull request #287 from emosbaugh/fix-gopath-isrepourl
Fix loader loader when run from gopath
2018-08-23 15:08:25 -07:00
Ethan Mosbaugh
e113944027 fix loader loader when run from gopath 2018-08-23 14:54:58 -07:00
k8s-ci-robot
1cf9131ae2 Merge pull request #285 from monopole/declutter
Move some docs to docs dir (declutter the top).
2018-08-23 13:33:06 -07:00
Jeffrey Regan
da142a8e97 Move some docs to docs dir (declutter the top). 2018-08-23 11:33:12 -07:00
Jeff Regan
6c81e3b95f Merge pull request #284 from Liujingfang1/vendor
Add missing files when running dep ensure
2018-08-23 11:27:47 -07:00
Jingfang Liu
a0089a2521 Add missing files when running dep ensure 2018-08-23 11:07:42 -07:00
k8s-ci-robot
11768f6232 Merge pull request #280 from monopole/fixntis
Fix some Go nits.
2018-08-23 10:37:58 -07:00
Jeff Regan
675c17737f Merge pull request #279 from Liujingfang1/quote
fix the double quotation problem in ConfigMapGenerator
2018-08-23 10:35:34 -07:00
Jeffrey Regan
735a93d000 Fix some Go nits. 2018-08-23 10:30:32 -07:00
Jeff Regan
67d2c2ed4a Merge pull request #281 from monopole/addVarCheck
Add varcheck to presubmit.
2018-08-23 10:25:32 -07:00
Jeffrey Regan
f931e15653 Add varcheck to presubmit. 2018-08-23 10:17:37 -07:00
Jingfang Liu
34169174a8 fix the double quotation problem in ConfigMapGenerator 2018-08-23 09:36:50 -07:00
Jeff Regan
ebf33964c7 Merge pull request #276 from kubernetes-sigs/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2018-08-22 20:05:47 -07:00
Jeff Regan
38a5e12d66 Create CODE_OF_CONDUCT.md 2018-08-22 20:05:19 -07:00
k8s-ci-robot
04ab218fa0 Merge pull request #275 from monopole/deletediff
Delete diff command and code it uses.
2018-08-22 18:38:39 -07:00
Jeffrey Regan
950c353f90 Delete diff command and code it uses. 2018-08-22 17:18:39 -07:00
Jeff Regan
aff09b1108 Merge pull request #271 from Liujingfang1/cleanup
cleanup after handling remote bases
2018-08-22 17:14:11 -07:00
Jingfang Liu
6da691f874 cleanup after handling remote bases 2018-08-22 13:22:45 -07:00
Jeff Regan
22c99aa535 Merge pull request #274 from monopole/docsreadme
Tweak docs readme
2018-08-22 12:21:32 -07:00
Jeffrey Regan
5fa209acfa Tweak docs readme 2018-08-22 12:20:13 -07:00
Jeff Regan
d72879e109 Merge pull request #147 from guineveresaenger/labels-and-annotations
Edit add label/annotation
2018-08-22 10:33:00 -07:00
Jeff Regan
337f3631ff Merge pull request #272 from Liujingfang1/docs
Add docs README.md
2018-08-22 10:22:00 -07:00
guineveresaenger
b3993dc874 Adds starter validation framework for semantic validation of inputs. 2018-08-22 18:20:51 +02:00
guineveresaenger
11c04dd6c4 Removes semantic validation from addmetadata.go and tests.
Due to moving some input parsing to the Validate method, it was renamed to reflect this additional purpose.
Tests were removed where appropriate.
2018-08-22 18:15:34 +02:00
Jingfang Liu
b29e449d4a Add docs README.md 2018-08-22 09:05:54 -07:00
Jingfang Liu
430f2f84fb Merge pull request #270 from Liujingfang1/docs
fix bug in the example download links
2018-08-21 12:08:32 -07:00
Jingfang Liu
52c6b5755b fix bug in the example download links 2018-08-21 12:04:53 -07:00
k8s-ci-robot
958bc63293 Merge pull request #269 from Liujingfang1/pvc
Add namereference of PersistentVolume in PersistentVolumeClain
2018-08-21 09:48:33 -07:00
Jingfang Liu
94ed0fe515 Add namereference of PersistentVolume in PersistentVolumeClain 2018-08-21 09:37:25 -07:00
Jeff Regan
bb8233ceff Merge pull request #265 from Liujingfang1/metadata
add typemeta to kustomization
2018-08-20 13:59:43 -07:00
Jingfang Liu
6221bed190 add typemeta to kustomization 2018-08-20 13:47:33 -07:00
k8s-ci-robot
1ffeb181e7 Merge pull request #264 from Liujingfang1/docs
Add example for kustomize build {url} and remote bases
2018-08-20 12:19:00 -07:00
Jingfang Liu
759ba1cbf4 Add example for kustomize build {url} 2018-08-20 09:52:32 -07:00
k8s-ci-robot
12f2c41273 Merge pull request #266 from ahmetb/patch-1
add homebrew package to INSTALL.md
2018-08-17 10:48:01 -07:00
Ahmet Alp Balkan
2174741376 add homebrew package to INSTALL.md 2018-08-17 07:50:28 -07:00
guineveresaenger
31dd8fc5b1 Restructured tests 2018-08-16 13:32:42 -07:00
guineveresaenger
77f4811779 Tests test Validate function 2018-08-16 02:36:11 -07:00
Jeff Regan
7050a45134 Merge pull request #262 from Liujingfang1/repoUrl3
Add all dependency of go-getter
2018-08-15 15:47:35 -07:00
k8s-ci-robot
3b64f1e102 Merge pull request #260 from Liujingfang1/repoUrl2
Add kustomize build {repoUrl}
2018-08-15 15:45:00 -07:00
Jingfang Liu
6c4c79e2cc Merge pull request #263 from Liujingfang1/gc
Add garbage collection KEP link
2018-08-15 15:22:21 -07:00
Jingfang Liu
3975ebc21a Add garbage collection KEP link 2018-08-15 15:19:18 -07:00
Jingfang Liu
ec95e5f97e Add all dependency of go-getter 2018-08-15 11:37:03 -07:00
Jingfang Liu
72b1a4bc5c combine fileLoader.New and NewLoader into one function: NewLoader 2018-08-15 11:04:31 -07:00
k8s-ci-robot
16447efca3 Merge pull request #255 from sethpollack/secret
add docs for envCommand
2018-08-15 09:35:02 -07:00
guineveresaenger
524d593c5c Separate functions for RunnAddLabel and RunAddAnnotation 2018-08-15 03:51:56 -07:00
guineveresaenger
3b644474c4 Parse data into string map for easy access in RunAddMetadata 2018-08-15 03:13:03 -07:00
Seth Pollack
42e6ced2b0 add docs 2018-08-14 20:55:26 -04:00
Jingfang Liu
f018370628 Add kustomize build {repoUrl} 2018-08-14 16:10:51 -07:00
Jeff Regan
c9a8bc1121 Merge pull request #256 from ivan4th/command-timeout-1
Add timeoutSeconds to secretArgs
2018-08-14 14:54:50 -07:00
k8s-ci-robot
8c7cbb12dd Merge pull request #257 from Liujingfang1/repoUrl2
Add dependency: github.com/hashicorp/go-getter
2018-08-14 14:49:29 -07:00
Jingfang Liu
b02f7775c5 manually add dependency on go-getter 2018-08-14 14:37:31 -07:00
Ivan Shvedunov
f9a0e671b7 Add timeoutSeconds to secretArgs 2018-08-14 22:55:59 +03:00
Jeff Regan
70fb22cad6 Merge pull request #250 from ivan4th/fix-resource-load-crash
Don't crash on resource load errors
2018-08-14 12:53:24 -07:00
Ivan Shvedunov
2ae00db6a9 Don't crash on resource load errors 2018-08-14 22:14:12 +03:00
k8s-ci-robot
f9577ab540 Merge pull request #247 from ryane/setnamespace
add support for `kustomize edit set namespace`
2018-08-13 11:17:06 -07:00
guineveresaenger
6a2786a5c4 Remove Complete function and references 2018-08-13 07:49:51 -07:00
guineveresaenger
924aa6fb29 Use iota declaration for constants and implements string method for KindOfAdd metadata 2018-08-13 07:46:06 -07:00
ryane
e2cd44f9d8 add support for kustomize edit set namespace
fixes #246
2018-08-10 22:42:50 -04:00
Jeff Regan
017c4ae0aa Merge pull request #245 from Liujingfang1/output
Add -o flag to kustomize build
2018-08-09 16:49:25 -07:00
Jingfang Liu
7b2baad390 Add -o flag to kustomize build 2018-08-09 13:15:39 -07:00
Jeff Regan
bc2d69f4f9 Merge pull request #241 from sethpollack/secret
add env sources to secrets
2018-08-09 13:05:21 -07:00
Jeff Regan
e913a71fad Merge pull request #244 from Liujingfang1/deprecation
Add deprecation message for namePrefix behavior change
2018-08-09 13:04:36 -07:00
Seth Pollack
7406dda074 fixes 2018-08-09 14:45:56 -04:00
Jingfang Liu
0b4df3d414 Add deprecation message for namePrefix behavior change 2018-08-09 11:25:37 -07:00
Jeff Regan
7d38916d63 Merge pull request #243 from monopole/updateDeps
Automated update of Gopkg.lock via dep ensure
2018-08-09 11:08:47 -07:00
Jeffrey Regan
79d1abe573 dep ensure run 2018-08-09 10:54:29 -07:00
Jeff Regan
9563052094 Merge pull request #233 from Liujingfang1/glob2
preserve order and comments in edit
2018-08-09 09:49:30 -07:00
Seth Pollack
f881c19bb6 add env sources to secrets 2018-08-09 09:17:53 -04:00
Jingfang Liu
8d7b5f82c4 preserve order and comments in edit 2018-08-08 15:03:16 -07:00
Jingfang Liu
7554406c61 Merge pull request #240 from kubernetes-sigs/revert-239-namespace2
Revert "Skip adding nameprefix to namespace"
2018-08-08 13:41:38 -07:00
Jingfang Liu
cf17050170 Revert "Skip adding nameprefix to namespace" 2018-08-08 13:39:01 -07:00
k8s-ci-robot
3857a67701 Merge pull request #239 from Liujingfang1/namespace2
Skip adding nameprefix to namespace
2018-08-08 11:56:15 -07:00
Jingfang Liu
10665c6fc9 Skip adding nameprefix to namespace 2018-08-08 10:02:42 -07:00
k8s-ci-robot
e0a09f4755 Merge pull request #237 from Liujingfang1/ingress
add namepreference for secret in ingress annotation
2018-08-08 09:49:06 -07:00
Jingfang Liu
31c6a55747 add namepreference for secret in ingress annotation 2018-08-07 13:26:39 -07:00
Jeff Regan
8332a70d19 Merge pull request #231 from bendory/master
Container Builder has been renamed Cloud Build
2018-08-03 10:29:23 -07:00
David Bendory
7fe2338acd Container Builder has been renamed Cloud Build 2018-08-03 13:22:49 -04:00
k8s-ci-robot
43d4dbc07a Merge pull request #228 from Liujingfang1/glob2
Change the order of validate and  expandFileSource in add configmap
2018-08-02 16:26:27 -07:00
Jingfang Liu
f0cf4579d2 Change the order of validate and expandFileSource in add configmap subcommand 2018-08-02 11:39:27 -07:00
k8s-ci-robot
68ba37f139 Merge pull request #226 from Liujingfang1/glob2
Add glob support in subcommands `add patch` and `add configmap`
2018-08-02 11:19:27 -07:00
Jingfang Liu
bf73633cda Add glob support in subcommands add patch and add configmap 2018-08-02 11:01:20 -07:00
Jeff Regan
55f8828ba1 Merge pull request #222 from Liujingfang1/glob
Add glob support in edit add resource
2018-08-01 15:51:45 -07:00
Jeff Regan
0e1307dccf Merge pull request #224 from Liujingfang1/imagetag
Use regexp in set imagetag
2018-08-01 15:50:50 -07:00
Jingfang Liu
4471b75912 Use regexp in set imagetag 2018-08-01 11:58:21 -07:00
k8s-ci-robot
75c6204337 Merge pull request #225 from Liujingfang1/pathconfig
Add ingress annotations to the namereference path config
2018-08-01 11:52:40 -07:00
Jingfang Liu
1b7171ac9e Add glob support in edit add resource 2018-08-01 11:43:28 -07:00
Jingfang Liu
5193d6b4a8 Add ingress annotations to the namereference path config 2018-08-01 10:47:01 -07:00
Jeff Regan
6a834b6262 Merge pull request #223 from monopole/noFlags
More description of eschewed features
2018-07-31 11:49:56 -07:00
Jeffrey Regan
083d3cbb65 More description of eschewed features 2018-07-31 11:48:36 -07:00
k8s-ci-robot
e68411b71e Merge pull request #220 from monopole/noglobbing
Eschew globbing doc
2018-07-31 10:04:47 -07:00
Jeff Regan
664774576c Merge pull request #219 from Liujingfang1/glob
remove glob support from kustomization.yaml
2018-07-30 17:03:53 -07:00
Jeffrey Regan
37e97084f9 Eschew globbing doc 2018-07-30 16:57:16 -07:00
Jingfang Liu
de4d8b7dfa remove glob support from kustomization.yaml 2018-07-30 16:28:40 -07:00
k8s-ci-robot
7f97108686 Merge pull request #216 from Liujingfang1/namespace
Add multibases example with different namespace
2018-07-30 15:54:46 -07:00
Jingfang Liu
71f069cf95 Add multibases example with different namespace 2018-07-30 15:21:53 -07:00
k8s-ci-robot
3dbe732cb5 Merge pull request #215 from monopole/eschewed
Enumerate eschewed features in a document.
2018-07-30 15:01:40 -07:00
Jeff Regan
e5aea4423b Merge pull request #214 from Liujingfang1/namespace
add namespace in ResId
2018-07-30 15:00:10 -07:00
Jeff Regan
100f05260e Merge pull request #209 from Liujingfang1/yaml
ignore the empty YAML object
2018-07-30 14:57:15 -07:00
Jeffrey Regan
02f9329747 Enumerate eschewed features in docs 2018-07-30 14:56:20 -07:00
Jingfang Liu
b6abd7600c add namespace in ResId 2018-07-30 14:04:35 -07:00
Jingfang Liu
2e7093e67f ignore the empty YAML object 2018-07-30 12:58:11 -07:00
k8s-ci-robot
3b3a272d27 Merge pull request #213 from Liujingfang1/imagetags
use regexp to determine if the image matched in imagetag transformer
2018-07-30 11:58:56 -07:00
Jingfang Liu
36115a7fa3 use regexp to determin if the image matched in imagetag transformer 2018-07-30 11:09:32 -07:00
k8s-ci-robot
4d9d54e2c7 Merge pull request #204 from Liujingfang1/diamond
Add support for using common base
2018-07-27 14:00:57 -07:00
Jingfang Liu
88aec95628 remove commented code
update multibases/README.md
2018-07-27 13:45:49 -07:00
Jingfang Liu
e30401489d Add example for multibases 2018-07-27 10:43:16 -07:00
Jingfang Liu
58bc4b14a2 Add support for using common base 2018-07-27 10:16:44 -07:00
Jeff Regan
2824c28e08 Merge pull request #203 from mortent/BetterSecretGenErrorMessage
More information in error message when secret gen fails
2018-07-26 15:45:40 -07:00
Morten Torkildsen
d7cbb95d9c More information in error message when secret gen fails 2018-07-26 12:50:07 -07:00
k8s-ci-robot
e771ec1169 Merge pull request #201 from monopole/meh
Combine loaderImpl and fileLoader.
2018-07-26 10:09:56 -07:00
Jeffrey Regan
9e5374e725 Combine loaderImpl and fileLoader. 2018-07-25 17:23:04 -07:00
k8s-ci-robot
4569a09d54 Merge pull request #200 from monopole/deleteDuplicativeCode
Delete duplicative code.
2018-07-25 09:33:55 -07:00
jregan
25d3ad7522 Delete duplicative code. 2018-07-24 20:42:43 -07:00
Jeff Regan
77e18724db Merge pull request #199 from monopole/moarDeletion
Drop the notion of the SchemeLoader
2018-07-24 18:18:25 -07:00
k8s-ci-robot
12d1771bb3 Merge pull request #197 from Liujingfang1/master
Change configmapGenerator to configmap.yaml in helloWorld example
2018-07-24 13:50:56 -07:00
Jeffrey Regan
a78aa22399 Drop useless or duplicative code. 2018-07-24 13:25:26 -07:00
Jingfang Liu
05a91893bf break helloWorld example into two examples:
- one for declaring a ConfigMap as resources
- one for declaring a ConfigMap from ConfigMapGenerator and rolling
update
2018-07-24 11:35:15 -07:00
Jeff Regan
8d420ec3f7 Merge pull request #196 from Liujingfang1/cr
Add docs and demo for imageTags
2018-07-23 16:44:12 -07:00
Jingfang Liu
838a766d12 Add docs and demo for imageTags 2018-07-23 16:35:04 -07:00
k8s-ci-robot
50d79e4d3e Merge pull request #198 from monopole/anotherWayToDelete
Delete some code.
2018-07-23 15:52:24 -07:00
Jeff Regan
4d2d450f6e Merge pull request #191 from babiel/fix-diff-tests-on-macos
Fix wrong path in diff tests on macOS
2018-07-23 15:37:29 -07:00
Jeff Regan
fdc46fb0b1 Delete some code. 2018-07-23 15:23:30 -07:00
k8s-ci-robot
92ac9b5a0e Merge pull request #194 from droot/bugfix/version-fix-issue-148
fixed version info injection in build script
2018-07-23 14:42:18 -07:00
Jeff Regan
857a9df70f Merge pull request #195 from monopole/tightenUp
Pull factories up call stack (make them less often).
2018-07-23 14:02:47 -07:00
Jeffrey Regan
969f4f28fa Pull factories out of the bowels. 2018-07-23 13:48:46 -07:00
Sunil Arora
58aa45c50a fixed version info injection in build script
fixes #148
2018-07-23 11:54:37 -07:00
k8s-ci-robot
5715f4bab4 Merge pull request #192 from Liujingfang1/cr
Add set imagetag command
2018-07-23 10:56:18 -07:00
Jingfang Liu
c8502c78f5 drop complete function from setImageTag subcommand 2018-07-23 10:47:52 -07:00
Jingfang Liu
909de5c94a Add set imagetag command 2018-07-23 10:24:32 -07:00
Maximilian Gaß
2eaeb83ec3 Fix wrong path in diff tests on macOS 2018-07-23 17:00:41 +02:00
k8s-ci-robot
03b9c2a3a3 Merge pull request #188 from Liujingfang1/cr
Enable imageTagTransformer in application
2018-07-20 11:54:56 -07:00
Jingfang Liu
59b98727ec enable imageTagTransformer in application 2018-07-20 11:30:34 -07:00
Jingfang Liu
5851f96524 Add initContainers in imageTagTransformer 2018-07-20 11:30:06 -07:00
k8s-ci-robot
08be3f061e Merge pull request #187 from monopole/secFactory
Introduce secret factory.
2018-07-20 11:17:53 -07:00
k8s-ci-robot
5906aaba19 Merge pull request #184 from Liujingfang1/cr
Add imageTagTransformer
2018-07-20 10:54:07 -07:00
Jingfang Liu
4b6f180d0c address comments 2018-07-20 10:45:17 -07:00
Jeffrey Regan
7f22f187f8 Introduce secret factory. 2018-07-20 10:40:47 -07:00
Jingfang Liu
fa3a64e352 Add imageTagTransformer 2018-07-20 10:23:12 -07:00
Jeff Regan
82f2cf9124 Merge pull request #186 from monopole/secretFactory
Inject a file system object into "Application".
2018-07-20 09:24:19 -07:00
Jeffrey Regan
276693cf0e Make a secret factory. 2018-07-20 09:09:52 -07:00
Jeff Regan
0197c019cc Merge pull request #185 from monopole/evenMoreFix86
Start remerging two forked sets of configmap factory code
2018-07-19 18:44:20 -07:00
Jeffrey Regan
9576a81787 Put the two sets of configmap make codes sidebyside 2018-07-19 18:33:55 -07:00
k8s-ci-robot
ff4a1c0b4f Merge pull request #183 from monopole/moreFix86
Remove a util package; more cleanup for #86
2018-07-19 16:19:10 -07:00
Jeff Regan
7dd28b1fd9 Merge pull request #176 from babiel/do-not-create-networkpolicy-matchlabels
Disable NetworkPolicy podSelector.matchLabels CreateIfNotPresent
2018-07-19 15:51:13 -07:00
Jeffrey Regan
b754557418 Remove a util package; more cleanup for #86 2018-07-19 14:39:18 -07:00
k8s-ci-robot
f305c0d791 Merge pull request #182 from Liujingfang1/cr
Add ContainerRef in kustomization type
2018-07-19 14:34:41 -07:00
Jingfang Liu
3fdaa2e903 Add ImageTags in kustomization type 2018-07-19 14:29:29 -07:00
k8s-ci-robot
964c74fb46 Merge pull request #181 from monopole/fix86
configMap factory refactor for #86
2018-07-19 14:14:53 -07:00
Jeffrey Regan
f14988ff80 configMap factory refactor for #86 2018-07-19 14:06:51 -07:00
k8s-ci-robot
f1adbfdbff Merge pull request #180 from knqyf263/fix_docs
Fix configGeneration.md
2018-07-19 08:37:53 -07:00
knqyf263
072bf992b0 Fix configGeneration.md 2018-07-19 11:09:00 +09:00
Jeff Regan
2d0d09e178 Merge pull request #179 from monopole/nitfixes
Fix cluster of silly Go nits.
2018-07-18 17:49:28 -07:00
Jeffrey Regan
564b0d6827 Fix cluster of silly Go nits. 2018-07-18 17:45:17 -07:00
guineveresaenger
187415430f Removed individual files in favor of combined metadata file 2018-07-18 17:09:41 -07:00
guineveresaenger
afac2fb46a Uses single file for both addLabel and addAnnotation commands, as the code is nearly identical. Tests included. 2018-07-18 17:09:41 -07:00
guineveresaenger
20fd433f75 Add tests 2018-07-18 17:09:41 -07:00
guineveresaenger
1e3824057b Implements labels and annotations as subcommands of edit 2018-07-18 17:09:41 -07:00
k8s-ci-robot
5edae84a9e Merge pull request #177 from monopole/improveFsAbstraction
Replace os.Stat with IsDir and Exists, simplifying FS abstraction.
2018-07-18 13:43:06 -07:00
Jeffrey Regan
9432671887 Replace os.Stat with IsDir, simplifying FS abstraction. 2018-07-18 12:57:53 -07:00
Jeff Regan
8fda0f87ab Merge pull request #159 from Liujingfang1/master
remove adding hash for configmap/secret read from resource yaml files
2018-07-18 11:10:09 -07:00
Jingfang Liu
08bc8637c8 set the default behavior for SecretGenerator and ConfigMapGenerator as create 2018-07-18 10:59:38 -07:00
Jingfang Liu
9645f397ef remove adding hash for configmap/secret read from resource yaml files 2018-07-18 10:57:50 -07:00
Maximilian Gaß
ed9f716361 Add unit test for NetworkPolicy 2018-07-18 14:11:18 +02:00
Maximilian Gaß
9986b65326 Disable creation of NetworkPolicy podSelector.matchLabels 2018-07-18 14:01:22 +02:00
Jingfang Liu
94dab9ddc4 Merge pull request #175 from Liujingfang1/crd
skip adding namespace to CustomResourceDefinitions
2018-07-17 13:31:15 -07:00
Jingfang Liu
81f246ed60 skip adding namespace to CustomResourceDefinitions 2018-07-17 13:18:43 -07:00
Jingfang Liu
30ed50eb27 Merge pull request #166 from Liujingfang1/namespace
Add namespace transformation for subjects.namespace in ClusterRoleBinding
2018-07-17 13:15:40 -07:00
Jingfang Liu
4325401fe7 Add namespace transformation for subjects.namespace in ClusterRoleBinding 2018-07-17 13:10:51 -07:00
Jingfang Liu
65af5c13f1 Merge pull request #146 from babiel/fix-name-hash-in-refvars
Run namehash transformer before resolving names for refvars
2018-07-13 09:15:07 -07:00
Maximilian Gaß
9674fd12b2 Run namehash transformer before resolving names for refvars 2018-07-13 09:45:48 +02:00
Jingfang Liu
2377902a0b Merge pull request #145 from babiel/pod-affinity-label-transformer
Add common labels to pod affinity/anti-affinity label selector
2018-07-12 15:41:58 -07:00
Jingfang Liu
1dbde0b085 Merge pull request #140 from babiel/add-networkpolicy-to-labels
Add NetworkPolicy to label transformer
2018-07-12 15:41:51 -07:00
Jingfang Liu
5920563bbd Merge pull request #158 from george-angel/master
Interpret projected configMap volume names
2018-07-11 14:30:04 -07:00
Jingfang Liu
23201c27f0 Merge pull request #160 from Liujingfang1/helloworld
update helloWorld example: change configmap to configmapGenerator
2018-07-11 14:25:47 -07:00
George Angel
d4c7131f8f fix linter dupl errors 2018-07-11 22:18:49 +01:00
Jingfang Liu
d2b189874b update helloWorld example: change configmap to configmapGenerator 2018-07-11 14:00:07 -07:00
Jingfang Liu
98a38eb290 Merge pull request #151 from Rio/vars-docs
docs(vars): Add some documentation explaining the usage and limits of vars
2018-07-11 09:45:40 -07:00
George Angel
aa729229e2 Interpret projected configMap volume names
Append hashes to configMap names under the projected configMap volume,
for Kind: Deployment and StatefulSet
2018-07-11 10:30:31 +01:00
Rio Kierkels
afbc1b0401 docs(vars): add some docs explaining the usage and limitations of vars 2018-07-11 10:43:11 +02:00
Jingfang Liu
3305be9589 Merge pull request #150 from ryane/fix-pvc-claimname
add PersistentVolumeClaim to name reference transformer
2018-07-09 13:51:52 -07:00
ryane
36772aac89 add PersistentVolumeClaim to name reference transformer
fixes #149
2018-07-03 10:16:58 -04:00
Maximilian Gaß
7755d6cac2 Add common labels to pod affinity/anti-affinity label selector 2018-07-02 16:02:11 +02:00
Maximilian Gaß
0c260ef804 Add NetworkPolicy to label transformer 2018-06-26 17:18:50 +02:00
17253 changed files with 1037843 additions and 1890007 deletions

100
.github/workflows/go.yml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint:
name: Lint
runs-on: [ubuntu-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Lint
run: ./travis/kyaml-pre-commit.sh
env:
KUSTOMIZE_DOCKER_E2E: false # don't need to do e2e tests for linting
test-linux:
name: Test Linux
runs-on: [ubuntu-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test kyaml
run: go test -cover ./...
working-directory: ./kyaml
- name: Test cmd/config
run: go test -cover ./...
working-directory: ./cmd/config
env:
KUSTOMIZE_DOCKER_E2E: true
test-macos:
name: Test MacOS
runs-on: [macos-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test kyaml
run: go test -cover ./...
working-directory: ./kyaml
- name: Test cmd/config
run: go test -cover ./...
working-directory: ./cmd/config
env:
KUSTOMIZE_DOCKER_E2E: false # docker not installed on mac
test-windows:
name: Test Windows
runs-on: [windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test kyaml
run: go test -cover ./...
working-directory: ./kyaml
- name: Test cmd/config
run: go test -cover ./...
working-directory: ./cmd/config
env:
KUSTOMIZE_DOCKER_E2E: false # docker on windows not working well yet

11
.gitignore vendored
View File

@@ -5,8 +5,19 @@
*.so
*.dylib
.idea
*.iml
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# We use sed -i.bak when doing in-line replace, because it works better cross-platform
.bak
# macOS
*.DS_store
.bin

50
.golangci-kustomize.yml Normal file
View File

@@ -0,0 +1,50 @@
run:
deadline: 5m
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
# - dogsled
- dupl
# - errcheck
# - funlen
# - gochecknoinits
- goconst
# - gocritic
- gocyclo
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
# - scopelint
- staticcheck
- structcheck
# stylecheck demands that acronyms not be treated as words
# in camelCase, so JsonOp become JSONOp, etc. Yuck.
# - stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
# - whitespace
linters-settings:
dupl:
threshold: 400
lll:
line-length: 170
gocyclo:
min-complexity: 15
golint:
min-confidence: 0.85

View File

@@ -1,29 +0,0 @@
language: go
go:
- 1.10.x
# go_import_path: k8s.io/kubectl
before_install:
- source ./bin/consider-early-travis-exit.sh
- sudo apt-get install tree
- go get -u github.com/golang/lint/golint
- go get -u golang.org/x/tools/cmd/goimports
- go get -u github.com/onsi/ginkgo/ginkgo
- go get -u github.com/monopole/mdrip
- go get -u github.com/fzipp/gocyclo
- go get -u gopkg.in/alecthomas/gometalinter.v2 && gometalinter.v2 --install
# Install must be set to prevent default `go get` to run.
# The dependencies have already been vendored by `dep` so
# we don't need to fetch them.
install:
-
script:
- ./bin/pre-commit.sh
# TBD. Suppressing for now.
notifications:
email: false

View File

@@ -1,36 +1,26 @@
# Contributing guidelines
# Contributing Guidelines
[Contributor License Agreement]: https://git.k8s.io/community/CLA.md
[github workflow guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md
[CNCF code of conduct]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt:
## Contributing a Patch
_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._
1. Kubernetes projects require contributors to sign the
[Contributor License Agreement] before pull requests
can be considered.
1. Submit an issue describing your proposed change to
the repo in question.
1. The [repo owners](OWNERS) will respond to your issue
promptly.
1. Fork the repo, develop and test your code.
See the [github workflow guide].
1. For _new features_, provide a markdown-based demo following
the pattern established in the [examples](examples) directory.
Run `bin/pre-commit.sh` to test your demo.
1. Submit a pull request.
## Getting Started
## Community, discussion, contribution, and support
Dev guides:
Learn how to engage with the Kubernetes community on
the [community page](http://kubernetes.io/community/).
- [Mac](docs/macDevGuide.md)
You can reach the maintainers of this project at:
We have full documentation on how to get started contributing here:
- [Slack](http://slack.k8s.io/)
- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-kustomize)
- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md) - Common resources for existing developers
## Code of conduct
## Mentorship
Participation in the Kubernetes community is governed
by the [CNCF code of conduct].
- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
## Contact Information
- [Slack channel](https://kubernetes.slack.com/messages/sig-cli)
- [Mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-cli)

301
Gopkg.lock generated
View File

@@ -1,301 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/PuerkitoBio/purell"
packages = ["."]
revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/PuerkitoBio/urlesc"
packages = ["."]
revision = "de5bf2ad457846296e2031421a34e2568e304e35"
[[projects]]
name = "github.com/davecgh/go-spew"
packages = ["spew"]
revision = "346938d642f2ec3594ed81d874461961cd0faa76"
version = "v1.1.0"
[[projects]]
name = "github.com/emicklei/go-restful"
packages = [
".",
"log"
]
revision = "3658237ded108b4134956c1b3050349d93e7b895"
version = "v2.7.1"
[[projects]]
name = "github.com/evanphx/json-patch"
packages = ["."]
revision = "afac545df32f2287a079e2dfb7ba2745a643747e"
version = "v3.0.0"
[[projects]]
name = "github.com/ghodss/yaml"
packages = ["."]
revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/go-openapi/jsonpointer"
packages = ["."]
revision = "3a0015ad55fa9873f41605d3e8f28cd279c32ab2"
[[projects]]
branch = "master"
name = "github.com/go-openapi/jsonreference"
packages = ["."]
revision = "3fb327e6747da3043567ee86abd02bb6376b6be2"
[[projects]]
branch = "master"
name = "github.com/go-openapi/spec"
packages = ["."]
revision = "bcff419492eeeb01f76e77d2ebc714dc97b607f5"
[[projects]]
branch = "master"
name = "github.com/go-openapi/swag"
packages = ["."]
revision = "811b1089cde9dad18d4d0c2d09fbdbf28dbd27a5"
[[projects]]
name = "github.com/gogo/protobuf"
packages = [
"proto",
"sortkeys"
]
revision = "1adfc126b41513cc696b209667c8656ea7aac67c"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/golang/glog"
packages = ["."]
revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998"
[[projects]]
name = "github.com/golang/protobuf"
packages = [
"proto",
"ptypes",
"ptypes/any",
"ptypes/duration",
"ptypes/timestamp"
]
revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/google/gofuzz"
packages = ["."]
revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1"
[[projects]]
name = "github.com/googleapis/gnostic"
packages = [
"OpenAPIv2",
"compiler",
"extensions"
]
revision = "ee43cbb60db7bd22502942cccbc39059117352ab"
version = "v0.1.0"
[[projects]]
name = "github.com/inconshreveable/mousetrap"
packages = ["."]
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
version = "v1.0"
[[projects]]
name = "github.com/json-iterator/go"
packages = ["."]
revision = "ca39e5af3ece67bbcda3d0f4f56a8e24d9f2dad4"
version = "1.1.3"
[[projects]]
branch = "master"
name = "github.com/mailru/easyjson"
packages = [
"buffer",
"jlexer",
"jwriter"
]
revision = "3fdea8d05856a0c8df22ed4bc71b3219245e4485"
[[projects]]
name = "github.com/modern-go/concurrent"
packages = ["."]
revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"
version = "1.0.3"
[[projects]]
name = "github.com/modern-go/reflect2"
packages = ["."]
revision = "1df9eeb2bb81f327b96228865c5687bc2194af3f"
version = "1.0.0"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/spf13/cobra"
packages = ["."]
revision = "a1f051bc3eba734da4772d60e2d677f47cf93ef4"
version = "v0.0.2"
[[projects]]
name = "github.com/spf13/pflag"
packages = ["."]
revision = "583c0c0531f06d5278b7d917446061adc344b5cd"
version = "v1.0.1"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"http/httpguts",
"http2",
"http2/hpack",
"idna"
]
revision = "2491c5de3490fced2f6cff376127c667efeed857"
[[projects]]
name = "golang.org/x/text"
packages = [
"collate",
"collate/build",
"internal/colltab",
"internal/gen",
"internal/tag",
"internal/triegen",
"internal/ucd",
"language",
"secure/bidirule",
"transform",
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable",
"width"
]
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
version = "v0.3.0"
[[projects]]
name = "gopkg.in/inf.v0"
packages = ["."]
revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf"
version = "v0.9.1"
[[projects]]
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
version = "v2.2.1"
[[projects]]
branch = "master"
name = "k8s.io/api"
packages = [
"admissionregistration/v1alpha1",
"admissionregistration/v1beta1",
"apps/v1",
"apps/v1beta1",
"apps/v1beta2",
"authentication/v1",
"authentication/v1beta1",
"authorization/v1",
"authorization/v1beta1",
"autoscaling/v1",
"autoscaling/v2beta1",
"batch/v1",
"batch/v1beta1",
"batch/v2alpha1",
"certificates/v1beta1",
"core/v1",
"events/v1beta1",
"extensions/v1beta1",
"networking/v1",
"policy/v1beta1",
"rbac/v1",
"rbac/v1alpha1",
"rbac/v1beta1",
"scheduling/v1alpha1",
"settings/v1alpha1",
"storage/v1",
"storage/v1alpha1",
"storage/v1beta1"
]
revision = "53d615ae3f440f957cb9989d989d597f047262d9"
[[projects]]
branch = "master"
name = "k8s.io/apimachinery"
packages = [
"pkg/api/resource",
"pkg/apis/meta/v1",
"pkg/apis/meta/v1/unstructured",
"pkg/conversion",
"pkg/conversion/queryparams",
"pkg/fields",
"pkg/labels",
"pkg/runtime",
"pkg/runtime/schema",
"pkg/runtime/serializer",
"pkg/runtime/serializer/json",
"pkg/runtime/serializer/protobuf",
"pkg/runtime/serializer/recognizer",
"pkg/runtime/serializer/versioning",
"pkg/selection",
"pkg/types",
"pkg/util/errors",
"pkg/util/framer",
"pkg/util/intstr",
"pkg/util/json",
"pkg/util/mergepatch",
"pkg/util/net",
"pkg/util/runtime",
"pkg/util/sets",
"pkg/util/strategicpatch",
"pkg/util/validation",
"pkg/util/validation/field",
"pkg/util/wait",
"pkg/util/yaml",
"pkg/watch",
"third_party/forked/golang/json",
"third_party/forked/golang/reflect"
]
revision = "13b73596e4b63e03203e86f6d9c7bcc1b937c62f"
[[projects]]
name = "k8s.io/client-go"
packages = ["kubernetes/scheme"]
revision = "23781f4d6632d88e869066eaebb743857aa1ef9b"
version = "v7.0.0"
[[projects]]
branch = "master"
name = "k8s.io/kube-openapi"
packages = [
"pkg/common",
"pkg/util/proto"
]
revision = "b3f03f55328800731ce03a164b80973014ecd455"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "586d4cb9094e9b5c0731f16e931b953e9c0f709b7125a7537ae3625ada179eee"
solver-name = "gps-cdcl"
solver-version = 1

View File

@@ -1,58 +0,0 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
[[constraint]]
name = "github.com/evanphx/json-patch"
version = "3.0.0"
[[constraint]]
name = "github.com/ghodss/yaml"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "github.com/golang/glog"
[[constraint]]
name = "github.com/spf13/cobra"
version = "0.0.2"
[[constraint]]
branch = "master"
name = "k8s.io/api"
[[constraint]]
branch = "master"
name = "k8s.io/apimachinery"
[[constraint]]
name = "k8s.io/client-go"
version = "7.0.0"
[[constraint]]
branch = "master"
name = "k8s.io/utils"
[[constraint]]
branch = "master"
name = "github.com/go-openapi/spec"

View File

@@ -1,27 +0,0 @@
[release page]: https://github.com/kubernetes-sigs/kustomize/releases
[Go]: https://golang.org
## Installation
Download a binary from the [release page].
Or try this to grab the latest official release
using the command line:
```
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/latest |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
xargs curl -O -L
mv kustomize_*_${opsys}_amd64 kustomize
chmod u+x kustomize
```
To install from head with [Go] v1.10.1 or higher:
<!-- @installkustomize @test -->
```
go get github.com/kubernetes-sigs/kustomize
```

318
Makefile Normal file
View File

@@ -0,0 +1,318 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0
#
# Makefile for kustomize CLI and API.
MYGOBIN := $(shell go env GOPATH)/bin
SHELL := /bin/bash
export PATH := $(MYGOBIN):$(PATH)
.PHONY: all
all: verify-kustomize
.PHONY: verify-kustomize
verify-kustomize: \
lint-kustomize \
test-unit-kustomize-all \
test-examples-kustomize-against-HEAD \
test-examples-kustomize-against-3.6.1
# The following target referenced by a file in
# https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kustomize
.PHONY: prow-presubmit-check
prow-presubmit-check: \
lint-kustomize \
test-unit-kustomize-all \
test-examples-kustomize-against-HEAD \
test-examples-kustomize-against-3.6.1 \
test-unit-cmd-all \
test-go-mod
.PHONY: verify-kustomize-e2e
verify-kustomize-e2e: test-examples-e2e-kustomize
# Other builds in this repo might want a different linter version.
# Without one Makefile to rule them all, the different makes
# cannot assume that golanci-lint is at the version they want
# since everything uses the same implicit GOPATH.
# This installs in a temp dir to avoid overwriting someone else's
# linter, then installs in MYGOBIN with a new name.
# Version pinned by hack/go.mod
$(MYGOBIN)/golangci-lint-kustomize:
( \
set -e; \
cd hack; \
GO111MODULE=on go build -tags=tools -o $(MYGOBIN)/golangci-lint-kustomize github.com/golangci/golangci-lint/cmd/golangci-lint; \
)
# Version pinned by api/go.mod
$(MYGOBIN)/mdrip:
cd api; \
go install github.com/monopole/mdrip
# Version pinned by api/go.mod
$(MYGOBIN)/stringer:
cd api; \
go install golang.org/x/tools/cmd/stringer
# Version pinned by api/go.mod
$(MYGOBIN)/goimports:
cd api; \
go install golang.org/x/tools/cmd/goimports
# Install resource from whatever is checked out.
$(MYGOBIN)/resource:
cd cmd/resource; \
go install .
# To pin pluginator, use this recipe instead:
# cd api;
# go install sigs.k8s.io/kustomize/pluginator/v2
$(MYGOBIN)/pluginator:
cd pluginator; \
go install .
# Install kustomize from whatever is checked out.
$(MYGOBIN)/kustomize:
cd kustomize; \
go install .
.PHONY: install-tools
install-tools: \
$(MYGOBIN)/goimports \
$(MYGOBIN)/golangci-lint-kustomize \
$(MYGOBIN)/mdrip \
$(MYGOBIN)/pluginator \
$(MYGOBIN)/stringer
### Begin kustomize plugin rules.
#
# The rules to deal with builtin plugins are a bit
# complicated because
#
# - Every builtin plugin is a Go plugin -
# meaning it gets its own module directory
# (outside of the api module) with Go
# code in a 'main' package per Go plugin rules.
# - kustomize locates plugins using the
# 'apiVersion' and 'kind' fields from the
# plugin config file.
# - k8s wants CamelCase in 'kind' fields.
# - The module name (the last name in the path)
# must be the lowercased 'kind' of the
# plugin because Go and related tools
# demand lowercase in import paths, but
# allow CamelCase in file names.
# - the generated code must live in the api
# module (it's linked into the api).
# Where all generated builtin plugin code should go.
pGen=api/builtins
# Where the builtin Go plugin modules live.
pSrc=plugin/builtin
_builtinplugins = \
AnnotationsTransformer.go \
ConfigMapGenerator.go \
HashTransformer.go \
ImageTagTransformer.go \
LabelTransformer.go \
LegacyOrderTransformer.go \
NamespaceTransformer.go \
PatchJson6902Transformer.go \
PatchStrategicMergeTransformer.go \
PatchTransformer.go \
PrefixSuffixTransformer.go \
ReplicaCountTransformer.go \
SecretGenerator.go \
ValueAddTransformer.go
# Maintaining this explicit list of generated files, and
# adding it as a dependency to a few targets, to assure
# they get recreated if deleted. The rules below on how
# to make them don't, by themselves, assure they will be
# recreated if deleted.
builtinplugins = $(patsubst %,$(pGen)/%,$(_builtinplugins))
# These rules are verbose, but assure that if a source file
# is modified, the corresponding generated file, and only
# that file, will be recreated.
$(pGen)/AnnotationsTransformer.go: $(pSrc)/annotationstransformer/AnnotationsTransformer.go
$(pGen)/ConfigMapGenerator.go: $(pSrc)/configmapgenerator/ConfigMapGenerator.go
$(pGen)/HashTransformer.go: $(pSrc)/hashtransformer/HashTransformer.go
$(pGen)/ImageTagTransformer.go: $(pSrc)/imagetagtransformer/ImageTagTransformer.go
$(pGen)/LabelTransformer.go: $(pSrc)/labeltransformer/LabelTransformer.go
$(pGen)/LegacyOrderTransformer.go: $(pSrc)/legacyordertransformer/LegacyOrderTransformer.go
$(pGen)/NamespaceTransformer.go: $(pSrc)/namespacetransformer/NamespaceTransformer.go
$(pGen)/PatchJson6902Transformer.go: $(pSrc)/patchjson6902transformer/PatchJson6902Transformer.go
$(pGen)/PatchStrategicMergeTransformer.go: $(pSrc)/patchstrategicmergetransformer/PatchStrategicMergeTransformer.go
$(pGen)/PatchTransformer.go: $(pSrc)/patchtransformer/PatchTransformer.go
$(pGen)/PrefixSuffixTransformer.go: $(pSrc)/prefixsuffixtransformer/PrefixSuffixTransformer.go
$(pGen)/ReplicaCountTransformer.go: $(pSrc)/replicacounttransformer/ReplicaCountTransformer.go
$(pGen)/SecretGenerator.go: $(pSrc)/secretgenerator/SecretGenerator.go
$(pGen)/ValueAddTransformer.go: $(pSrc)/valueaddtransformer/ValueAddTransformer.go
# The (verbose but portable) Makefile way to convert to lowercase.
toLowerCase = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
$(pGen)/%.go: $(MYGOBIN)/pluginator
@echo "generating $*"
( \
set -e; \
cd $(pSrc)/$(call toLowerCase,$*); \
go generate .; \
cd ../../../$(pGen); \
$(MYGOBIN)/goimports -w $*.go \
)
# Target is for debugging.
.PHONY: generate-kustomize-builtin-plugins
generate-kustomize-builtin-plugins: $(builtinplugins)
.PHONY: kustomize-external-go-plugin-build
kustomize-external-go-plugin-build:
./hack/buildExternalGoPlugins.sh ./plugin
.PHONY: kustomize-external-go-plugin-clean
kustomize-external-go-plugin-clean:
./hack/buildExternalGoPlugins.sh ./plugin clean
### End kustomize plugin rules.
.PHONY: lint-kustomize
lint-kustomize: install-tools $(builtinplugins)
cd api; \
$(MYGOBIN)/golangci-lint-kustomize -c ../.golangci-kustomize.yml run ./...
cd kustomize; \
$(MYGOBIN)/golangci-lint-kustomize -c ../.golangci-kustomize.yml run ./...
cd pluginator; \
$(MYGOBIN)/golangci-lint-kustomize -c ../.golangci-kustomize.yml run ./...
# Used to add non-default compilation flags when experimenting with
# plugin-to-api compatibility checks.
.PHONY: build-kustomize-api
build-kustomize-api: $(builtinplugins)
cd api; go build ./...
.PHONY: test-unit-kustomize-api
test-unit-kustomize-api: build-kustomize-api
cd api; go test ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"
.PHONY: test-unit-kustomize-plugins
test-unit-kustomize-plugins:
./hack/testUnitKustomizePlugins.sh
.PHONY: test-unit-kustomize-cli
test-unit-kustomize-cli:
cd kustomize; go test ./...
.PHONY: test-unit-kustomize-all
test-unit-kustomize-all: \
test-unit-kustomize-api \
test-unit-kustomize-cli \
test-unit-kustomize-plugins
test-unit-cmd-all:
./travis/kyaml-pre-commit.sh
test-go-mod:
./travis/check-go-mod.sh
.PHONY:
test-examples-e2e-kustomize: $(MYGOBIN)/mdrip $(MYGOBIN)/kind
( \
set -e; \
/bin/rm -f $(MYGOBIN)/kustomize; \
echo "Installing kustomize from ."; \
cd kustomize; go install .; cd ..; \
./hack/testExamplesE2EAgainstKustomize.sh .; \
)
.PHONY:
test-examples-kustomize-against-HEAD: $(MYGOBIN)/kustomize $(MYGOBIN)/mdrip
./hack/testExamplesAgainstKustomize.sh HEAD
.PHONY:
test-examples-kustomize-against-3.6.1: $(MYGOBIN)/mdrip
( \
set -e; \
tag=v3.6.1; \
/bin/rm -f $(MYGOBIN)/kustomize; \
echo "Installing kustomize $$tag."; \
GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3@$${tag}; \
./hack/testExamplesAgainstKustomize.sh $$tag; \
echo "Reinstalling kustomize from HEAD."; \
cd kustomize; go install .; \
)
# linux only.
# This is for testing an example plugin that
# uses kubeval for validation.
# Don't want to add a hard dependence in go.mod file
# to github.com/instrumenta/kubeval.
# Instead, download the binary.
$(MYGOBIN)/kubeval:
( \
set -e; \
d=$(shell mktemp -d); cd $$d; \
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz; \
tar xf kubeval-linux-amd64.tar.gz; \
mv kubeval $(MYGOBIN); \
rm -rf $$d; \
)
# linux only.
# This is for testing an example plugin that uses helm to inflate a chart
# for subsequent kustomization.
# Don't want to add a hard dependence in go.mod file to helm.
# Instead, download the binaries.
$(MYGOBIN)/helmV2:
( \
set -e; \
d=$(shell mktemp -d); cd $$d; \
tgzFile=helm-v2.13.1-linux-amd64.tar.gz; \
wget https://storage.googleapis.com/kubernetes-helm/$$tgzFile; \
tar -xvzf $$tgzFile; \
mv linux-amd64/helm $(MYGOBIN)/helmV2; \
rm -rf $$d \
)
# Helm V3 differs from helm V2; downloading it to provide coverage for the
# chart inflator plugin under helm v3.
$(MYGOBIN)/helmV3:
( \
set -e; \
d=$(shell mktemp -d); cd $$d; \
tgzFile=helm-v3.2.0-rc.1-linux-amd64.tar.gz; \
wget https://get.helm.sh/$$tgzFile; \
tar -xvzf $$tgzFile; \
mv linux-amd64/helm $(MYGOBIN)/helmV3; \
rm -rf $$d \
)
# Default version of helm is v2 for the time being.
$(MYGOBIN)/helm: $(MYGOBIN)/helmV2
ln -s $(MYGOBIN)/helmV2 $(MYGOBIN)/helm
$(MYGOBIN)/kind:
( \
set -e; \
d=$(shell mktemp -d); cd $$d; \
wget -O ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(shell uname)-amd64; \
chmod +x ./kind; \
mv ./kind $(MYGOBIN); \
rm -rf $$d; \
)
.PHONY: clean
clean: kustomize-external-go-plugin-clean
go clean --cache
rm -f $(builtinplugins)
rm -f $(MYGOBIN)/pluginator
rm -f $(MYGOBIN)/kustomize
rm -f $(MYGOBIN)/golangci-lint-kustomize
# Nuke the site from orbit. It's the only way to be sure.
.PHONY: nuke
nuke: clean
go clean --modcache

View File

@@ -1,6 +1,5 @@
aliases:
kustomize-admins:
- grodrigues3
- monopole
- pwittrock
kustomize-maintainers:
@@ -10,3 +9,5 @@ aliases:
- mengqiy
- monopole
- pwittrock
- mortent
- phanimarupaka

View File

@@ -7,14 +7,31 @@ untouched and usable as is.
`kustomize` targets kubernetes; it understands and can
patch [kubernetes style] API objects. It's like
[`make`], in that what it does is declared in a file,
and it's like [`sed`], in that it emits editted text.
and it's like [`sed`], in that it emits edited text.
[![Build Status](https://travis-ci.org/kubernetes-sigs/kustomize.svg?branch=master)](https://travis-ci.org/kubernetes-sigs/kustomize)
This tool is sponsored by [sig-cli] ([KEP]), and
inspired by [DAM].
[![Build Status](https://prow.k8s.io/badge.svg?jobs=kustomize-presubmit-master)](https://prow.k8s.io/job-history/kubernetes-jenkins/pr-logs/directory/kustomize-presubmit-master)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes-sigs/kustomize)](https://goreportcard.com/report/github.com/kubernetes-sigs/kustomize)
**Installation**: Download a binary from the [release
page], or see these [install] notes. Then try one of
the tested [examples].
Download a binary from the [release page], or see
these [instructions](https://kubernetes-sigs.github.io/kustomize/installation/).
Browse the [docs](https://kubernetes-sigs.github.io/kustomize/) or jump right into the
tested [examples](examples).
## kubectl integration
Since [v1.14][kubectl announcement] the kustomize build system has been included in kubectl.
| kubectl version | kustomize version |
|---------|--------|
| v1.16.0 | [v2.0.3](/../../tree/v2.0.3) |
| v1.15.x | [v2.0.3](/../../tree/v2.0.3) |
| v1.14.x | [v2.0.3](/../../tree/v2.0.3) |
For examples and guides for using the kubectl integration please see the [kubectl book] or the [kubernetes documentation].
## Usage
@@ -89,7 +106,7 @@ Take the work from step (1) above, move it into a
`someApp` subdirectory called `base`, then
place overlays in a sibling directory.
An overlay is just another kustomization, refering to
An overlay is just another kustomization, referring to
the base, and referring to patches to apply to that
base.
@@ -113,29 +130,39 @@ The YAML can be directly [applied] to a cluster:
> kustomize build ~/someApp/overlays/production | kubectl apply -f -
> ```
## About
## Community
This tool is sponsored by [sig-cli] ([KEP]).
- [file a bug](https://kubernetes-sigs.github.io/kustomize/contributing/bugs/) instructions
- [contribute a feature](https://kubernetes-sigs.github.io/kustomize/contributing/features/) instructions
### Code of conduct
Participation in the Kubernetes community
is governed by the [Kubernetes Code of Conduct].
[KEP]: https://github.com/kubernetes/community/blob/master/keps/sig-cli/0008-kustomize.md
[`make`]: https://www.gnu.org/software/make
[`sed`]: https://www.gnu.org/software/sed
[applied]: docs/glossary.md#apply
[base]: docs/glossary.md#base
[declarative configuration]: docs/glossary.md#declarative-application-management
[examples]: examples/README.md
[imageBase]: docs/base.jpg
[imageOverlay]: docs/overlay.jpg
[install]: INSTALL.md
[kubernetes style]: docs/glossary.md#kubernetes-style-object
[kustomization]: docs/glossary.md#kustomization
[overlay]: docs/glossary.md#overlay
[overlays]: docs/glossary.md#overlay
[DAM]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#declarative-application-management
[KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/0008-kustomize.md
[Kubernetes Code of Conduct]: code-of-conduct.md
[applied]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#apply
[base]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#base
[declarative configuration]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#declarative-application-management
[imageBase]: docs/images/base.jpg
[imageOverlay]: docs/images/overlay.jpg
[kubectl announcement]: https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement
[kubectl book]: https://kubectl.docs.kubernetes.io/pages/app_customization/introduction.html
[kubernetes documentation]: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/
[kubernetes style]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#kubernetes-style-object
[kustomization]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#kustomization
[overlay]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#overlay
[overlays]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#overlay
[release page]: https://github.com/kubernetes-sigs/kustomize/releases
[resource]: docs/glossary.md#resource
[resources]: docs/glossary.md#resource
[resource]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#resource
[resources]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#resource
[sig-cli]: https://github.com/kubernetes/community/blob/master/sig-cli/README.md
[variant]: docs/glossary.md#variant
[variants]: docs/glossary.md#variant
[workflows]: docs/workflows.md
[variant]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#variant
[variants]: https://kubernetes-sigs.github.io/kustomize/api-reference/glossary#variant
[v2.0.3]: https://github.com/kubernetes-sigs/kustomize/releases/tag/v2.0.3
[v2.1.0]: https://github.com/kubernetes-sigs/kustomize/releases/tag/v2.1.0
[workflows]: https://kubernetes-sigs.github.io/kustomize/guides

View File

@@ -0,0 +1,42 @@
// Code generated by pluginator on AnnotationsTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"sigs.k8s.io/kustomize/api/filters/annotations"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
// Add the given annotations to the given field specifications.
type AnnotationsTransformerPlugin struct {
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *AnnotationsTransformerPlugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) {
p.Annotations = nil
p.FieldSpecs = nil
return yaml.Unmarshal(c, p)
}
func (p *AnnotationsTransformerPlugin) Transform(m resmap.ResMap) error {
for _, r := range m.Resources() {
err := filtersutil.ApplyToJSON(annotations.Filter{
Annotations: p.Annotations,
FsSlice: p.FieldSpecs,
}, r)
if err != nil {
return err
}
}
return nil
}
func NewAnnotationsTransformerPlugin() resmap.TransformerPlugin {
return &AnnotationsTransformerPlugin{}
}

View File

@@ -0,0 +1,39 @@
// Code generated by pluginator on ConfigMapGenerator; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"sigs.k8s.io/kustomize/api/kv"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml"
)
type ConfigMapGeneratorPlugin struct {
h *resmap.PluginHelpers
types.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
types.ConfigMapArgs
}
func (p *ConfigMapGeneratorPlugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.ConfigMapArgs = types.ConfigMapArgs{}
err = yaml.Unmarshal(config, p)
if p.ConfigMapArgs.Name == "" {
p.ConfigMapArgs.Name = p.Name
}
if p.ConfigMapArgs.Namespace == "" {
p.ConfigMapArgs.Namespace = p.Namespace
}
p.h = h
return
}
func (p *ConfigMapGeneratorPlugin) Generate() (resmap.ResMap, error) {
return p.h.ResmapFactory().FromConfigMapArgs(
kv.NewLoader(p.h.Loader(), p.h.Validator()), p.ConfigMapArgs)
}
func NewConfigMapGeneratorPlugin() resmap.GeneratorPlugin {
return &ConfigMapGeneratorPlugin{}
}

View File

@@ -0,0 +1,39 @@
// Code generated by pluginator on HashTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/resmap"
)
type HashTransformerPlugin struct {
hasher ifc.KunstructuredHasher
}
func (p *HashTransformerPlugin) Config(
h *resmap.PluginHelpers, _ []byte) (err error) {
p.hasher = h.ResmapFactory().RF().Hasher()
return nil
}
// Transform appends hash to generated resources.
func (p *HashTransformerPlugin) Transform(m resmap.ResMap) error {
for _, res := range m.Resources() {
if res.NeedHashSuffix() {
h, err := p.hasher.Hash(res)
if err != nil {
return err
}
res.SetName(fmt.Sprintf("%s-%s", res.GetName(), h))
}
}
return nil
}
func NewHashTransformerPlugin() resmap.TransformerPlugin {
return &HashTransformerPlugin{}
}

View File

@@ -0,0 +1,187 @@
// Code generated by pluginator on ImageTagTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"regexp"
"strings"
"sigs.k8s.io/kustomize/api/transform"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/yaml"
)
// Find matching image declarations and replace
// the name, tag and/or digest.
type ImageTagTransformerPlugin struct {
ImageTag types.Image `json:"imageTag,omitempty" yaml:"imageTag,omitempty"`
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *ImageTagTransformerPlugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) {
p.ImageTag = types.Image{}
p.FieldSpecs = nil
return yaml.Unmarshal(c, p)
}
func (p *ImageTagTransformerPlugin) Transform(m resmap.ResMap) error {
for _, r := range m.Resources() {
for _, path := range p.FieldSpecs {
if !r.OrgId().IsSelected(&path.Gvk) {
continue
}
err := transform.MutateField(
r.Map(), path.PathSlice(), false, p.mutateImage)
if err != nil {
return err
}
}
// Kept for backward compatibility
if err := p.findAndReplaceImage(r.Map()); err != nil && r.OrgId().Kind != `CustomResourceDefinition` {
return err
}
}
return nil
}
func (p *ImageTagTransformerPlugin) mutateImage(in interface{}) (interface{}, error) {
original, ok := in.(string)
if !ok {
return nil, fmt.Errorf("image path is not of type string but %T", in)
}
if !isImageMatched(original, p.ImageTag.Name) {
return original, nil
}
name, tag := split(original)
if p.ImageTag.NewName != "" {
name = p.ImageTag.NewName
}
if p.ImageTag.NewTag != "" {
tag = ":" + p.ImageTag.NewTag
}
if p.ImageTag.Digest != "" {
tag = "@" + p.ImageTag.Digest
}
return name + tag, nil
}
// findAndReplaceImage replaces the image name and
// tags inside one object.
// It searches the object for container session
// then loops though all images inside containers
// session, finds matched ones and update the
// image name and tag name
func (p *ImageTagTransformerPlugin) findAndReplaceImage(obj map[string]interface{}) error {
paths := []string{"containers", "initContainers"}
updated := false
for _, path := range paths {
containers, found := obj[path]
if found && containers != nil {
if _, err := p.updateContainers(containers); err != nil {
return err
}
updated = true
}
}
if !updated {
return p.findContainers(obj)
}
return nil
}
func (p *ImageTagTransformerPlugin) updateContainers(in interface{}) (interface{}, error) {
containers, ok := in.([]interface{})
if !ok {
return nil, fmt.Errorf(
"containers path is not of type []interface{} but %T", in)
}
for i := range containers {
container := containers[i].(map[string]interface{})
containerImage, found := container["image"]
if !found {
continue
}
imageName := containerImage.(string)
if isImageMatched(imageName, p.ImageTag.Name) {
newImage, err := p.mutateImage(imageName)
if err != nil {
return nil, err
}
container["image"] = newImage
}
}
return containers, nil
}
func (p *ImageTagTransformerPlugin) findContainers(obj map[string]interface{}) error {
for key := range obj {
switch typedV := obj[key].(type) {
case map[string]interface{}:
err := p.findAndReplaceImage(typedV)
if err != nil {
return err
}
case []interface{}:
for i := range typedV {
item := typedV[i]
typedItem, ok := item.(map[string]interface{})
if ok {
err := p.findAndReplaceImage(typedItem)
if err != nil {
return err
}
}
}
}
}
return nil
}
func isImageMatched(s, t string) bool {
// Tag values are limited to [a-zA-Z0-9_.{}-].
// Some tools like Bazel rules_k8s allow tag patterns with {} characters.
// More info: https://github.com/bazelbuild/rules_k8s/pull/423
pattern, _ := regexp.Compile("^" + t + "(@sha256)?(:[a-zA-Z0-9_.{}-]*)?$")
return pattern.MatchString(s)
}
// split separates and returns the name and tag parts
// from the image string using either colon `:` or at `@` separators.
// Note that the returned tag keeps its separator.
func split(imageName string) (name string, tag string) {
// check if image name contains a domain
// if domain is present, ignore domain and check for `:`
ic := -1
if slashIndex := strings.Index(imageName, "/"); slashIndex < 0 {
ic = strings.LastIndex(imageName, ":")
} else {
lastIc := strings.LastIndex(imageName[slashIndex:], ":")
// set ic only if `:` is present
if lastIc > 0 {
ic = slashIndex + lastIc
}
}
ia := strings.LastIndex(imageName, "@")
if ic < 0 && ia < 0 {
return imageName, ""
}
i := ic
if ia > 0 {
i = ia
}
name = imageName[:i]
tag = imageName[i:]
return
}
func NewImageTagTransformerPlugin() resmap.TransformerPlugin {
return &ImageTagTransformerPlugin{}
}

View File

@@ -0,0 +1,42 @@
// Code generated by pluginator on LabelTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"sigs.k8s.io/kustomize/api/filters/labels"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
// Add the given labels to the given field specifications.
type LabelTransformerPlugin struct {
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *LabelTransformerPlugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) {
p.Labels = nil
p.FieldSpecs = nil
return yaml.Unmarshal(c, p)
}
func (p *LabelTransformerPlugin) Transform(m resmap.ResMap) error {
for _, r := range m.Resources() {
err := filtersutil.ApplyToJSON(labels.Filter{
Labels: p.Labels,
FsSlice: p.FieldSpecs,
}, r)
if err != nil {
return err
}
}
return nil
}
func NewLabelTransformerPlugin() resmap.TransformerPlugin {
return &LabelTransformerPlugin{}
}

View File

@@ -0,0 +1,46 @@
// Code generated by pluginator on LegacyOrderTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"sort"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
)
// Sort the resources using an ordering defined in the Gvk class.
// This puts cluster-wide basic resources with no
// dependencies (like Namespace, StorageClass, etc.)
// first, and resources with a high number of dependencies
// (like ValidatingWebhookConfiguration) last.
type LegacyOrderTransformerPlugin struct{}
// Nothing needed for configuration.
func (p *LegacyOrderTransformerPlugin) Config(
_ *resmap.PluginHelpers, _ []byte) (err error) {
return nil
}
func (p *LegacyOrderTransformerPlugin) Transform(m resmap.ResMap) (err error) {
resources := make([]*resource.Resource, m.Size())
ids := m.AllIds()
sort.Sort(resmap.IdSlice(ids))
for i, id := range ids {
resources[i], err = m.GetByCurrentId(id)
if err != nil {
return errors.Wrap(err, "expected match for sorting")
}
}
m.Clear()
for _, r := range resources {
m.Append(r)
}
return nil
}
func NewLegacyOrderTransformerPlugin() resmap.TransformerPlugin {
return &LegacyOrderTransformerPlugin{}
}

View File

@@ -0,0 +1,150 @@
// Code generated by pluginator on NamespaceTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"sigs.k8s.io/kustomize/api/filters/namespace"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/transform"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
// Change or set the namespace of non-cluster level resources.
type NamespaceTransformerPlugin struct {
types.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
// YAMLSupport can be set to true to use the kyaml filter instead of the
// kunstruct transformer.
// TODO: change the default to use kyaml when it is stable
YAMLSupport bool `json:"yamlSupport,omitempty" yaml:"yamlSupport,omitempty"`
}
func (p *NamespaceTransformerPlugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) {
p.Namespace = ""
p.FieldSpecs = nil
return yaml.Unmarshal(c, p)
}
func (p *NamespaceTransformerPlugin) Transform(m resmap.ResMap) error {
if len(p.Namespace) == 0 {
return nil
}
for _, r := range m.Resources() {
if len(r.Map()) == 0 {
// Don't mutate empty objects?
continue
}
id := r.OrgId()
if p.YAMLSupport {
// use the new style transform
err := filtersutil.ApplyToJSON(namespace.Filter{
Namespace: p.Namespace,
FsSlice: p.FieldSpecs,
}, r)
if err != nil {
return err
}
} else {
// use the old style transform
applicableFs := p.applicableFieldSpecs(id)
for _, fs := range applicableFs {
err := transform.MutateField(
r.Map(), fs.PathSlice(), fs.CreateIfNotPresent,
p.changeNamespace(r))
if err != nil {
return err
}
}
}
matches := m.GetMatchingResourcesByCurrentId(r.CurId().Equals)
if len(matches) != 1 {
return fmt.Errorf(
"namespace transformation produces ID conflict: %+v", matches)
}
}
return nil
}
// Special casing metadata.namespace since
// all objects have it, even "ClusterKind" objects
// that don't exist in a namespace (the Namespace
// object itself doesn't live in a namespace).
func (p *NamespaceTransformerPlugin) applicableFieldSpecs(id resid.ResId) []types.FieldSpec {
var res []types.FieldSpec
for _, fs := range p.FieldSpecs {
if id.IsSelected(&fs.Gvk) &&
(fs.Path != types.MetadataNamespacePath ||
(fs.Path == types.MetadataNamespacePath && id.IsNamespaceableKind())) {
res = append(res, fs)
}
}
return res
}
func (p *NamespaceTransformerPlugin) changeNamespace(
_ *resource.Resource) func(in interface{}) (interface{}, error) {
return func(in interface{}) (interface{}, error) {
switch in.(type) {
case string:
// will happen when the metadata/namespace
// value is replaced
return p.Namespace, nil
case []interface{}:
l, _ := in.([]interface{})
for idx, item := range l {
switch item.(type) {
case map[string]interface{}:
// Will happen when mutating the subjects
// field of ClusterRoleBinding and RoleBinding
inMap, _ := item.(map[string]interface{})
if _, ok := inMap["name"]; !ok {
continue
}
name, ok := inMap["name"].(string)
if !ok {
continue
}
// The only case we need to force the namespace
// if for the "service account". "default" is
// kind of hardcoded here for right now.
if name != "default" {
continue
}
inMap["namespace"] = p.Namespace
l[idx] = inMap
default:
// nothing to do for right now
}
}
return in, nil
case map[string]interface{}:
// Will happen if the createField=true
// when the namespace is added to the
// object
inMap := in.(map[string]interface{})
if len(inMap) == 0 {
return p.Namespace, nil
} else {
return in, nil
}
default:
return in, nil
}
}
}
func NewNamespaceTransformerPlugin() resmap.TransformerPlugin {
return &NamespaceTransformerPlugin{}
}

View File

@@ -0,0 +1,110 @@
// Code generated by pluginator on PatchJson6902Transformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
jsonpatch "github.com/evanphx/json-patch"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/api/filters/patchjson6902"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
type PatchJson6902TransformerPlugin struct {
ldr ifc.Loader
decodedPatch jsonpatch.Patch
Target types.PatchTarget `json:"target,omitempty" yaml:"target,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"`
YAMLSupport bool `json:"yamlSupport,omitempty" yaml:"yamlSupport,omitempty"`
}
func (p *PatchJson6902TransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.ldr = h.Loader()
err = yaml.Unmarshal(c, p)
if err != nil {
return err
}
if p.Target.Name == "" {
return fmt.Errorf("must specify the target name")
}
if p.Path == "" && p.JsonOp == "" {
return fmt.Errorf("empty file path and empty jsonOp")
}
if p.Path != "" {
if p.JsonOp != "" {
return fmt.Errorf("must specify a file path or jsonOp, not both")
}
rawOp, err := p.ldr.Load(p.Path)
if err != nil {
return err
}
p.JsonOp = string(rawOp)
if p.JsonOp == "" {
return fmt.Errorf("patch file '%s' empty seems to be empty", p.Path)
}
}
if p.JsonOp[0] != '[' {
// if it doesn't seem to be JSON, imagine
// it is YAML, and convert to JSON.
op, err := yaml.YAMLToJSON([]byte(p.JsonOp))
if err != nil {
return err
}
p.JsonOp = string(op)
}
p.decodedPatch, err = jsonpatch.DecodePatch([]byte(p.JsonOp))
if err != nil {
return errors.Wrapf(err, "decoding %s", p.JsonOp)
}
if len(p.decodedPatch) == 0 {
return fmt.Errorf(
"patch appears to be empty; file=%s, JsonOp=%s", p.Path, p.JsonOp)
}
return err
}
func (p *PatchJson6902TransformerPlugin) Transform(m resmap.ResMap) error {
id := resid.NewResIdWithNamespace(
resid.Gvk{
Group: p.Target.Group,
Version: p.Target.Version,
Kind: p.Target.Kind,
},
p.Target.Name,
p.Target.Namespace,
)
obj, err := m.GetById(id)
if err != nil {
return err
}
if !p.YAMLSupport {
rawObj, err := obj.MarshalJSON()
if err != nil {
return err
}
modifiedObj, err := p.decodedPatch.Apply(rawObj)
if err != nil {
return errors.Wrapf(
err, "failed to apply json patch '%s'", p.JsonOp)
}
return obj.UnmarshalJSON(modifiedObj)
} else {
return filtersutil.ApplyToJSON(patchjson6902.Filter{
Patch: p.JsonOp,
}, obj)
}
}
func NewPatchJson6902TransformerPlugin() resmap.TransformerPlugin {
return &PatchJson6902TransformerPlugin{}
}

View File

@@ -0,0 +1,108 @@
// Code generated by pluginator on PatchStrategicMergeTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"sigs.k8s.io/kustomize/api/filters/patchstrategicmerge"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
type PatchStrategicMergeTransformerPlugin struct {
h *resmap.PluginHelpers
loadedPatches []*resource.Resource
Paths []types.PatchStrategicMerge `json:"paths,omitempty" yaml:"paths,omitempty"`
Patches string `json:"patches,omitempty" yaml:"patches,omitempty"`
YAMLSupport bool `json:"yamlSupport,omitempty" yaml:"yamlSupport,omitempty"`
}
func (p *PatchStrategicMergeTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.h = h
err = yaml.Unmarshal(c, p)
if err != nil {
return err
}
if len(p.Paths) == 0 && p.Patches == "" {
return fmt.Errorf("empty file path and empty patch content")
}
if len(p.Paths) != 0 {
for _, onePath := range p.Paths {
res, err := p.h.ResmapFactory().RF().SliceFromBytes([]byte(onePath))
if err == nil {
p.loadedPatches = append(p.loadedPatches, res...)
continue
}
res, err = p.h.ResmapFactory().RF().SliceFromPatches(
p.h.Loader(), []types.PatchStrategicMerge{onePath})
if err != nil {
return err
}
p.loadedPatches = append(p.loadedPatches, res...)
}
}
if p.Patches != "" {
res, err := p.h.ResmapFactory().RF().SliceFromBytes([]byte(p.Patches))
if err != nil {
return err
}
p.loadedPatches = append(p.loadedPatches, res...)
}
if len(p.loadedPatches) == 0 {
return fmt.Errorf(
"patch appears to be empty; files=%v, Patch=%s", p.Paths, p.Patches)
}
return err
}
func (p *PatchStrategicMergeTransformerPlugin) Transform(m resmap.ResMap) error {
patches, err := p.h.ResmapFactory().MergePatches(p.loadedPatches)
if err != nil {
return err
}
for _, patch := range patches.Resources() {
target, err := m.GetById(patch.OrgId())
if err != nil {
return err
}
if !p.YAMLSupport {
err = target.Patch(patch.Copy())
if err != nil {
return err
}
// remove the resource from resmap
// when the patch is to $patch: delete that target
if len(target.Map()) == 0 {
err = m.Remove(target.CurId())
if err != nil {
return err
}
}
} else {
patchCopy := patch.DeepCopy()
patchCopy.SetName(target.GetName())
patchCopy.SetNamespace(target.GetNamespace())
patchCopy.SetGvk(target.GetGvk())
node, err := filtersutil.GetRNode(patchCopy)
if err != nil {
return err
}
err = filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
Patch: node,
}, target)
}
}
return nil
}
func NewPatchStrategicMergeTransformerPlugin() resmap.TransformerPlugin {
return &PatchStrategicMergeTransformerPlugin{}
}

View File

@@ -0,0 +1,193 @@
// Code generated by pluginator on PatchTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"strings"
jsonpatch "github.com/evanphx/json-patch"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/api/filters/patchjson6902"
"sigs.k8s.io/kustomize/api/filters/patchstrategicmerge"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
type PatchTransformerPlugin struct {
loadedPatch *resource.Resource
decodedPatch jsonpatch.Patch
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Patch string `json:"patch,omitempty" yaml:"patch,omitempty"`
Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"`
YAMLSupport bool `json:"yamlSupport,omitempty" yaml:"yamlSupport,omitempty"`
}
func (p *PatchTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) error {
err := yaml.Unmarshal(c, p)
if err != nil {
return err
}
p.Patch = strings.TrimSpace(p.Patch)
if p.Patch == "" && p.Path == "" {
return fmt.Errorf(
"must specify one of patch and path in\n%s", string(c))
}
if p.Patch != "" && p.Path != "" {
return fmt.Errorf(
"patch and path can't be set at the same time\n%s", string(c))
}
if p.Path != "" {
loaded, loadErr := h.Loader().Load(p.Path)
if loadErr != nil {
return loadErr
}
p.Patch = string(loaded)
}
patchSM, errSM := h.ResmapFactory().RF().FromBytes([]byte(p.Patch))
patchJson, errJson := jsonPatchFromBytes([]byte(p.Patch))
if (errSM == nil && errJson == nil) ||
(patchSM != nil && patchJson != nil) {
return fmt.Errorf(
"illegally qualifies as both an SM and JSON patch: [%v]",
p.Patch)
}
if errSM != nil && errJson != nil {
return fmt.Errorf(
"unable to parse SM or JSON patch from [%v]", p.Patch)
}
if errSM == nil {
p.loadedPatch = patchSM
} else {
p.decodedPatch = patchJson
}
return nil
}
func (p *PatchTransformerPlugin) Transform(m resmap.ResMap) error {
if p.loadedPatch != nil {
// The patch was a strategic merge patch
return p.transformStrategicMerge(m, p.loadedPatch)
} else {
return p.transformJson6902(m, p.decodedPatch)
}
}
// transformStrategicMerge applies the provided strategic merge patch
// to all the resources in the ResMap that match either the Target or
// the identifier of the patch.
func (p *PatchTransformerPlugin) transformStrategicMerge(m resmap.ResMap, patch *resource.Resource) error {
if p.Target == nil {
target, err := m.GetById(patch.OrgId())
if err != nil {
return err
}
return p.applySMPatch(target, patch)
}
resources, err := m.Select(*p.Target)
if err != nil {
return err
}
for _, res := range resources {
patchCopy := patch.DeepCopy()
patchCopy.SetName(res.GetName())
patchCopy.SetNamespace(res.GetNamespace())
patchCopy.SetGvk(res.GetGvk())
err := p.applySMPatch(res, patchCopy)
if err != nil {
return err
}
}
return nil
}
// applySMPatch applies the provided strategic merge patch to the
// given resource. Depending on the value of YAMLSupport, it will either
// use the legacy implementation or the kyaml-based solution.
func (p *PatchTransformerPlugin) applySMPatch(resource, patch *resource.Resource) error {
if !p.YAMLSupport {
return resource.Patch(patch.Copy())
} else {
node, err := filtersutil.GetRNode(patch)
if err != nil {
return err
}
return filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
Patch: node,
}, resource)
}
}
// transformJson6902 applies the provided json6902 patch
// to all the resources in the ResMap that match the Target.
func (p *PatchTransformerPlugin) transformJson6902(m resmap.ResMap, patch jsonpatch.Patch) error {
if p.Target == nil {
return fmt.Errorf("must specify a target for patch %s", p.Patch)
}
resources, err := m.Select(*p.Target)
if err != nil {
return err
}
for _, res := range resources {
err = p.applyJson6902Patch(res, patch)
if err != nil {
return err
}
}
return nil
}
// applyJson6902Patch applies the provided patch to the given resource.
// Depending on the value of YAMLSupport, it will either
// use the legacy implementation or the kyaml-based solution.
func (p *PatchTransformerPlugin) applyJson6902Patch(resource *resource.Resource, patch jsonpatch.Patch) error {
if !p.YAMLSupport {
rawObj, err := resource.MarshalJSON()
if err != nil {
return err
}
modifiedObj, err := patch.Apply(rawObj)
if err != nil {
return errors.Wrapf(
err, "failed to apply json patch '%s'", p.Patch)
}
return resource.UnmarshalJSON(modifiedObj)
} else {
return filtersutil.ApplyToJSON(patchjson6902.Filter{
Patch: p.Patch,
}, resource)
}
}
// jsonPatchFromBytes loads a Json 6902 patch from
// a bytes input
func jsonPatchFromBytes(
in []byte) (jsonpatch.Patch, error) {
ops := string(in)
if ops == "" {
return nil, fmt.Errorf("empty json patch operations")
}
if ops[0] != '[' {
jsonOps, err := yaml.YAMLToJSON(in)
if err != nil {
return nil, err
}
ops = string(jsonOps)
}
return jsonpatch.DecodePatch([]byte(ops))
}
func NewPatchTransformerPlugin() resmap.TransformerPlugin {
return &PatchTransformerPlugin{}
}

View File

@@ -0,0 +1,123 @@
// Code generated by pluginator on PrefixSuffixTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"errors"
"fmt"
"sigs.k8s.io/kustomize/api/transform"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/yaml"
)
// Add the given prefix and suffix to the field.
type PrefixSuffixTransformerPlugin struct {
Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
Suffix string `json:"suffix,omitempty" yaml:"suffix,omitempty"`
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
// Not placed in a file yet due to lack of demand.
var prefixSuffixFieldSpecsToSkip = []types.FieldSpec{
{
Gvk: resid.Gvk{Kind: "CustomResourceDefinition"},
},
{
Gvk: resid.Gvk{Group: "apiregistration.k8s.io", Kind: "APIService"},
},
}
func (p *PrefixSuffixTransformerPlugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) {
p.Prefix = ""
p.Suffix = ""
p.FieldSpecs = nil
err = yaml.Unmarshal(c, p)
if err != nil {
return
}
if p.FieldSpecs == nil {
return errors.New("fieldSpecs is not expected to be nil")
}
return
}
func (p *PrefixSuffixTransformerPlugin) Transform(m resmap.ResMap) error {
// Even if both the Prefix and Suffix are empty we want
// to proceed with the transformation. This allows to add contextual
// information to the resources (AddNamePrefix and AddNameSuffix).
for _, r := range m.Resources() {
if p.shouldSkip(r.OrgId()) {
// Don't change the actual definition
// of a CRD.
continue
}
id := r.OrgId()
// current default configuration contains
// only one entry: "metadata/name" with no GVK
for _, path := range p.FieldSpecs {
if !id.IsSelected(&path.Gvk) {
// With the currrent default configuration,
// because no Gvk is specified, so a wild
// card
continue
}
if smellsLikeANameChange(&path) {
// "metadata/name" is the only field.
// this will add a prefix and a suffix
// to the resource even if those are
// empty
r.AddNamePrefix(p.Prefix)
r.AddNameSuffix(p.Suffix)
}
// the addPrefixSuffix method will not
// change the name if both the prefix and suffix
// are empty.
err := transform.MutateField(
r.Map(),
path.PathSlice(),
path.CreateIfNotPresent,
p.addPrefixSuffix)
if err != nil {
return err
}
}
}
return nil
}
func smellsLikeANameChange(fs *types.FieldSpec) bool {
return fs.Path == "metadata/name"
}
func (p *PrefixSuffixTransformerPlugin) shouldSkip(
id resid.ResId) bool {
for _, path := range prefixSuffixFieldSpecsToSkip {
if id.IsSelected(&path.Gvk) {
return true
}
}
return false
}
func (p *PrefixSuffixTransformerPlugin) addPrefixSuffix(
in interface{}) (interface{}, error) {
s, ok := in.(string)
if !ok {
return nil, fmt.Errorf("%#v is expected to be %T", in, s)
}
return fmt.Sprintf("%s%s%s", p.Prefix, s, p.Suffix), nil
}
func NewPrefixSuffixTransformerPlugin() resmap.TransformerPlugin {
return &PrefixSuffixTransformerPlugin{}
}

View File

@@ -0,0 +1,88 @@
// Code generated by pluginator on ReplicaCountTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"sigs.k8s.io/kustomize/api/transform"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml"
)
// Find matching replicas declarations and replace the count.
// Eases the kustomization configuration of replica changes.
type ReplicaCountTransformerPlugin struct {
Replica types.Replica `json:"replica,omitempty" yaml:"replica,omitempty"`
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *ReplicaCountTransformerPlugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) {
p.Replica = types.Replica{}
p.FieldSpecs = nil
return yaml.Unmarshal(c, p)
}
func (p *ReplicaCountTransformerPlugin) Transform(m resmap.ResMap) error {
found := false
for i, replicaSpec := range p.FieldSpecs {
matcher := p.createMatcher(i)
matchOriginal := m.GetMatchingResourcesByOriginalId(matcher)
matchCurrent := m.GetMatchingResourcesByCurrentId(matcher)
for _, res := range append(matchOriginal, matchCurrent...) {
found = true
err := transform.MutateField(
res.Map(), replicaSpec.PathSlice(),
replicaSpec.CreateIfNotPresent, p.addReplicas)
if err != nil {
return err
}
}
}
if !found {
gvks := make([]string, len(p.FieldSpecs))
for i, replicaSpec := range p.FieldSpecs {
gvks[i] = replicaSpec.Gvk.String()
}
return fmt.Errorf("resource with name %s does not match a config with the following GVK %v",
p.Replica.Name, gvks)
}
return nil
}
// Match Replica.Name and FieldSpec
func (p *ReplicaCountTransformerPlugin) createMatcher(i int) resmap.IdMatcher {
return func(r resid.ResId) bool {
return r.Name == p.Replica.Name &&
r.Gvk.IsSelected(&p.FieldSpecs[i].Gvk)
}
}
func (p *ReplicaCountTransformerPlugin) addReplicas(in interface{}) (interface{}, error) {
switch m := in.(type) {
case int64:
// Was already in the field.
case map[string]interface{}:
if len(m) != 0 {
// A map was already in the replicas field, don't want to
// discard this data silently.
return nil, fmt.Errorf("%#v is expected to be %T", in, m)
}
// Just got added, default type is map, but we can return anything.
default:
return nil, fmt.Errorf("%#v is expected to be %T", in, m)
}
return p.Replica.Count, nil
}
func NewReplicaCountTransformerPlugin() resmap.TransformerPlugin {
return &ReplicaCountTransformerPlugin{}
}

View File

@@ -0,0 +1,39 @@
// Code generated by pluginator on SecretGenerator; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"sigs.k8s.io/kustomize/api/kv"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml"
)
type SecretGeneratorPlugin struct {
h *resmap.PluginHelpers
types.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
types.SecretArgs
}
func (p *SecretGeneratorPlugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.SecretArgs = types.SecretArgs{}
err = yaml.Unmarshal(config, p)
if p.SecretArgs.Name == "" {
p.SecretArgs.Name = p.Name
}
if p.SecretArgs.Namespace == "" {
p.SecretArgs.Namespace = p.Namespace
}
p.h = h
return
}
func (p *SecretGeneratorPlugin) Generate() (resmap.ResMap, error) {
return p.h.ResmapFactory().FromSecretArgs(
kv.NewLoader(p.h.Loader(), p.h.Validator()), p.SecretArgs)
}
func NewSecretGeneratorPlugin() resmap.GeneratorPlugin {
return &SecretGeneratorPlugin{}
}

View File

@@ -0,0 +1,142 @@
// Code generated by pluginator on ValueAddTransformer; DO NOT EDIT.
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"path/filepath"
"strings"
"sigs.k8s.io/kustomize/api/filters/namespace"
"sigs.k8s.io/kustomize/api/filters/valueadd"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/filtersutil"
"sigs.k8s.io/yaml"
)
// An 'Add' transformer inspired by the IETF RFC 6902 JSON spec Add operation.
type ValueAddTransformerPlugin struct {
// Value is the value to add.
// Defaults to base name of encompassing kustomization root.
Value string `json:"value,omitempty" yaml:"value,omitempty"`
// Targets is a slice of targets that should have the value added.
Targets []Target `json:"targets,omitempty" yaml:"targets,omitempty"`
// TargetFilePath is a file path. If specified, the file will be parsed into
// a slice of Target, and appended to anything that was specified in the
// Targets field. This is just a means to share common target specifications.
TargetFilePath string `json:"targetFilePath,omitempty" yaml:"targetFilePath,omitempty"`
}
// Target describes where to put the value.
type Target struct {
// Selector selects the resources to modify.
Selector *types.Selector `json:"selector,omitempty" yaml:"selector,omitempty"`
// NotSelector selects the resources to exclude
// from those included by overly broad selectors.
// TODO: implement this?
// NotSelector *types.Selector `json:"notSelector,omitempty" yaml:"notSelector,omitempty"`
// FieldPath is a JSON-style path to the field intended to hold the value.
FieldPath string `json:"fieldPath,omitempty" yaml:"fieldPath,omitempty"`
// FilePathPosition is passed to the filter directly. Look there for doc.
FilePathPosition int `json:"filePathPosition,omitempty" yaml:"filePathPosition,omitempty"`
}
func (p *ValueAddTransformerPlugin) Config(h *resmap.PluginHelpers, c []byte) error {
err := yaml.Unmarshal(c, p)
if err != nil {
return err
}
p.Value = strings.TrimSpace(p.Value)
if p.Value == "" {
p.Value = filepath.Base(h.Loader().Root())
}
if p.TargetFilePath != "" {
bytes, err := h.Loader().Load(p.TargetFilePath)
if err != nil {
return err
}
var targets struct {
Targets []Target `json:"targets,omitempty" yaml:"targets,omitempty"`
}
err = yaml.Unmarshal(bytes, &targets)
if err != nil {
return err
}
p.Targets = append(p.Targets, targets.Targets...)
}
if len(p.Targets) == 0 {
return fmt.Errorf("must specify at least one target")
}
for _, target := range p.Targets {
if err = validateSelector(target.Selector); err != nil {
return err
}
// TODO: call validateSelector(target.NotSelector) if field added.
if err = validateJsonFieldPath(target.FieldPath); err != nil {
return err
}
if target.FilePathPosition < 0 {
return fmt.Errorf(
"value of FilePathPosition (%d) cannot be negative",
target.FilePathPosition)
}
}
return nil
}
// TODO: implement
func validateSelector(_ *types.Selector) error {
return nil
}
// TODO: Enforce RFC 6902?
func validateJsonFieldPath(p string) error {
if len(p) == 0 {
return fmt.Errorf("fieldPath cannot be empty")
}
return nil
}
func (p *ValueAddTransformerPlugin) Transform(m resmap.ResMap) (err error) {
for _, t := range p.Targets {
var resources []*resource.Resource
if t.Selector == nil {
resources = m.Resources()
} else {
resources, err = m.Select(*t.Selector)
if err != nil {
return err
}
}
// TODO: consider t.NotSelector if implemented
for _, res := range resources {
if t.FieldPath == types.MetadataNamespacePath {
err = filtersutil.ApplyToJSON(namespace.Filter{
Namespace: p.Value,
}, res)
} else {
err = filtersutil.ApplyToJSON(valueadd.Filter{
Value: p.Value,
FieldPath: t.FieldPath,
FilePathPosition: t.FilePathPosition,
}, res)
}
if err != nil {
return err
}
}
}
return nil
}
func NewValueAddTransformerPlugin() resmap.TransformerPlugin {
return &ValueAddTransformerPlugin{}
}

8
api/builtins/doc.go Normal file
View File

@@ -0,0 +1,8 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package builtins holds code generated from the builtin plugins.
// The "builtin" plugins are written as normal plugins and can
// be used as such, but they are also used to generate the code
// in this package so they can be statically linked to client code.
package builtins

View File

@@ -0,0 +1,79 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"io/ioutil"
"path/filepath"
"strings"
)
// ConfirmedDir is a clean, absolute, delinkified path
// that was confirmed to point to an existing directory.
type ConfirmedDir string
// NewTmpConfirmedDir returns a temporary dir, else error.
// The directory is cleaned, no symlinks, etc. so it's
// returned as a ConfirmedDir.
func NewTmpConfirmedDir() (ConfirmedDir, error) {
n, err := ioutil.TempDir("", "kustomize-")
if err != nil {
return "", err
}
// In MacOs `ioutil.TempDir` creates a directory
// with root in the `/var` folder, which is in turn
// a symlinked path to `/private/var`.
// Function `filepath.EvalSymlinks`is used to
// resolve the real absolute path.
deLinked, err := filepath.EvalSymlinks(n)
return ConfirmedDir(deLinked), err
}
// HasPrefix returns true if the directory argument
// is a prefix of self (d) from the point of view of
// a file system.
//
// I.e., it's true if the argument equals or contains
// self (d) in a file path sense.
//
// HasPrefix emulates the semantics of strings.HasPrefix
// such that the following are true:
//
// strings.HasPrefix("foobar", "foobar")
// strings.HasPrefix("foobar", "foo")
// strings.HasPrefix("foobar", "")
//
// d := fSys.ConfirmDir("/foo/bar")
// d.HasPrefix("/foo/bar")
// d.HasPrefix("/foo")
// d.HasPrefix("/")
//
// Not contacting a file system here to check for
// actual path existence.
//
// This is tested on linux, but will have trouble
// on other operating systems.
// TODO(monopole) Refactor when #golang/go/18358 closes.
// See also:
// https://github.com/golang/go/issues/18358
// https://github.com/golang/dep/issues/296
// https://github.com/golang/dep/blob/master/internal/fs/fs.go#L33
// https://codereview.appspot.com/5712045
func (d ConfirmedDir) HasPrefix(path ConfirmedDir) bool {
if path.String() == string(filepath.Separator) || path == d {
return true
}
return strings.HasPrefix(
string(d),
string(path)+string(filepath.Separator))
}
func (d ConfirmedDir) Join(path string) string {
return filepath.Join(string(d), path)
}
func (d ConfirmedDir) String() string {
return string(d)
}

View File

@@ -0,0 +1,109 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys_test
import (
"path/filepath"
"testing"
. "sigs.k8s.io/kustomize/api/filesys"
)
func TestJoin(t *testing.T) {
fSys := MakeFsInMemory()
err := fSys.Mkdir("/foo")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
d, f, err := fSys.CleanedAbs("/foo")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
if f != "" {
t.Fatalf("unexpected file: %v", f)
}
if d.Join("bar") != "/foo/bar" {
t.Fatalf("expected join %s", d.Join("bar"))
}
}
func TestHasPrefix_Slash(t *testing.T) {
fSys := MakeFsInMemory()
d, f, err := fSys.CleanedAbs("/")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
if f != "" {
t.Fatalf("unexpected file: %v", f)
}
if d.HasPrefix("/hey") {
t.Fatalf("should be false")
}
if !d.HasPrefix("/") {
t.Fatalf("/ should have the prefix /")
}
}
func TestHasPrefix_SlashFoo(t *testing.T) {
fSys := MakeFsInMemory()
err := fSys.Mkdir("/foo")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
d, _, err := fSys.CleanedAbs("/foo")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
if d.HasPrefix("/fo") {
t.Fatalf("/foo does not have path prefix /fo")
}
if d.HasPrefix("/fod") {
t.Fatalf("/foo does not have path prefix /fod")
}
if !d.HasPrefix("/foo") {
t.Fatalf("/foo should have prefix /foo")
}
}
func TestHasPrefix_SlashFooBar(t *testing.T) {
fSys := MakeFsInMemory()
err := fSys.MkdirAll("/foo/bar")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
d, _, err := fSys.CleanedAbs("/foo/bar")
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
if d.HasPrefix("/fo") {
t.Fatalf("/foo/bar does not have path prefix /fo")
}
if d.HasPrefix("/foobar") {
t.Fatalf("/foo/bar does not have path prefix /foobar")
}
if !d.HasPrefix("/foo/bar") {
t.Fatalf("/foo/bar should have prefix /foo/bar")
}
if !d.HasPrefix("/foo") {
t.Fatalf("/foo/bar should have prefix /foo")
}
if !d.HasPrefix("/") {
t.Fatalf("/foo/bar should have prefix /")
}
}
func TestNewTempConfirmDir(t *testing.T) {
tmp, err := NewTmpConfirmedDir()
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
delinked, err := filepath.EvalSymlinks(string(tmp))
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if string(tmp) != delinked {
t.Fatalf("unexpected path containing symlinks")
}
}

15
api/filesys/file.go Normal file
View File

@@ -0,0 +1,15 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"io"
"os"
)
// File groups the basic os.File methods.
type File interface {
io.ReadWriteCloser
Stat() (os.FileInfo, error)
}

34
api/filesys/fileinfo.go Normal file
View File

@@ -0,0 +1,34 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"os"
"time"
)
var _ os.FileInfo = fileInfo{}
// fileInfo implements os.FileInfo for a fileInMemory instance.
type fileInfo struct {
node *fsNode
}
// Name returns the name of the file
func (fi fileInfo) Name() string { return fi.node.Name() }
// Size returns the size of the file
func (fi fileInfo) Size() int64 { return fi.node.Size() }
// Mode returns the file mode
func (fi fileInfo) Mode() os.FileMode { return 0777 }
// ModTime returns a bogus time
func (fi fileInfo) ModTime() time.Time { return time.Time{} }
// IsDir returns true if it is a directory
func (fi fileInfo) IsDir() bool { return fi.node.isNodeADir() }
// Sys should return underlying data source, but it now returns nil
func (fi fileInfo) Sys() interface{} { return nil }

27
api/filesys/fileondisk.go Normal file
View File

@@ -0,0 +1,27 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"os"
)
var _ File = &fileOnDisk{}
// fileOnDisk implements File using the local filesystem.
type fileOnDisk struct {
file *os.File
}
// Close closes a file.
func (f *fileOnDisk) Close() error { return f.file.Close() }
// Read reads a file's content.
func (f *fileOnDisk) Read(p []byte) (n int, err error) { return f.file.Read(p) }
// Write writes bytes to a file
func (f *fileOnDisk) Write(p []byte) (n int, err error) { return f.file.Write(p) }
// Stat returns an interface which has all the information regarding the file.
func (f *fileOnDisk) Stat() (os.FileInfo, error) { return f.file.Stat() }

50
api/filesys/filesystem.go Normal file
View File

@@ -0,0 +1,50 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package filesys provides a file system abstraction layer.
package filesys
import (
"path/filepath"
)
const (
Separator = string(filepath.Separator)
SelfDir = "."
ParentDir = ".."
)
// FileSystem groups basic os filesystem methods.
// It's supposed be functional subset of https://golang.org/pkg/os
type FileSystem interface {
// Create a file.
Create(path string) (File, error)
// MkDir makes a directory.
Mkdir(path string) error
// MkDirAll makes a directory path, creating intervening directories.
MkdirAll(path string) error
// RemoveAll removes path and any children it contains.
RemoveAll(path string) error
// Open opens the named file for reading.
Open(path string) (File, error)
// IsDir returns true if the path is a directory.
IsDir(path string) bool
// CleanedAbs converts the given path into a
// directory and a file name, where the directory
// is represented as a ConfirmedDir and all that implies.
// If the entire path is a directory, the file component
// is an empty string.
CleanedAbs(path string) (ConfirmedDir, string, error)
// Exists is true if the path exists in the file system.
Exists(path string) bool
// Glob returns the list of matching files,
// emulating https://golang.org/pkg/path/filepath/#Glob
Glob(pattern string) ([]string, error)
// ReadFile returns the contents of the file at the given path.
ReadFile(path string) ([]byte, error)
// WriteFile writes the data to a file at the given path,
// overwriting anything that's already there.
WriteFile(path string, data []byte) error
// Walk walks the file system with the given WalkFunc.
Walk(path string, walkFn filepath.WalkFunc) error
}

557
api/filesys/fsnode.go Normal file
View File

@@ -0,0 +1,557 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"bytes"
"fmt"
"log"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
"github.com/pkg/errors"
)
var _ File = &fsNode{}
var _ FileSystem = &fsNode{}
// fsNode is either a file or a directory.
type fsNode struct {
// What node owns me?
parent *fsNode
// Value to return as the Name() when the
// parent is nil.
nilParentName string
// A directory mapping names to nodes.
// If dir is nil, then self node is a file.
// If dir is non-nil, then self node is a directory,
// albeit possibly an empty directory.
dir map[string]*fsNode
// if this node is a file, this is the content.
content []byte
// if this node is a file, this tracks whether or
// not it is "open".
open bool
}
// MakeEmptyDirInMemory returns an empty directory.
// The paths of nodes in this object will never
// report a leading Separator, meaning they
// aren't "absolute" in the sense defined by
// https://golang.org/pkg/path/filepath/#IsAbs.
func MakeEmptyDirInMemory() *fsNode {
return &fsNode{
dir: make(map[string]*fsNode),
}
}
// MakeFsInMemory returns an empty 'file system'.
// The paths of nodes in this object will always
// report a leading Separator, meaning they
// are "absolute" in the sense defined by
// https://golang.org/pkg/path/filepath/#IsAbs.
// This is a relevant difference when using Walk,
// Glob, Match, etc.
func MakeFsInMemory() FileSystem {
return &fsNode{
nilParentName: Separator,
dir: make(map[string]*fsNode),
}
}
// Name returns the name of the node.
func (n *fsNode) Name() string {
if n.parent == nil {
// Unable to lookup name in parent.
return n.nilParentName
}
if !n.parent.isNodeADir() {
log.Fatal("parent not a dir")
}
for key, value := range n.parent.dir {
if value == n {
return key
}
}
log.Fatal("unable to find fsNode name")
return ""
}
// Path returns the full path to the node.
func (n *fsNode) Path() string {
if n.parent == nil {
return n.nilParentName
}
if !n.parent.isNodeADir() {
log.Fatal("parent not a dir, structural error")
}
return filepath.Join(n.parent.Path(), n.Name())
}
// mySplit trims trailing separators from the directory
// result of filepath.Split.
func mySplit(s string) (string, string) {
dName, fName := filepath.Split(s)
return StripTrailingSeps(dName), fName
}
func (n *fsNode) addFile(name string, c []byte) (result *fsNode, err error) {
parent := n
dName, fileName := mySplit(name)
if dName != "" {
parent, err = parent.addDir(dName)
if err != nil {
return nil, err
}
}
if !isLegalFileNameForCreation(fileName) {
return nil, fmt.Errorf(
"illegal name '%s' in file creation", fileName)
}
result, ok := parent.dir[fileName]
if ok {
// File already exists; overwrite it.
result.content = c
return result, nil
}
result = &fsNode{
content: c,
parent: parent,
}
parent.dir[fileName] = result
return result, nil
}
// Create implements FileSystem.
// Create makes an empty file.
func (n *fsNode) Create(path string) (result File, err error) {
return n.AddFile(path, []byte{})
}
// WriteFile implements FileSystem.
func (n *fsNode) WriteFile(path string, d []byte) error {
_, err := n.AddFile(path, d)
return err
}
// AddFile adds a file and any necessary containing
// directories to the node.
func (n *fsNode) AddFile(
name string, c []byte) (result *fsNode, err error) {
if n.dir == nil {
return nil, fmt.Errorf(
"cannot add a file to a non-directory '%s'", n.Name())
}
return n.addFile(cleanQueryPath(name), c)
}
func (n *fsNode) addDir(path string) (result *fsNode, err error) {
parent := n
dName, subDirName := mySplit(path)
if dName != "" {
parent, err = n.addDir(dName)
if err != nil {
return nil, err
}
}
switch subDirName {
case "", SelfDir:
return n, nil
case ParentDir:
if n.parent == nil {
return nil, fmt.Errorf(
"cannot add a directory above '%s'", n.Path())
}
return n.parent, nil
default:
if !isLegalFileNameForCreation(subDirName) {
return nil, fmt.Errorf(
"illegal name '%s' in directory creation", subDirName)
}
result, ok := parent.dir[subDirName]
if ok {
if result.isNodeADir() {
// it's already there.
return result, nil
}
return nil, fmt.Errorf(
"cannot make dir '%s'; a file of that name already exists in '%s'",
subDirName, parent.Name())
}
result = &fsNode{
dir: make(map[string]*fsNode),
parent: parent,
}
parent.dir[subDirName] = result
return result, nil
}
}
// Mkdir implements FileSystem.
// Mkdir creates a directory.
func (n *fsNode) Mkdir(path string) error {
_, err := n.AddDir(path)
return err
}
// MkdirAll implements FileSystem.
// MkdirAll creates a directory.
func (n *fsNode) MkdirAll(path string) error {
_, err := n.AddDir(path)
return err
}
// AddDir adds a directory to the node, not complaining
// if it is already there.
func (n *fsNode) AddDir(path string) (result *fsNode, err error) {
if n.dir == nil {
return nil, fmt.Errorf(
"cannot add a directory to file node '%s'", n.Name())
}
return n.addDir(cleanQueryPath(path))
}
// CleanedAbs implements FileSystem.
func (n *fsNode) CleanedAbs(path string) (ConfirmedDir, string, error) {
node, err := n.Find(path)
if err != nil {
return "", "", errors.Wrap(err, "unable to clean")
}
if node == nil {
return "", "", fmt.Errorf("'%s' doesn't exist", path)
}
if node.isNodeADir() {
return ConfirmedDir(node.Path()), "", nil
}
return ConfirmedDir(node.parent.Path()), node.Name(), nil
}
// Exists implements FileSystem.
// Exists returns true if the path exists.
func (n *fsNode) Exists(path string) bool {
if !n.isNodeADir() {
return n.Name() == path
}
result, err := n.Find(path)
if err != nil {
return false
}
return result != nil
}
func cleanQueryPath(path string) string {
// Always ignore leading separator?
// Remember that filepath.Clean returns "." if
// given an empty string argument.
return filepath.Clean(StripLeadingSeps(path))
}
// Find finds the given node, else nil if not found.
// Return error on structural/argument errors.
func (n *fsNode) Find(path string) (*fsNode, error) {
if !n.isNodeADir() {
return nil, fmt.Errorf("can only find inside a dir")
}
if path == "" {
// Special case; check *before* cleaning and *before*
// comparison to nilParentName.
return nil, nil
}
if (n.parent == nil && path == n.nilParentName) || path == SelfDir {
// Special case
return n, nil
}
return n.findIt(cleanQueryPath(path))
}
func (n *fsNode) findIt(path string) (result *fsNode, err error) {
parent := n
dName, item := mySplit(path)
if dName != "" {
parent, err = n.findIt(dName)
if err != nil {
return nil, err
}
if parent == nil {
// all done, target doesn't exist.
return nil, nil
}
}
if !parent.isNodeADir() {
return nil, fmt.Errorf("'%s' is not a directory", parent.Path())
}
return parent.dir[item], nil
}
// RemoveAll implements FileSystem.
// RemoveAll removes an item and everything it contains.
func (n *fsNode) RemoveAll(path string) error {
result, err := n.Find(path)
if err != nil {
return err
}
if result == nil {
return fmt.Errorf("cannot find '%s' to remove it", path)
}
return result.Remove()
}
// Remove drop the node, and everything it contains, from its parent.
func (n *fsNode) Remove() error {
if n.parent == nil {
return fmt.Errorf("cannot remove a root node")
}
if !n.parent.isNodeADir() {
log.Fatal("parent not a dir")
}
for key, value := range n.parent.dir {
if value == n {
delete(n.parent.dir, key)
return nil
}
}
log.Fatal("unable to find self in parent")
return nil
}
// isNodeADir returns true if the node is a directory.
// Cannot collide with the poorly named "IsDir".
func (n *fsNode) isNodeADir() bool {
return n.dir != nil
}
// IsDir implements FileSystem.
// IsDir returns true if the argument resolves
// to a directory rooted at the node.
func (n *fsNode) IsDir(path string) bool {
result, err := n.Find(path)
if err != nil || result == nil {
return false
}
return result.isNodeADir()
}
// Size returns the size of the node.
func (n *fsNode) Size() int64 {
if n.isNodeADir() {
return int64(len(n.dir))
}
return int64(len(n.content))
}
// Open implements FileSystem.
// Open opens the node for reading (just marks it).
func (n *fsNode) Open(path string) (File, error) {
result, err := n.Find(path)
if err != nil {
return nil, err
}
if result == nil {
return nil, fmt.Errorf("cannot find '%s' to open it", path)
}
result.open = true
return result, nil
}
// Close marks the node closed.
func (n *fsNode) Close() error {
n.open = false
return nil
}
// ReadFile implements FileSystem.
func (n *fsNode) ReadFile(path string) (c []byte, err error) {
result, err := n.Find(path)
if err != nil {
return nil, err
}
if result == nil {
return nil, fmt.Errorf("cannot find '%s' to read it", path)
}
c = make([]byte, len(result.content))
_, err = result.Read(c)
return c, err
}
// Read returns the content of the file node.
func (n *fsNode) Read(d []byte) (c int, err error) {
if n.isNodeADir() {
return 0, fmt.Errorf(
"cannot read content from non-file '%s'", n.Path())
}
return copy(d, n.content), nil
}
// Write saves the contents of the argument to the file node.
func (n *fsNode) Write(p []byte) (c int, err error) {
if n.isNodeADir() {
return 0, fmt.Errorf(
"cannot write content to non-file '%s'", n.Path())
}
n.content = make([]byte, len(p))
return copy(n.content, p), nil
}
// ContentMatches returns true if v matches fake file's content.
func (n *fsNode) ContentMatches(v []byte) bool {
return bytes.Equal(v, n.content)
}
// GetContent the content of a fake file.
func (n *fsNode) GetContent() []byte {
return n.content
}
// Stat returns an instance of FileInfo.
func (n *fsNode) Stat() (os.FileInfo, error) {
return fileInfo{node: n}, nil
}
// Walk implements FileSystem.
func (n *fsNode) Walk(path string, walkFn filepath.WalkFunc) error {
result, err := n.Find(path)
if err != nil {
return err
}
if result == nil {
return fmt.Errorf("cannot find '%s' to walk it", path)
}
return result.WalkMe(walkFn)
}
// Walk runs the given walkFn on each node.
func (n *fsNode) WalkMe(walkFn filepath.WalkFunc) error {
fi, err := n.Stat()
// always visit self first
err = walkFn(n.Path(), fi, err)
if !n.isNodeADir() {
// it's a file, so nothing more to do
return err
}
// process self as a directory
if err == filepath.SkipDir {
return nil
}
// Walk is supposed to visit in lexical order.
for _, k := range n.sortedDirEntries() {
if err := n.dir[k].WalkMe(walkFn); err != nil {
if err == filepath.SkipDir {
// stop processing this directory
break
}
// bail out completely
return err
}
}
return nil
}
func (n *fsNode) sortedDirEntries() []string {
keys := make([]string, len(n.dir))
i := 0
for k := range n.dir {
keys[i] = k
i++
}
sort.Strings(keys)
return keys
}
// FileCount returns a count of files.
// Directories, empty or otherwise, not counted.
func (n *fsNode) FileCount() int {
count := 0
n.WalkMe(func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
count++
}
return nil
})
return count
}
func (n *fsNode) DebugPrint() {
n.WalkMe(func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Printf("err '%v' at path %q\n", err, path)
return nil
}
if info.IsDir() {
if info.Size() == 0 {
fmt.Println("empty dir: " + path)
}
} else {
fmt.Println(" file: " + path)
}
return nil
})
}
var legalFileNamePattern = regexp.MustCompile("^[a-zA-Z0-9-_.]+$")
// This rules enforced here should be simpler and tighter
// than what's allowed on a real OS.
// Should be fine for testing or in-memory purposes.
func isLegalFileNameForCreation(n string) bool {
if n == "" || n == SelfDir || !legalFileNamePattern.MatchString(n) {
return false
}
return !strings.Contains(n, ParentDir)
}
// RegExpGlob returns a list of file paths matching the regexp.
// Excludes directories.
func (n *fsNode) RegExpGlob(pattern string) ([]string, error) {
var result []string
var expression = regexp.MustCompile(pattern)
n.WalkMe(func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
if expression.MatchString(path) {
result = append(result, path)
}
}
return nil
})
sort.Strings(result)
return result, nil
}
// Glob implements FileSystem.
// Glob returns the list of file paths matching
// per filepath.Match semantics, i.e. unlike RegExpGlob,
// Match("foo/a*") will not match sub-sub directories of foo.
// This is how /bin/ls behaves.
func (n *fsNode) Glob(pattern string) ([]string, error) {
var result []string
n.WalkMe(func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
match, err := filepath.Match(pattern, path)
if err != nil {
return err
}
if match {
result = append(result, path)
}
}
return nil
})
sort.Strings(result)
return result, nil
}

788
api/filesys/fsnode_test.go Normal file
View File

@@ -0,0 +1,788 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"testing"
)
const content = `
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
`
const shortContent = "hi"
var topCases = []pathCase{
{
what: "dotdot",
arg: ParentDir,
errStr: "illegal name '..' in file creation",
},
{
what: "empty",
arg: "",
name: "",
errStr: "illegal name '.' in file creation",
},
{
what: "simple",
arg: "bob",
name: "bob",
path: "bob",
},
{
what: "longer",
arg: filepath.Join("longer", "bob"),
name: "bob",
path: filepath.Join("longer", "bob"),
},
{
what: "longer yet",
arg: filepath.Join("longer", "foo", "bar", "beans", "bob"),
name: "bob",
path: filepath.Join("longer", "foo", "bar", "beans", "bob"),
},
{
what: "tricky",
arg: filepath.Join("bob", ParentDir, "sally"),
name: "sally",
path: "sally",
},
{
what: "trickier",
arg: filepath.Join("bob", "sally", ParentDir, ParentDir, "jean"),
name: "jean",
path: "jean",
},
}
func TestMakeEmptyDirInMemory(t *testing.T) {
n := MakeEmptyDirInMemory()
if !n.isNodeADir() {
t.Fatalf("not a directory")
}
if n.Size() != 0 {
t.Fatalf("unexpected size %d", n.Size())
}
if n.Name() != "" {
t.Fatalf("unexpected name '%s'", n.Name())
}
if n.Path() != "" {
t.Fatalf("unexpected path '%s'", n.Path())
}
runBasicOperations(
t, "MakeEmptyDirInMemory", false, topCases, n)
}
func TestMakeFsInMemory(t *testing.T) {
runBasicOperations(
t, "MakeFsInMemory", true, topCases, MakeFsInMemory())
}
//nolint:gocyclo
func runBasicOperations(
t *testing.T, tName string, isFSysRooted bool,
cases []pathCase, fSys FileSystem) {
buff := make([]byte, 500)
for _, c := range cases {
err := fSys.WriteFile(c.arg, []byte(content))
if c.errStr != "" {
if err == nil {
t.Fatalf("%s; expected error writing to '%s'!", c.what, c.arg)
}
if !strings.Contains(err.Error(), c.errStr) {
t.Fatalf("%s; expected err containing '%s', got '%v'",
c.what, c.errStr, err)
}
continue
}
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
if !fSys.Exists(c.path) {
t.Fatalf("%s; expect existence of '%s'", c.what, c.path)
}
stuff, err := fSys.ReadFile(c.path)
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
if string(stuff) != content {
t.Fatalf("%s; unexpected content '%s'", c.what, stuff)
}
f, err := fSys.Open(c.arg)
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
fi, err := f.Stat()
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
if fi.Name() != c.name {
t.Fatalf("%s; expected name '%s', got '%s'", c.what, c.name, fi.Name())
}
count, err := f.Read(buff)
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
if string(buff[:count]) != content {
t.Fatalf("%s; unexpected buff '%s'", c.what, buff)
}
count, err = f.Write([]byte(shortContent))
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
if count != len(shortContent) {
t.Fatalf("%s; unexpected count: %d", c.what, len(shortContent))
}
stuff, err = fSys.ReadFile(c.path)
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
if string(stuff) != shortContent {
t.Fatalf("%s; unexpected content '%s'", c.what, stuff)
}
}
var actualPaths []string
var err error
prefix := ""
{
root := SelfDir
if isFSysRooted {
root = Separator
prefix = Separator
}
err = fSys.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Printf("err '%v' at path %q\n", err, path)
return nil
}
if !info.IsDir() {
actualPaths = append(actualPaths, path)
}
return nil
})
}
if err != nil {
t.Fatalf("unexpected error %v", err)
}
var expectedPaths []string
for _, c := range cases {
if c.errStr == "" {
expectedPaths = append(expectedPaths, prefix+c.path)
}
}
sort.Strings(expectedPaths)
assertEqualStringSlices(t, expectedPaths, actualPaths, tName)
}
type pathCase struct {
what string
arg string
name string
path string
errStr string
}
func TestAddDir(t *testing.T) {
cases := []pathCase{
{
what: "dotdot",
arg: ParentDir,
errStr: "cannot add a directory above ''",
},
{
what: "empty",
arg: "",
name: "",
path: "",
},
{
what: "simple",
arg: "bob",
name: "bob",
path: "bob",
},
{
what: "longer",
arg: filepath.Join("longer", "bob"),
name: "bob",
path: filepath.Join("longer", "bob"),
},
{
what: "longer yet",
arg: filepath.Join("longer", "foo", "bar", "beans", "bob"),
name: "bob",
path: filepath.Join("longer", "foo", "bar", "beans", "bob"),
},
{
what: "tricky",
arg: filepath.Join("bob", ParentDir, "sally"),
name: "sally",
path: "sally",
},
{
what: "trickier",
arg: filepath.Join("bob", "sally", ParentDir, ParentDir, "jean"),
name: "jean",
path: "jean",
},
}
for _, c := range cases {
n := MakeEmptyDirInMemory()
f, err := n.AddDir(c.arg)
if c.errStr != "" {
if err == nil {
t.Fatalf("%s; expected error!", c.what)
}
if !strings.Contains(err.Error(), c.errStr) {
t.Fatalf(
"%s; expected error with '%s', got '%v'",
c.what, c.errStr, err)
}
continue
}
if err != nil {
t.Fatalf("%s; unexpected error: %v", c.what, err)
}
checkNode(t, c.what, f, c.name, 0, true, c.path)
checkOsStat(t, c.what, f, f.Name(), 0, true)
}
}
var bagOfCases = []pathCase{
{
what: "empty",
arg: "",
errStr: "illegal name '.' in file creation",
},
{
what: "simple",
arg: "bob",
name: "bob",
path: "bob",
},
{
what: "longer",
arg: filepath.Join("longer", "bob"),
name: "bob",
path: filepath.Join("longer", "bob"),
},
{
what: "longer",
arg: filepath.Join("longer", "sally"),
name: "sally",
path: filepath.Join("longer", "sally"),
},
{
what: "even longer",
arg: filepath.Join("longer", "than", "the", "other", "bob"),
name: "bob",
path: filepath.Join("longer", "than", "the", "other", "bob"),
},
{
what: "even longer",
arg: filepath.Join("even", "much", "longer", "than", "the", "other", "bob"),
name: "bob",
path: filepath.Join("even", "much", "longer", "than", "the", "other", "bob"),
},
}
func TestAddFile(t *testing.T) {
n := MakeEmptyDirInMemory()
if n.FileCount() != 0 {
t.Fatalf("expected no files, got %d", n.FileCount())
}
expectedFileCount := 0
for _, c := range bagOfCases {
f, err := n.AddFile(c.arg, []byte(content))
if c.errStr != "" {
if err == nil {
t.Fatalf("%s; expected error!", c.what)
}
if !strings.Contains(err.Error(), c.errStr) {
t.Fatalf("%s; expected err containing '%s', got '%v'",
c.what, c.errStr, err)
}
continue
}
if err != nil {
t.Fatalf("%s; unexpected error %v", c.what, err)
}
checkNode(t, c.what, f, c.name, len(content), false, c.path)
checkOsStat(t, c.what, f, f.Name(), len(content), false)
result, err := n.Find(c.arg)
if err != nil {
t.Fatalf("%s; unexpected find error %v", c.what, err)
}
if result != f {
t.Fatalf("%s; unexpected find result %v", c.what, result)
}
result, err = n.Find(filepath.Join("longer", "bogus"))
if err != nil {
t.Fatalf("%s; unexpected find error %v", c.what, err)
}
if result != nil {
t.Fatalf("%s; unexpected find result %v", c.what, result)
}
expectedFileCount++
fc := n.FileCount()
if fc != expectedFileCount {
t.Fatalf("expected file count %d, got %d",
expectedFileCount, fc)
}
}
}
func checkNode(
t *testing.T, what string, f *fsNode, name string,
size int, isDir bool, path string) {
if f.isNodeADir() != isDir {
t.Fatalf("%s; unexpected isNodeADir = %v", what, f.isNodeADir())
}
if f.Size() != int64(size) {
t.Fatalf("%s; unexpected size %d", what, f.Size())
}
if name != f.Name() {
t.Fatalf("%s; expected name '%s', got '%s'", what, name, f.Name())
}
if path != f.Path() {
t.Fatalf("%s; expected path '%s', got '%s'", what, path, f.Path())
}
}
func checkOsStat(
t *testing.T, what string, f File, name string,
size int, isDir bool) {
info, err := f.Stat()
if err != nil {
t.Fatalf("%s; unexpected stat error %v", what, err)
}
if info.IsDir() != isDir {
t.Fatalf("%s; unexpected info.isNodeADir = %v", what, info.IsDir())
}
if info.Size() != int64(size) {
t.Fatalf("%s; unexpected info.size %d", what, info.Size())
}
if info.Name() != name {
t.Fatalf("%s; expected name '%s', got info.Name '%s'", what, name, info.Name())
}
}
var bunchOfFiles = []struct {
path string
addAsDir bool
}{
{
path: filepath.Join("b", "e", "a", "c", "g"),
},
{
path: filepath.Join("z", "r", "a", "b", "g"),
},
{
path: filepath.Join("b", "q", "a", "c", "g"),
},
{
path: filepath.Join("b", "a", "a", "m", "g"),
addAsDir: true,
},
{
path: filepath.Join("b", "w"),
},
{
path: filepath.Join("b", "d", "a", "c", "m"),
},
{
path: filepath.Join("b", "d", "z"),
},
{
path: filepath.Join("b", "d", "y"),
},
{
path: filepath.Join("b", "d", "ignore", "c", "n"),
},
{
path: filepath.Join("b", "d", "x"),
},
{
path: filepath.Join("b", "d", "ignore", "c", "o"),
},
{
path: filepath.Join("b", "d", "ignore", "c", "m"),
},
{
path: filepath.Join("b", "d", "a", "c", "i"),
addAsDir: true,
},
{
path: filepath.Join("x"),
},
{
path: filepath.Join("y"),
},
{
path: filepath.Join("b", "d", "a", "c", "i", "beans"),
},
{
path: filepath.Join("b", "d", "a", "c", "r", "w"),
addAsDir: true,
},
{
path: filepath.Join("b", "d", "a", "c", "u"),
},
}
func makeLoadedFileTree(t *testing.T) *fsNode {
n := MakeEmptyDirInMemory()
var err error
expectedFileCount := 0
for _, item := range bunchOfFiles {
if item.addAsDir {
_, err = n.AddDir(item.path)
} else {
_, err = n.AddFile(item.path, []byte(content))
expectedFileCount++
}
if err != nil {
t.Fatalf("unexpected error %v", err)
}
}
fc := n.FileCount()
if fc != expectedFileCount {
t.Fatalf("expected file count %d, got %d",
expectedFileCount, fc)
}
return n
}
func TestWalkMe(t *testing.T) {
n := makeLoadedFileTree(t)
var actualPaths []string
err := n.WalkMe(func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Printf("err '%v' at path %q\n", err, path)
return nil
}
if info.IsDir() {
if info.Name() == "ignore" {
return filepath.SkipDir
}
} else {
actualPaths = append(actualPaths, path)
}
return nil
})
if err != nil {
t.Fatalf("unexpected error %v", err)
}
var expectedPaths []string
for _, c := range bunchOfFiles {
if !c.addAsDir && !strings.Contains(c.path, "ignore") {
expectedPaths = append(expectedPaths, c.path)
}
}
sort.Strings(expectedPaths)
assertEqualStringSlices(t, expectedPaths, actualPaths, "testWalkMe")
}
func TestRemove(t *testing.T) {
n := makeLoadedFileTree(t)
orgCount := n.FileCount()
// Remove the "ignore" directory and everything below it.
path := filepath.Join("b", "d", "ignore")
result, err := n.Find(path)
if err != nil {
t.Fatalf("%s; unexpected error %v", path, err)
}
if result == nil {
t.Fatalf("%s; expected to find '%s'", path, path)
}
if !result.isNodeADir() {
t.Fatalf("%s; expected to find a directory", path)
}
err = result.Remove()
if err != nil {
t.Fatalf("%s; unable to remove: %v", path, err)
}
result, err = n.Find(path)
if err != nil {
// Just because it's gone doesn't mean error.
t.Fatalf("%s; unexpected error %v", path, err)
}
if result != nil {
t.Fatalf("%s; should not have been able to find '%s'", path, path)
}
// There were three files below "ignore".
orgCount -= 3
// Now drop one more for a total of four dropped.
result, _ = n.Find(filepath.Join("y"))
err = result.Remove()
if err != nil {
t.Fatalf("%s; unable to remove: %v", path, err)
}
orgCount -= 1
fc := n.FileCount()
if fc != orgCount {
t.Fatalf("expected file count %d, got %d",
orgCount, fc)
}
}
func TestExists(t *testing.T) {
n := makeLoadedFileTree(t)
path := filepath.Join("b", "d", "a")
if !n.Exists(path) {
t.Fatalf("expected existence at %s", path)
}
if !n.IsDir(path) {
t.Fatalf("expected directory at %s", path)
}
}
func TestRegExpGlob(t *testing.T) {
n := makeLoadedFileTree(t)
expected := []string{
filepath.Join("b", "d", "a", "c", "i", "beans"),
filepath.Join("b", "d", "a", "c", "m"),
filepath.Join("b", "d", "a", "c", "u"),
filepath.Join("b", "d", "ignore", "c", "m"),
filepath.Join("b", "d", "ignore", "c", "n"),
filepath.Join("b", "d", "ignore", "c", "o"),
filepath.Join("b", "d", "x"),
filepath.Join("b", "d", "y"),
filepath.Join("b", "d", "z"),
}
paths, err := n.RegExpGlob("b/d/*")
if err != nil {
t.Fatalf("glob error: %v", err)
}
assertEqualStringSlices(t, expected, paths, "glob test")
}
func TestGlob(t *testing.T) {
n := makeLoadedFileTree(t)
expected := []string{
filepath.Join("b", "d", "x"),
filepath.Join("b", "d", "y"),
filepath.Join("b", "d", "z"),
}
paths, err := n.Glob("b/d/*")
if err != nil {
t.Fatalf("glob error: %v", err)
}
assertEqualStringSlices(t, expected, paths, "glob test")
}
func assertEqualStringSlices(t *testing.T, expected, actual []string, message string) {
if len(expected) != len(actual) {
t.Fatalf(
"%s; unequal sizes; len(expected)=%d, len(actual)=%d\n%+v\n%+v\n",
message, len(expected), len(actual), expected, actual)
}
for i := range expected {
if expected[i] != actual[i] {
t.Fatalf(
"%s; unequal entries; expected=%s, actual=%s",
message, expected[i], actual[i])
}
}
}
func TestFind(t *testing.T) {
cases := []struct {
what string
arg string
expectDir bool
expectFile bool
errStr string
}{
{
what: "garbage",
arg: "///1(*&SA",
},
{
what: "simple",
arg: "bob",
},
{
what: "no directory",
arg: filepath.Join("b", "rrrrrr"),
},
{
what: "is a directory",
arg: filepath.Join("b", "d", "ignore"),
expectDir: true,
},
{
what: "longer, ending in file",
arg: filepath.Join("b", "d", "x"),
expectFile: true,
},
{
what: "moar longer, ending in file",
arg: filepath.Join("b", "d", "a", "c", "u"),
expectFile: true,
},
{
what: "directory",
arg: filepath.Join("b"),
expectDir: true,
},
{
// Querying for the empty string could
// 1) be an error,
// 2) return no result (and no error) as with
// any illegal and therefore non-existent
// file name,
// 3) return the node itself, like running
// 'ls' with no argument.
// Going with option 2 (no result, no error),
// since at this low level it makes more sense
// if the results for the empty string query
// differ from the results for the "." query.
what: "empty name",
arg: "",
},
{
what: "self dir",
arg: SelfDir,
expectDir: true,
},
{
what: "parent dir - doesn't exist",
arg: ParentDir,
},
{
what: "many parents - doesn't exist",
arg: filepath.Join(ParentDir, ParentDir, ParentDir),
},
}
n := makeLoadedFileTree(t)
for _, item := range cases {
result, err := n.Find(item.arg)
if item.errStr != "" {
if err == nil {
t.Fatalf("%s; expected error", item.what)
}
if !strings.Contains(err.Error(), item.errStr) {
t.Fatalf("%s; expected err containing '%s', got '%v'",
item.what, item.errStr, err)
}
continue
}
if err != nil {
t.Fatalf("%s; unexpected error: %v", item.what, err)
}
if result == nil {
if item.expectDir {
t.Fatalf(
"%s; expected to find directory '%s'", item.what, item.arg)
}
if item.expectFile {
t.Fatalf(
"%s; expected to find file '%s'", item.what, item.arg)
}
continue
}
if item.expectDir {
if !result.isNodeADir() {
t.Fatalf(
"%s; expected '%s' to be a directory", item.what, item.arg)
}
continue
}
if item.expectFile {
if result.isNodeADir() {
t.Fatalf("%s; expected '%s' to be a file", item.what, item.arg)
}
continue
}
t.Fatalf(
"%s; expected nothing for '%s', but got '%s'",
item.what, item.arg, result.Path())
}
}
func TestCleanedAbs(t *testing.T) {
cases := []struct {
what string
full string
cDir string
name string
errStr string
}{
{
what: "empty",
full: "",
errStr: "doesn't exist",
},
{
what: "simple",
full: "bob",
errStr: "'bob' doesn't exist",
},
{
what: "no directory",
full: filepath.Join("b", "rrrrrr"),
errStr: "'b/rrrrrr' doesn't exist",
},
{
what: "longer, ending in file",
full: filepath.Join("b", "d", "x"),
cDir: filepath.Join("b", "d"),
name: "x",
},
{
what: "moar longer, ending in file",
full: filepath.Join("b", "d", "a", "c", "u"),
cDir: filepath.Join("b", "d", "a", "c"),
name: "u",
},
{
what: "directory",
full: filepath.Join("b", "d"),
cDir: filepath.Join("b", "d"),
name: "",
},
}
n := makeLoadedFileTree(t)
for _, item := range cases {
cDir, name, err := n.CleanedAbs(item.full)
if item.errStr != "" {
if err == nil {
t.Fatalf("%s; expected error", item.what)
}
if !strings.Contains(err.Error(), item.errStr) {
t.Fatalf("%s; expected err containing '%s', got '%v'",
item.what, item.errStr, err)
}
continue
}
if err != nil {
t.Fatalf("%s; unexpected error: %v", item.what, err)
}
if cDir != ConfirmedDir(item.cDir) {
t.Fatalf("%s; expected cDir=%s, got '%s'", item.what, item.cDir, cDir)
}
if name != item.name {
t.Fatalf("%s; expected name=%s, got '%s'", item.what, item.name, name)
}
}
}

114
api/filesys/fsondisk.go Normal file
View File

@@ -0,0 +1,114 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
)
var _ FileSystem = fsOnDisk{}
// fsOnDisk implements FileSystem using the local filesystem.
type fsOnDisk struct{}
// MakeFsOnDisk makes an instance of fsOnDisk.
func MakeFsOnDisk() FileSystem {
return fsOnDisk{}
}
// Create delegates to os.Create.
func (fsOnDisk) Create(name string) (File, error) { return os.Create(name) }
// Mkdir delegates to os.Mkdir.
func (fsOnDisk) Mkdir(name string) error {
return os.Mkdir(name, 0777|os.ModeDir)
}
// MkdirAll delegates to os.MkdirAll.
func (fsOnDisk) MkdirAll(name string) error {
return os.MkdirAll(name, 0777|os.ModeDir)
}
// RemoveAll delegates to os.RemoveAll.
func (fsOnDisk) RemoveAll(name string) error {
return os.RemoveAll(name)
}
// Open delegates to os.Open.
func (fsOnDisk) Open(name string) (File, error) { return os.Open(name) }
// CleanedAbs converts the given path into a
// directory and a file name, where the directory
// is represented as a ConfirmedDir and all that implies.
// If the entire path is a directory, the file component
// is an empty string.
func (x fsOnDisk) CleanedAbs(
path string) (ConfirmedDir, string, error) {
absRoot, err := filepath.Abs(path)
if err != nil {
return "", "", fmt.Errorf(
"abs path error on '%s' : %v", path, err)
}
deLinked, err := filepath.EvalSymlinks(absRoot)
if err != nil {
return "", "", fmt.Errorf(
"evalsymlink failure on '%s' : %v", path, err)
}
if x.IsDir(deLinked) {
return ConfirmedDir(deLinked), "", nil
}
d := filepath.Dir(deLinked)
if !x.IsDir(d) {
// Programmer/assumption error.
log.Fatalf("first part of '%s' not a directory", deLinked)
}
if d == deLinked {
// Programmer/assumption error.
log.Fatalf("d '%s' should be a subset of deLinked", d)
}
f := filepath.Base(deLinked)
if filepath.Join(d, f) != deLinked {
// Programmer/assumption error.
log.Fatalf("these should be equal: '%s', '%s'",
filepath.Join(d, f), deLinked)
}
return ConfirmedDir(d), f, nil
}
// Exists returns true if os.Stat succeeds.
func (fsOnDisk) Exists(name string) bool {
_, err := os.Stat(name)
return err == nil
}
// Glob returns the list of matching files
func (fsOnDisk) Glob(pattern string) ([]string, error) {
return filepath.Glob(pattern)
}
// IsDir delegates to os.Stat and FileInfo.IsDir
func (fsOnDisk) IsDir(name string) bool {
info, err := os.Stat(name)
if err != nil {
return false
}
return info.IsDir()
}
// ReadFile delegates to ioutil.ReadFile.
func (fsOnDisk) ReadFile(name string) ([]byte, error) { return ioutil.ReadFile(name) }
// WriteFile delegates to ioutil.WriteFile with read/write permissions.
func (fsOnDisk) WriteFile(name string, c []byte) error {
return ioutil.WriteFile(name, c, 0666)
}
// Walk delegates to filepath.Walk.
func (fsOnDisk) Walk(path string, walkFn filepath.WalkFunc) error {
return filepath.Walk(path, walkFn)
}

View File

@@ -0,0 +1,165 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys_test
import (
"io/ioutil"
"os"
"path"
"path/filepath"
"reflect"
"testing"
. "sigs.k8s.io/kustomize/api/filesys"
)
func makeTestDir(t *testing.T) (FileSystem, string) {
fSys := MakeFsOnDisk()
td, err := ioutil.TempDir("", "kustomize_testing_dir")
if err != nil {
t.Fatalf("unexpected error %s", err)
}
testDir, err := filepath.EvalSymlinks(td)
if err != nil {
t.Fatalf("unexpected error %s", err)
}
if !fSys.Exists(testDir) {
t.Fatalf("expected existence")
}
if !fSys.IsDir(testDir) {
t.Fatalf("expected directory")
}
return fSys, testDir
}
func TestCleanedAbs_1(t *testing.T) {
fSys, testDir := makeTestDir(t)
defer os.RemoveAll(testDir)
d, f, err := fSys.CleanedAbs("")
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
wd, err := os.Getwd()
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
if d.String() != wd {
t.Fatalf("unexpected d=%s", d)
}
if f != "" {
t.Fatalf("unexpected f=%s", f)
}
}
func TestCleanedAbs_2(t *testing.T) {
fSys, testDir := makeTestDir(t)
defer os.RemoveAll(testDir)
d, f, err := fSys.CleanedAbs("/")
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
if d != "/" {
t.Fatalf("unexpected d=%s", d)
}
if f != "" {
t.Fatalf("unexpected f=%s", f)
}
}
func TestCleanedAbs_3(t *testing.T) {
fSys, testDir := makeTestDir(t)
defer os.RemoveAll(testDir)
err := fSys.WriteFile(
filepath.Join(testDir, "foo"), []byte(`foo`))
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
d, f, err := fSys.CleanedAbs(filepath.Join(testDir, "foo"))
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
if d.String() != testDir {
t.Fatalf("unexpected d=%s", d)
}
if f != "foo" {
t.Fatalf("unexpected f=%s", f)
}
}
func TestCleanedAbs_4(t *testing.T) {
fSys, testDir := makeTestDir(t)
defer os.RemoveAll(testDir)
err := fSys.MkdirAll(filepath.Join(testDir, "d1", "d2"))
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
err = fSys.WriteFile(
filepath.Join(testDir, "d1", "d2", "bar"),
[]byte(`bar`))
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
d, f, err := fSys.CleanedAbs(
filepath.Join(testDir, "d1", "d2"))
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
if d.String() != filepath.Join(testDir, "d1", "d2") {
t.Fatalf("unexpected d=%s", d)
}
if f != "" {
t.Fatalf("unexpected f=%s", f)
}
d, f, err = fSys.CleanedAbs(
filepath.Join(testDir, "d1", "d2", "bar"))
if err != nil {
t.Fatalf("unexpected err=%v", err)
}
if d.String() != filepath.Join(testDir, "d1", "d2") {
t.Fatalf("unexpected d=%s", d)
}
if f != "bar" {
t.Fatalf("unexpected f=%s", f)
}
}
func TestReadFilesRealFS(t *testing.T) {
fSys, testDir := makeTestDir(t)
defer os.RemoveAll(testDir)
err := fSys.WriteFile(path.Join(testDir, "foo"), []byte(`foo`))
if err != nil {
t.Fatalf("unexpected error %s", err)
}
if !fSys.Exists(path.Join(testDir, "foo")) {
t.Fatalf("expected foo")
}
if fSys.IsDir(path.Join(testDir, "foo")) {
t.Fatalf("expected foo not to be a directory")
}
err = fSys.WriteFile(path.Join(testDir, "bar"), []byte(`bar`))
if err != nil {
t.Fatalf("unexpected error %s", err)
}
files, err := fSys.Glob(path.Join("testDir", "*"))
expected := []string{
path.Join(testDir, "bar"),
path.Join(testDir, "foo"),
}
if err != nil {
t.Fatalf("expected no error")
}
if reflect.DeepEqual(files, expected) {
t.Fatalf("incorrect files found by glob: %v", files)
}
}

125
api/filesys/util.go Normal file
View File

@@ -0,0 +1,125 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filesys
import (
"os"
"path/filepath"
"strings"
)
// RootedPath returns a rooted path, e.g. "/foo/bar" as
// opposed to "foo/bar".
func RootedPath(elem ...string) string {
return Separator + filepath.Join(elem...)
}
// StripTrailingSeps trims trailing filepath separators from input.
func StripTrailingSeps(s string) string {
k := len(s)
for k > 0 && s[k-1] == filepath.Separator {
k--
}
return s[:k]
}
// StripLeadingSeps trims leading filepath separators from input.
func StripLeadingSeps(s string) string {
k := 0
for k < len(s) && s[k] == filepath.Separator {
k++
}
return s[k:]
}
// PathSplit converts a file path to a slice of string.
// If the path is absolute (if the path has a leading slash),
// then the first entry in the result is an empty string.
// Desired: path == PathJoin(PathSplit(path))
func PathSplit(incoming string) []string {
if incoming == "" {
return []string{}
}
dir, path := filepath.Split(incoming)
if dir == string(os.PathSeparator) {
if path == "" {
return []string{""}
}
return []string{"", path}
}
dir = strings.TrimSuffix(dir, string(os.PathSeparator))
if dir == "" {
return []string{path}
}
return append(PathSplit(dir), path)
}
// PathJoin converts a slice of string to a file path.
// If the first entry is an empty string, then the returned
// path is absolute (it has a leading slash).
// Desired: path == PathJoin(PathSplit(path))
func PathJoin(incoming []string) string {
if len(incoming) == 0 {
return ""
}
if incoming[0] == "" {
return string(os.PathSeparator) + filepath.Join(incoming[1:]...)
}
return filepath.Join(incoming...)
}
// InsertPathPart inserts 'part' at position 'pos' in the given filepath.
// The first position is 0.
//
// E.g. if part == 'PEACH'
//
// OLD : NEW : POS
// --------------------------------------------------------
// {empty} : PEACH : irrelevant
// / : /PEACH : irrelevant
// pie : PEACH/pie : 0 (or negative)
// /pie : /PEACH/pie : 0 (or negative)
// raw : raw/PEACH : 1 (or larger)
// /raw : /raw/PEACH : 1 (or larger)
// a/nice/warm/pie : a/nice/warm/PEACH/pie : 3
// /a/nice/warm/pie : /a/nice/warm/PEACH/pie : 3
//
// * An empty part results in no change.
//
// * Absolute paths get their leading '/' stripped, treated like
// relative paths, and the leading '/' is re-added on output.
// The meaning of pos is intentionally the same in either absolute or
// relative paths; if it weren't, this function could convert absolute
// paths to relative paths, which is not desirable.
//
// * For robustness (liberal input, conservative output) Pos values that
// that are too small (large) to index the split filepath result in a
// prefix (postfix) rather than an error. Use extreme position values
// to assure a prefix or postfix (e.g. 0 will always prefix, and
// 9999 will presumably always postfix).
func InsertPathPart(path string, pos int, part string) string {
if part == "" {
return path
}
parts := PathSplit(path)
if pos < 0 {
pos = 0
} else if pos > len(parts) {
pos = len(parts)
}
if len(parts) > 0 && parts[0] == "" && pos < len(parts) {
// An empty string at 0 indicates an absolute path, and means
// we must increment pos. This change means that a position
// specification has the same meaning in relative and absolute paths.
// E.g. in either the path 'a/b/c' or the path '/a/b/c',
// 'a' is at 0, 'b' is at 1 and 'c' is at 2, and inserting at
// zero means a new first field _without_ changing an absolute
// path to a relative path.
pos++
}
result := make([]string, len(parts)+1)
copy(result, parts[0:pos])
result[pos] = part
return PathJoin(append(result, parts[pos:]...))
}

374
api/filesys/util_test.go Normal file
View File

@@ -0,0 +1,374 @@
package filesys_test
import (
"os"
"path/filepath"
"testing"
. "sigs.k8s.io/kustomize/api/filesys"
)
// Confirm behavior of filepath.Match
func TestFilePathMatch(t *testing.T) {
cases := []struct {
pattern string
path string
expected bool
}{
{
pattern: "*e*",
path: "hey",
expected: true,
},
{
pattern: "*e*",
path: "hay",
expected: false,
},
{
pattern: "*e*",
path: filepath.Join("h", "e", "y"),
expected: false,
},
{
pattern: "*/e/*",
path: filepath.Join("h", "e", "y"),
expected: true,
},
{
pattern: "h/e/*",
path: filepath.Join("h", "e", "y"),
expected: true,
},
{
pattern: "*/e/y",
path: filepath.Join("h", "e", "y"),
expected: true,
},
{
pattern: "*/*/*",
path: filepath.Join("h", "e", "y"),
expected: true,
},
{
pattern: "*/*/*",
path: filepath.Join("h", "e", "y", "there"),
expected: false,
},
{
pattern: "*/*/*/t*e",
path: filepath.Join("h", "e", "y", "there"),
expected: true,
},
}
for _, item := range cases {
match, err := filepath.Match(item.pattern, item.path)
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
if match != item.expected {
t.Fatalf("'%s' '%s' %v\n", item.pattern, item.path, match)
}
}
}
// Confirm behavior of filepath.Split
func TestFilePathSplit(t *testing.T) {
cases := []struct {
full string
dir string
file string
}{
{
full: "",
dir: "",
file: "",
},
{
full: SelfDir,
dir: "",
file: SelfDir,
},
{
full: "rabbit.jpg",
dir: "",
file: "rabbit.jpg",
},
{
full: "/",
dir: "/",
file: "",
},
{
full: "/beans",
dir: "/",
file: "beans",
},
{
full: "/home/foo/bar",
dir: "/home/foo/",
file: "bar",
},
{
full: "/usr/local/",
dir: "/usr/local/",
file: "",
},
{
full: "/usr//local//go",
dir: "/usr//local//",
file: "go",
},
}
for _, p := range cases {
dir, file := filepath.Split(p.full)
if dir != p.dir || file != p.file {
t.Fatalf(
"in '%s',\ngot dir='%s' (expected '%s'),\n got file='%s' (expected %s).",
p.full, dir, p.dir, file, p.file)
}
}
}
func TestPathSplitAndJoin(t *testing.T) {
cases := map[string]struct {
original string
expected []string
}{
"Empty": {
original: "",
expected: []string{},
},
"One": {
original: "hello",
expected: []string{"hello"},
},
"Two": {
original: "hello/there",
expected: []string{"hello", "there"},
},
"Three": {
original: "hello/my/friend",
expected: []string{"hello", "my", "friend"},
},
}
for n, c := range cases {
f := func(t *testing.T, original string, expected []string) {
actual := PathSplit(original)
if len(actual) != len(expected) {
t.Fatalf(
"expected len %d, got len %d",
len(expected), len(actual))
}
for i := range expected {
if expected[i] != actual[i] {
t.Fatalf(
"at i=%d, expected '%s', got '%s'",
i, expected[i], actual[i])
}
}
joined := PathJoin(actual)
if joined != original {
t.Fatalf(
"when rejoining, expected '%s', got '%s'",
original, joined)
}
}
t.Run("relative"+n, func(t *testing.T) {
f(t, c.original, c.expected)
})
t.Run("absolute"+n, func(t *testing.T) {
f(t,
string(os.PathSeparator)+c.original,
append([]string{""}, c.expected...))
})
}
}
func TestInsertPathPart(t *testing.T) {
cases := map[string]struct {
original string
pos int
part string
expected string
}{
"rootOne": {
original: "/",
pos: 0,
part: "___",
expected: "/___",
},
"rootTwo": {
original: "/",
pos: 444,
part: "___",
expected: "/___",
},
"rootedFirst": {
original: "/apple",
pos: 0,
part: "___",
expected: "/___/apple",
},
"rootedSecond": {
original: "/apple",
pos: 444,
part: "___",
expected: "/apple/___",
},
"rootedThird": {
original: "/apple/banana",
pos: 444,
part: "___",
expected: "/apple/banana/___",
},
"emptyLow": {
original: "",
pos: -3,
part: "___",
expected: "___",
},
"emptyHigh": {
original: "",
pos: 444,
part: "___",
expected: "___",
},
"peachPie": {
original: "a/nice/warm/pie",
pos: 3,
part: "PEACH",
expected: "a/nice/warm/PEACH/pie",
},
"rootedPeachPie": {
original: "/a/nice/warm/pie",
pos: 3,
part: "PEACH",
expected: "/a/nice/warm/PEACH/pie",
},
"longStart": {
original: "a/b/c/d/e/f",
pos: 0,
part: "___",
expected: "___/a/b/c/d/e/f",
},
"rootedLongStart": {
original: "/a/b/c/d/e/f",
pos: 0,
part: "___",
expected: "/___/a/b/c/d/e/f",
},
"longMiddle": {
original: "a/b/c/d/e/f",
pos: 3,
part: "___",
expected: "a/b/c/___/d/e/f",
},
"rootedLongMiddle": {
original: "/a/b/c/d/e/f",
pos: 3,
part: "___",
expected: "/a/b/c/___/d/e/f",
},
"longEnd": {
original: "a/b/c/d/e/f",
pos: 444,
part: "___",
expected: "a/b/c/d/e/f/___",
},
"rootedLongEnd": {
original: "/a/b/c/d/e/f",
pos: 444,
part: "___",
expected: "/a/b/c/d/e/f/___",
},
}
for n, c := range cases {
t.Run(n, func(t *testing.T) {
actual := InsertPathPart(c.original, c.pos, c.part)
if actual != c.expected {
t.Fatalf("expected '%s', got '%s'", c.expected, actual)
}
})
}
}
func TestStripTrailingSeps(t *testing.T) {
cases := []struct {
full string
rem string
}{
{
full: "foo",
rem: "foo",
},
{
full: "",
rem: "",
},
{
full: "foo/",
rem: "foo",
},
{
full: "foo///bar///",
rem: "foo///bar",
},
{
full: "/////",
rem: "",
},
{
full: "/",
rem: "",
},
}
for _, p := range cases {
dir := StripTrailingSeps(p.full)
if dir != p.rem {
t.Fatalf(
"in '%s', got dir='%s' (expected '%s')",
p.full, dir, p.rem)
}
}
}
func TestStripLeadingSeps(t *testing.T) {
cases := []struct {
full string
rem string
}{
{
full: "foo",
rem: "foo",
},
{
full: "",
rem: "",
},
{
full: "/foo",
rem: "foo",
},
{
full: "///foo///bar///",
rem: "foo///bar///",
},
{
full: "/////",
rem: "",
},
{
full: "/",
rem: "",
},
}
for _, p := range cases {
dir := StripLeadingSeps(p.full)
if dir != p.rem {
t.Fatalf(
"in '%s', got dir='%s' (expected '%s')",
p.full, dir, p.rem)
}
}
}

View File

@@ -0,0 +1,43 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package annotations
import (
"sigs.k8s.io/kustomize/api/filters/filtersutil"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
type annoMap map[string]string
type Filter struct {
// Annotations is the set of annotations to apply to the inputs
Annotations annoMap `yaml:"annotations,omitempty"`
// FsSlice contains the FieldSpecs to locate the namespace field
FsSlice types.FsSlice
}
var _ kio.Filter = Filter{}
func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
keys := filtersutil.SortedMapKeys(f.Annotations)
_, err := kio.FilterAll(yaml.FilterFunc(
func(node *yaml.RNode) (*yaml.RNode, error) {
for _, k := range keys {
if err := node.PipeE(fsslice.Filter{
FsSlice: f.FsSlice,
SetValue: fsslice.SetEntry(k, f.Annotations[k], yaml.StringTag),
CreateKind: yaml.MappingNode, // Annotations are MappingNodes.
CreateTag: "!!map",
}); err != nil {
return nil, err
}
}
return node, nil
})).Filter(nodes)
return nodes, err
}

View File

@@ -0,0 +1,226 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package annotations
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
filtertest_test "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
var annosFs = builtinconfig.MakeDefaultConfig().CommonAnnotations
func TestAnnotations_Filter(t *testing.T) {
testCases := map[string]struct {
input string
expectedOutput string
filter Filter
fsslice types.FsSlice
}{
"add": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
auto: ford
bean: cannellini
clown: emmett kelley
dragon: smaug
`,
filter: Filter{Annotations: annoMap{
"clown": "emmett kelley",
"auto": "ford",
"dragon": "smaug",
"bean": "cannellini",
}},
},
"update": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: superman
fiend: luthor
bean: cannellini
clown: emmett kelley
`,
filter: Filter{Annotations: annoMap{
"clown": "emmett kelley",
"hero": "superman",
"fiend": "luthor",
"bean": "cannellini",
}},
},
"data-fieldspecs": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
sleater: kinney
a:
b:
sleater: kinney
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
annotations:
sleater: kinney
a:
b:
sleater: kinney
`,
filter: Filter{Annotations: annoMap{
"sleater": "kinney",
}},
fsslice: []types.FieldSpec{
{
Path: "a/b",
CreateIfNotPresent: true,
},
},
},
"number": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
2: ford
clown: "1"
`,
filter: Filter{Annotations: annoMap{
"clown": "1",
"2": "ford",
}},
},
// test quoting of values which are not considered strings in yaml 1.1
"yaml_1_1_compatibility": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
hero: batman
fiend: riddler
a: "y"
b: y1
c: "yes"
d: yes1
e: "true"
f: true1
`,
filter: Filter{Annotations: annoMap{
"a": "y",
"b": "y1",
"c": "yes",
"d": "yes1",
"e": "true",
"f": "true1",
}},
},
// test quoting of values which are not considered strings in yaml 1.1
"null_annotations": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations: null
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
annotations:
a: a1
b: b1
`,
filter: Filter{Annotations: annoMap{
"a": "a1",
"b": "b1",
}},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
filter := tc.filter
filter.FsSlice = append(annosFs, tc.fsslice...)
if !assert.Equal(t,
strings.TrimSpace(tc.expectedOutput),
strings.TrimSpace(filtertest_test.RunFilter(t, tc.input, filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package annotations contains a kio.Filter implementation of the kustomize
// annotations transformer.
package annotations

View File

@@ -0,0 +1,55 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package annotations
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
fss := builtinconfig.MakeDefaultConfig().CommonAnnotations
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`)}},
Filters: []kio.Filter{Filter{
Annotations: map[string]string{
"foo": "bar",
},
FsSlice: fss,
}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// annotations:
// foo: bar
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// annotations:
// foo: bar
}

View File

@@ -0,0 +1,21 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package filtersutil
import (
"sort"
)
// SortedMapKeys returns a sorted slice of keys to the given map.
// Writing this function never gets old.
func SortedMapKeys(m map[string]string) []string {
keys := make([]string, len(m))
i := 0
for k := range m {
keys[i] = k
i++
}
sort.Strings(keys)
return keys
}

View File

@@ -0,0 +1,34 @@
package filtersutil_test
import (
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/filters/filtersutil"
)
func TestSortedKeys(t *testing.T) {
testCases := map[string]struct {
input map[string]string
expected []string
}{
"empty": {
input: map[string]string{},
expected: []string{}},
"one": {
input: map[string]string{"a": "aaa"},
expected: []string{"a"}},
"three": {
input: map[string]string{"c": "ccc", "b": "bbb", "a": "aaa"},
expected: []string{"a", "b", "c"}},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
if !assert.Equal(t,
filtersutil.SortedMapKeys(tc.input),
tc.expected) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package fsslice contains a yaml.Filter to modify a resource using an
// FsSlice to identify fields to be updated within the resource.
package fsslice

View File

@@ -0,0 +1,62 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package fsslice_test
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
func ExampleFilter() {
in := &kio.ByteReader{
Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`),
}
fltr := fsslice.Filter{
CreateKind: yaml.ScalarNode,
SetValue: fsslice.SetScalar("green"),
FsSlice: []types.FieldSpec{
{Path: "a/b", CreateIfNotPresent: true},
},
}
err := kio.Pipeline{
Inputs: []kio.Reader{in},
Filters: []kio.Filter{kio.FilterAll(fltr)},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// a:
// b: green
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// a:
// b: green
}

View File

@@ -0,0 +1,155 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package fsslice
import (
"strings"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/errors"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// fieldSpecFilter applies a single fieldSpec to a single object
// fieldSpecFilter stores internal state and should not be reused
type fieldSpecFilter struct {
// FieldSpec contains the path to the value to set.
FieldSpec types.FieldSpec `yaml:"fieldSpec"`
// Set the field using this function
SetValue SetFn
// CreateKind defines the type of node to create if the field is not found
CreateKind yaml.Kind
CreateTag string
// path keeps internal state about the current path
path []string
}
func (fltr fieldSpecFilter) Filter(obj *yaml.RNode) (*yaml.RNode, error) {
// check if the FieldSpec applies to the object
if match, err := isMatchGVK(fltr.FieldSpec, obj); !match || err != nil {
return obj, errors.Wrap(err)
}
fltr.path = strings.Split(fltr.FieldSpec.Path, "/")
if err := fltr.filter(obj); err != nil {
s, _ := obj.String()
return nil, errors.WrapPrefixf(err,
"obj %v at path %v", s, fltr.FieldSpec.Path)
}
return obj, nil
}
func (fltr fieldSpecFilter) filter(obj *yaml.RNode) error {
if len(fltr.path) == 0 {
// found the field -- set its value
return fltr.SetValue(obj)
}
switch obj.YNode().Kind {
case yaml.SequenceNode:
return fltr.seq(obj)
case yaml.MappingNode:
return fltr.field(obj)
}
// not found -- this might be an error since the type doesn't match
return errors.Errorf("unsupported yaml node")
}
// field calls filter on the field matching the next path element
func (fltr fieldSpecFilter) field(obj *yaml.RNode) error {
fieldName, isSeq := isSequenceField(fltr.path[0])
// lookup the field matching the next path element
var lookupField yaml.Filter
var kind yaml.Kind
var tag string
switch {
case !fltr.FieldSpec.CreateIfNotPresent || fltr.CreateKind == 0 || isSeq:
// dont' create the field if we don't find it
lookupField = yaml.Lookup(fieldName)
case len(fltr.path) <= 1:
// create the field if it is missing: use the provided node kind
lookupField = yaml.LookupCreate(fltr.CreateKind, fieldName)
kind = fltr.CreateKind
tag = fltr.CreateTag
default:
// create the field if it is missing: must be a mapping node
lookupField = yaml.LookupCreate(yaml.MappingNode, fieldName)
kind = yaml.MappingNode
tag = "!!map"
}
// locate (or maybe create) the field
field, err := obj.Pipe(lookupField)
if err != nil || field == nil {
return errors.WrapPrefixf(err, "fieldName: %s", fieldName)
}
// if the value exists, but is null, then change it to the creation type
// TODO: update yaml.LookupCreate to support this
if field.YNode().Tag == "!!null" {
field.YNode().Kind = kind
field.YNode().Tag = tag
}
// copy the current fltr and change the path on the copy
var next = fltr
// call filter for the next path element on the matching field
next.path = fltr.path[1:]
return next.filter(field)
}
// seq calls filter on all sequence elements
func (fltr fieldSpecFilter) seq(obj *yaml.RNode) error {
if err := obj.VisitElements(func(node *yaml.RNode) error {
// recurse on each element -- re-allocating a fieldSpecFilter is
// not strictly required, but is more consistent with field
// and less likely to have side effects
// keep the entire path -- it does not contain parts for sequences
return fltr.filter(node)
}); err != nil {
return errors.WrapPrefixf(err,
"visit traversal on path: %v", fltr.path)
}
return nil
}
// isSequenceField returns true if the path element is for a sequence field.
// isSequence also returns the path element with the '[]' suffix trimmed
func isSequenceField(name string) (string, bool) {
isSeq := strings.HasSuffix(name, "[]")
name = strings.TrimSuffix(name, "[]")
return name, isSeq
}
// isMatchGVK returns true if the fs.GVK matches the obj GVK.
func isMatchGVK(fs types.FieldSpec, obj *yaml.RNode) (bool, error) {
meta, err := obj.GetMeta()
if err != nil {
return false, err
}
if fs.Kind != "" && fs.Kind != meta.Kind {
// kind doesn't match
return false, err
}
// parse the group and version from the apiVersion field
group, version := parseGV(meta.APIVersion)
if fs.Group != "" && fs.Group != group {
// group doesn't match
return false, nil
}
if fs.Version != "" && fs.Version != version {
// version doesn't match
return false, nil
}
return true, nil
}

View File

@@ -0,0 +1,73 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package fsslice
import (
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// SetFn sets a value
type SetFn func(*yaml.RNode) error
// SetScalar returns a SetFn to set a scalar value
func SetScalar(value string) SetFn {
return func(node *yaml.RNode) error {
return node.PipeE(yaml.FieldSetter{StringValue: value})
}
}
// SetEntry returns a SetFn to set an entry in a map
func SetEntry(key, value, tag string) SetFn {
n := &yaml.Node{
Kind: yaml.ScalarNode,
Value: value,
Tag: tag,
}
if tag == yaml.StringTag && yaml.IsYaml1_1NonString(n) {
n.Style = yaml.DoubleQuotedStyle
}
return func(node *yaml.RNode) error {
return node.PipeE(yaml.FieldSetter{
Name: key,
Value: yaml.NewRNode(n),
})
}
}
var _ yaml.Filter = Filter{}
// Filter uses an FsSlice to modify fields on a single object
type Filter struct {
// FieldSpecList list of FieldSpecs to set
FsSlice types.FsSlice `yaml:"fsSlice"`
// SetValue is called on each field that matches one of the FieldSpecs
SetValue SetFn
// CreateKind is used to create fields that do not exist
CreateKind yaml.Kind
// CreateTag is used to set the tag if encountering a null field
CreateTag string
}
func (fltr Filter) Filter(obj *yaml.RNode) (*yaml.RNode, error) {
for i := range fltr.FsSlice {
// apply this FieldSpec
// create a new filter for each iteration because they
// store internal state about the field paths
_, err := (&fieldSpecFilter{
FieldSpec: fltr.FsSlice[i],
SetValue: fltr.SetValue,
CreateKind: fltr.CreateKind,
CreateTag: fltr.CreateTag,
}).Filter(obj)
if err != nil {
return nil, err
}
}
return obj, nil
}

View File

@@ -0,0 +1,379 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package fsslice_test
import (
"bytes"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
type TestCase struct {
name string
input string
expected string
filter fsslice.Filter
fsSlice string
error string
}
var tests = []TestCase{
{
name: "update",
fsSlice: `
- path: a/b
group: foo
kind: Bar
`,
input: `
apiVersion: foo/v1beta1
kind: Bar
a:
b: c
`,
expected: `
apiVersion: foo/v1beta1
kind: Bar
a:
b: e
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
{
name: "update-kind-not-match",
fsSlice: `
- path: a/b
group: foo
kind: Bar1
`,
input: `
apiVersion: foo/v1beta1
kind: Bar2
a:
b: c
`,
expected: `
apiVersion: foo/v1beta1
kind: Bar2
a:
b: c
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
{
name: "update-group-not-match",
fsSlice: `
- path: a/b
group: foo1
kind: Bar
`,
input: `
apiVersion: foo2/v1beta1
kind: Bar
a:
b: c
`,
expected: `
apiVersion: foo2/v1beta1
kind: Bar
a:
b: c
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
{
name: "update-version-not-match",
fsSlice: `
- path: a/b
group: foo
version: v1beta1
kind: Bar
`,
input: `
apiVersion: foo/v1beta2
kind: Bar
a:
b: c
`,
expected: `
apiVersion: foo/v1beta2
kind: Bar
a:
b: c
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
{
name: "bad-version",
fsSlice: `
- path: a/b
group: foo
version: v1beta1
kind: Bar
`,
input: `
apiVersion: foo/v1beta2/something
kind: Bar
a:
b: c
`,
expected: `
apiVersion: foo/v1beta2/something
kind: Bar
a:
b: c
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
{
name: "bad-meta",
fsSlice: `
- path: a/b
group: foo
version: v1beta1
kind: Bar
`,
input: `
a:
b: c
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
error: "missing Resource metadata",
},
{
name: "miss-match-type",
fsSlice: `
- path: a/b/c
kind: Bar
`,
input: `
kind: Bar
a:
b: a
`,
error: "obj kind: Bar\na:\n b: a\n at path a/b/c: unsupported yaml node",
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
{
name: "add",
fsSlice: `
- path: a/b/c/d
group: foo
create: true
kind: Bar
`,
input: `
apiVersion: foo/v1beta1
kind: Bar
a: {}
`,
expected: `
apiVersion: foo/v1beta1
kind: Bar
a: {b: {c: {d: e}}}
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
CreateKind: yaml.ScalarNode,
},
},
{
name: "update-in-sequence",
fsSlice: `
- path: a/b[]/c/d
group: foo
kind: Bar
`,
input: `
apiVersion: foo/v1beta1
kind: Bar
a:
b:
- c:
d: a
`,
expected: `
apiVersion: foo/v1beta1
kind: Bar
a:
b:
- c:
d: e
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
},
},
// Don't create a sequence
{
name: "empty-sequence-no-create",
fsSlice: `
- path: a/b[]/c/d
group: foo
create: true
kind: Bar
`,
input: `
apiVersion: foo/v1beta1
kind: Bar
a: {}
`,
expected: `
apiVersion: foo/v1beta1
kind: Bar
a: {}
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
CreateKind: yaml.ScalarNode,
},
},
// Create a new field for an element in a sequence
{
name: "empty-sequence-create",
fsSlice: `
- path: a/b[]/c/d
group: foo
create: true
kind: Bar
`,
input: `
apiVersion: foo/v1beta1
kind: Bar
a:
b:
- c: {}
`,
expected: `
apiVersion: foo/v1beta1
kind: Bar
a:
b:
- c: {d: e}
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
CreateKind: yaml.ScalarNode,
},
},
{
name: "group v1",
fsSlice: `
- path: a/b
group: v1
create: true
kind: Bar
`,
input: `
apiVersion: v1
kind: Bar
`,
expected: `
apiVersion: v1
kind: Bar
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
CreateKind: yaml.ScalarNode,
},
},
{
name: "version v1",
fsSlice: `
- path: a/b
version: v1
create: true
kind: Bar
`,
input: `
apiVersion: v1
kind: Bar
`,
expected: `
apiVersion: v1
kind: Bar
a:
b: e
`,
filter: fsslice.Filter{
SetValue: fsslice.SetScalar("e"),
CreateKind: yaml.ScalarNode,
},
},
}
func TestFilter_Filter(t *testing.T) {
for i := range tests {
test := tests[i]
t.Run(test.name, func(t *testing.T) {
err := yaml.Unmarshal([]byte(test.fsSlice), &test.filter.FsSlice)
if !assert.NoError(t, err) {
t.FailNow()
}
out := &bytes.Buffer{}
rw := &kio.ByteReadWriter{
Reader: bytes.NewBufferString(test.input),
Writer: out,
OmitReaderAnnotations: true,
}
// run the filter
err = kio.Pipeline{
Inputs: []kio.Reader{rw},
Filters: []kio.Filter{kio.FilterAll(test.filter)},
Outputs: []kio.Writer{rw},
}.Execute()
if test.error != "" {
if !assert.EqualError(t, err, test.error) {
t.FailNow()
}
// stop rest of test
return
}
if !assert.NoError(t, err) {
t.FailNow()
}
// check results
if !assert.Equal(t,
strings.TrimSpace(test.expected),
strings.TrimSpace(out.String())) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,49 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package fsslice
import (
"strings"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// Return true for 'v' followed by a 1 or 2, and don't look at rest.
// I.e. 'v1', 'v1beta1', 'v2', would return true.
func looksLikeACoreApiVersion(s string) bool {
if len(s) < 2 {
return false
}
if s[0:1] != "v" {
return false
}
return s[1:2] == "1" || s[1:2] == "2"
}
// parseGV parses apiVersion field into group and version.
func parseGV(apiVersion string) (group, version string) {
// parse the group and version from the apiVersion field
parts := strings.SplitN(apiVersion, "/", 2)
group = parts[0]
if len(parts) > 1 {
version = parts[1]
}
// Special case the original "apiVersion" of what
// we now call the "core" (empty) group.
if version == "" && looksLikeACoreApiVersion(group) {
version = group
group = ""
}
return
}
// GetGVK parses the metadata into a GVK
func GetGVK(meta yaml.ResourceMeta) resid.Gvk {
group, version := parseGV(meta.APIVersion)
return resid.Gvk{
Group: group,
Version: version,
Kind: meta.Kind,
}
}

View File

@@ -0,0 +1,156 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package fsslice
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
func TestParseGV(t *testing.T) {
testCases := map[string]struct {
input string
expectedGroup string
expectedVersion string
}{
"empty": {
input: "",
expectedGroup: "",
expectedVersion: "",
},
"certSigning": {
input: "certificates.k8s.io/v1beta1",
expectedGroup: "certificates.k8s.io",
expectedVersion: "v1beta1",
},
"extensions": {
input: "extensions/v1beta1",
expectedGroup: "extensions",
expectedVersion: "v1beta1",
},
"normal": {
input: "apps/v1",
expectedGroup: "apps",
expectedVersion: "v1",
},
"justApps": {
input: "apps",
expectedGroup: "apps",
expectedVersion: "",
},
"coreV1": {
input: "v1",
expectedGroup: "",
expectedVersion: "v1",
},
"coreV2": {
input: "v2",
expectedGroup: "",
expectedVersion: "v2",
},
"coreV2Beta1": {
input: "v2beta1",
expectedGroup: "",
expectedVersion: "v2beta1",
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
group, version := parseGV(tc.input)
if !assert.Equal(t, tc.expectedGroup, group) {
t.FailNow()
}
if !assert.Equal(t, tc.expectedVersion, version) {
t.FailNow()
}
})
}
}
func TestGetGVK(t *testing.T) {
testCases := map[string]struct {
input string
expected resid.Gvk
parseError string
metaError string
}{
"empty": {
input: `
`,
parseError: "EOF",
},
"junk": {
input: `
congress: effective
`,
metaError: "missing Resource metadata",
},
"normal": {
input: `
apiVersion: apps/v1
kind: Deployment
`,
expected: resid.Gvk{Group: "apps", Version: "v1", Kind: "Deployment"},
},
"apiVersionOnlyWithSlash": {
input: `
apiVersion: apps/v1
`,
expected: resid.Gvk{Group: "apps", Version: "v1", Kind: ""},
},
"apiVersionOnlyNoSlash1": {
input: `
apiVersion: apps
`,
expected: resid.Gvk{Group: "apps", Version: "", Kind: ""},
},
"apiVersionOnlyNoSlash2": {
input: `
apiVersion: v1
`,
expected: resid.Gvk{Group: "", Version: "v1", Kind: ""},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
obj, err := yaml.Parse(tc.input)
if len(tc.parseError) != 0 {
if err == nil {
t.Error("expected parse error")
return
}
if !strings.Contains(err.Error(), tc.parseError) {
t.Errorf("expected parse err '%s', got '%v'", tc.parseError, err)
}
return
}
if !assert.NoError(t, err) {
t.FailNow()
}
meta, err := obj.GetMeta()
if len(tc.metaError) != 0 {
if err == nil {
t.Error("expected meta error")
return
}
if !strings.Contains(err.Error(), tc.metaError) {
t.Errorf("expected meta err '%s', got '%v'", tc.metaError, err)
}
return
}
if !assert.NoError(t, err) {
t.FailNow()
}
gvk := GetGVK(meta)
if !assert.Equal(t, tc.expected, gvk) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,12 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package imagetag contains two kio.Filter implementations to cover the
// functionality of the kustomize imagetag transformer.
//
// Filter updates fields based on a FieldSpec and an ImageTag.
//
// LegacyFilter doesn't use a FieldSpec, and instead only updates image
// references if the field is name image and it is underneath a field called
// either containers or initContainers.
package imagetag

View File

@@ -0,0 +1,126 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package imagetag
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- name: FooBar
image: nginx
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
spec:
containers:
- name: BarFoo
image: nginx:1.2.1
`)}},
Filters: []kio.Filter{Filter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
Digest: "12345",
},
FsSlice: []types.FieldSpec{
{
Path: "spec/containers[]/image",
},
},
}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// spec:
// containers:
// - name: FooBar
// image: apache@12345
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// spec:
// containers:
// - name: BarFoo
// image: apache@12345
}
func ExampleLegacyFilter() {
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- name: FooBar
image: nginx
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
spec:
containers:
- name: BarFoo
image: nginx:1.2.1
`)}},
Filters: []kio.Filter{LegacyFilter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
Digest: "12345",
},
}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// spec:
// containers:
// - name: FooBar
// image: apache@12345
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// spec:
// containers:
// - name: BarFoo
// image: apache@12345
}

View File

@@ -0,0 +1,44 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package imagetag
import (
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
type Filter struct {
// imageTag is the tag we want to apply to the inputs
ImageTag types.Image `json:"imageTag,omitempty" yaml:"imageTag,omitempty"`
// FsSlice contains the FieldSpecs to locate the namespace field
FsSlice types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
var _ kio.Filter = Filter{}
func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
_, err := kio.FilterAll(yaml.FilterFunc(f.filter)).Filter(nodes)
return nodes, err
}
func (f Filter) filter(node *yaml.RNode) (*yaml.RNode, error) {
if err := node.PipeE(fsslice.Filter{
FsSlice: f.FsSlice,
SetValue: updateImageTagFn(f.ImageTag),
}); err != nil {
return nil, err
}
return node, nil
}
func updateImageTagFn(imageTag types.Image) fsslice.SetFn {
return func(node *yaml.RNode) error {
return node.PipeE(imageTagUpdater{
ImageTag: imageTag,
})
}
}

View File

@@ -0,0 +1,101 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package imagetag
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
filtertest "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
func TestImageTagUpdater_Filter(t *testing.T) {
testCases := map[string]struct {
input string
expectedOutput string
filter Filter
fsSlice types.FsSlice
}{
"update with digest": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
image: nginx:1.2.1
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
image: apache@12345
`,
filter: Filter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
Digest: "12345",
},
},
fsSlice: []types.FieldSpec{
{
Path: "spec/image",
},
},
},
"multiple matches in sequence": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: nginx:1.2.1
- image: not_nginx@54321
- image: nginx:1.2.1
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: apache:3.2.1
- image: not_nginx@54321
- image: apache:3.2.1
`,
filter: Filter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
NewTag: "3.2.1",
},
},
fsSlice: []types.FieldSpec{
{
Path: "spec/containers/image",
},
},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
filter := tc.filter
filter.FsSlice = tc.fsSlice
if !assert.Equal(t,
strings.TrimSpace(tc.expectedOutput),
strings.TrimSpace(filtertest.RunFilter(t, tc.input, filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,113 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package imagetag
import (
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// LegacyFilter is an implementation of the kio.Filter interface
// that scans through the provided kyaml data structure and updates
// any values of any image fields that is inside a sequence under
// a field called either containers or initContainers. The field is only
// update if it has a value that matches and image reference and the name
// of the image is a match with the provided ImageTag.
type LegacyFilter struct {
ImageTag types.Image `json:"imageTag,omitempty" yaml:"imageTag,omitempty"`
}
var _ kio.Filter = LegacyFilter{}
func (lf LegacyFilter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
return kio.FilterAll(yaml.FilterFunc(lf.filter)).Filter(nodes)
}
func (lf LegacyFilter) filter(node *yaml.RNode) (*yaml.RNode, error) {
meta, err := node.GetMeta()
if err != nil {
return nil, err
}
// We do not make any changes if the type of the resource
// is CustomResourceDefinition.
if meta.Kind == `CustomResourceDefinition` {
return node, nil
}
fff := findFieldsFilter{
fields: []string{"containers", "initContainers"},
fieldCallback: checkImageTagsFn(lf.ImageTag),
}
if err := node.PipeE(fff); err != nil {
return nil, err
}
return node, nil
}
type fieldCallback func(node *yaml.RNode) error
// findFieldsFilter is an implementation of the kio.Filter
// interface. It will walk the data structure and look for fields
// that matches the provided list of field names. For each match,
// the value of the field will be passed in as a parameter to the
// provided fieldCallback.
// TODO: move this to kyaml/filterutils
type findFieldsFilter struct {
fields []string
fieldCallback fieldCallback
}
func (f findFieldsFilter) Filter(obj *yaml.RNode) (*yaml.RNode, error) {
return obj, f.walk(obj)
}
func (f findFieldsFilter) walk(node *yaml.RNode) error {
switch node.YNode().Kind {
case yaml.MappingNode:
return node.VisitFields(func(n *yaml.MapNode) error {
err := f.walk(n.Value)
if err != nil {
return err
}
key := n.Key.YNode().Value
if contains(f.fields, key) {
return f.fieldCallback(n.Value)
}
return nil
})
case yaml.SequenceNode:
return node.VisitElements(func(n *yaml.RNode) error {
return f.walk(n)
})
}
return nil
}
func contains(slice []string, str string) bool {
for _, s := range slice {
if s == str {
return true
}
}
return false
}
func checkImageTagsFn(imageTag types.Image) fieldCallback {
return func(node *yaml.RNode) error {
if node.YNode().Kind != yaml.SequenceNode {
return nil
}
return node.VisitElements(func(n *yaml.RNode) error {
// Look up any fields on the provided node that is named
// image.
return n.PipeE(yaml.Get("image"), imageTagUpdater{
ImageTag: imageTag,
})
})
}
}

View File

@@ -0,0 +1,136 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package imagetag
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
filtertest "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
func TestLegacyImageTag_Filter(t *testing.T) {
testCases := map[string]struct {
input string
expectedOutput string
filter LegacyFilter
}{
"updates multiple images inside containers": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: nginx:1.2.1
- image: nginx:2.1.2
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: apache@12345
- image: apache@12345
`,
filter: LegacyFilter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
Digest: "12345",
},
},
},
"updates inside both containers and initContainers": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: nginx:1.2.1
- image: tomcat:1.2.3
initContainers:
- image: nginx:1.2.1
- image: apache:1.2.3
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: apache:3.2.1
- image: tomcat:1.2.3
initContainers:
- image: apache:3.2.1
- image: apache:1.2.3
`,
filter: LegacyFilter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
NewTag: "3.2.1",
},
},
},
"updates on multiple depths": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: nginx:1.2.1
- image: tomcat:1.2.3
template:
spec:
initContainers:
- image: nginx:1.2.1
- image: apache:1.2.3
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
containers:
- image: apache:3.2.1
- image: tomcat:1.2.3
template:
spec:
initContainers:
- image: apache:3.2.1
- image: apache:1.2.3
`,
filter: LegacyFilter{
ImageTag: types.Image{
Name: "nginx",
NewName: "apache",
NewTag: "3.2.1",
},
},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
filter := tc.filter
if !assert.Equal(t,
strings.TrimSpace(tc.expectedOutput),
strings.TrimSpace(filtertest.RunFilter(t, tc.input, filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,43 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package imagetag
import (
"sigs.k8s.io/kustomize/api/image"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// imageTagUpdater is an implementation of the kio.Filter interface
// that will update the value of the yaml node based on the provided
// ImageTag if the current value matches the format of an image reference.
type imageTagUpdater struct {
Kind string `yaml:"kind,omitempty"`
ImageTag types.Image `yaml:"imageTag,omitempty"`
}
func (u imageTagUpdater) Filter(rn *yaml.RNode) (*yaml.RNode, error) {
if err := yaml.ErrorIfInvalid(rn, yaml.ScalarNode); err != nil {
return nil, err
}
value := rn.YNode().Value
if !image.IsImageMatched(value, u.ImageTag.Name) {
return rn, nil
}
name, tag := image.Split(value)
if u.ImageTag.NewName != "" {
name = u.ImageTag.NewName
}
if u.ImageTag.NewTag != "" {
tag = ":" + u.ImageTag.NewTag
}
if u.ImageTag.Digest != "" {
tag = "@" + u.ImageTag.Digest
}
return rn.Pipe(yaml.FieldSetter{StringValue: name + tag})
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package labels contains a kio.Filter implementation of the kustomize
// labels transformer.
package labels

View File

@@ -0,0 +1,55 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package labels
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
fss := builtinconfig.MakeDefaultConfig().CommonLabels
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`)}},
Filters: []kio.Filter{Filter{
Labels: map[string]string{
"foo": "bar",
},
FsSlice: fss,
}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// labels:
// foo: bar
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// labels:
// foo: bar
}

View File

@@ -0,0 +1,44 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package labels
import (
"sigs.k8s.io/kustomize/api/filters/filtersutil"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
type labelMap map[string]string
// Filter sets labels.
type Filter struct {
// Labels is the set of labels to apply to the inputs
Labels labelMap `yaml:"labels,omitempty"`
// FsSlice identifies the label fields.
FsSlice types.FsSlice
}
var _ kio.Filter = Filter{}
func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
keys := filtersutil.SortedMapKeys(f.Labels)
_, err := kio.FilterAll(yaml.FilterFunc(
func(node *yaml.RNode) (*yaml.RNode, error) {
for _, k := range keys {
if err := node.PipeE(fsslice.Filter{
FsSlice: f.FsSlice,
SetValue: fsslice.SetEntry(k, f.Labels[k], yaml.StringTag),
CreateKind: yaml.MappingNode, // Labels are MappingNodes.
CreateTag: "!!map",
}); err != nil {
return nil, err
}
}
return node, nil
})).Filter(nodes)
return nodes, err
}

View File

@@ -0,0 +1,413 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package labels
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/resid"
filtertest_test "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
func TestLabels_Filter(t *testing.T) {
testCases := map[string]struct {
input string
expectedOutput string
filter Filter
}{
"add": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
auto: ford
bean: cannellini
clown: emmett kelley
dragon: smaug
`,
filter: Filter{
Labels: labelMap{
"clown": "emmett kelley",
"auto": "ford",
"dragon": "smaug",
"bean": "cannellini",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
},
},
},
"update": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: superman
fiend: luthor
bean: cannellini
clown: emmett kelley
`,
filter: Filter{
Labels: labelMap{
"clown": "emmett kelley",
"hero": "superman",
"fiend": "luthor",
"bean": "cannellini",
}, FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
},
},
},
"data-fieldspecs": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
sleater: kinney
a:
b:
sleater: kinney
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
labels:
sleater: kinney
a:
b:
sleater: kinney
`,
filter: Filter{
Labels: labelMap{
"sleater": "kinney",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
{
Path: "a/b",
CreateIfNotPresent: true,
},
},
},
},
"fieldSpecWithKind": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v2
kind: Bar
metadata:
name: instance
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
cheese: cheddar
---
apiVersion: example.com/v2
kind: Bar
metadata:
name: instance
labels:
cheese: cheddar
a:
b:
cheese: cheddar
`,
filter: Filter{
Labels: labelMap{
"cheese": "cheddar",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
{
Gvk: resid.Gvk{
Kind: "Bar",
},
Path: "a/b",
CreateIfNotPresent: true,
},
},
},
},
"fieldSpecWithVersion": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v2
kind: Bar
metadata:
name: instance
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
cheese: cheddar
a:
b:
cheese: cheddar
---
apiVersion: example.com/v2
kind: Bar
metadata:
name: instance
labels:
cheese: cheddar
`,
filter: Filter{
Labels: labelMap{
"cheese": "cheddar",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
{
Gvk: resid.Gvk{
Version: "v1",
},
Path: "a/b",
CreateIfNotPresent: true,
},
},
},
},
"fieldSpecWithVersionInConfigButNoGroupInData": {
input: `
apiVersion: v1
kind: Foo
metadata:
name: instance
---
apiVersion: v2
kind: Bar
metadata:
name: instance
`,
expectedOutput: `
apiVersion: v1
kind: Foo
metadata:
name: instance
labels:
cheese: cheddar
a:
b:
cheese: cheddar
---
apiVersion: v2
kind: Bar
metadata:
name: instance
labels:
cheese: cheddar
`,
filter: Filter{
Labels: labelMap{
"cheese": "cheddar",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
{
Gvk: resid.Gvk{
Version: "v1",
},
Path: "a/b",
CreateIfNotPresent: true,
},
},
},
},
"number": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
1: emmett kelley
auto: "2"
`,
filter: Filter{
Labels: labelMap{
"1": "emmett kelley",
"auto": "2",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
},
},
},
// test quoting of values which are not considered strings in yaml 1.1
"yaml_1_1_compatibility": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
hero: batman
fiend: riddler
a: "y"
b: y1
c: "yes"
d: yes1
e: "true"
f: true1
`,
filter: Filter{
Labels: labelMap{
"a": "y",
"b": "y1",
"c": "yes",
"d": "yes1",
"e": "true",
"f": "true1",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
},
},
},
"null_labels": {
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels: null
`,
expectedOutput: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
labels:
a: a1
`,
filter: Filter{
Labels: labelMap{
"a": "a1",
},
FsSlice: []types.FieldSpec{
{
Path: "metadata/labels",
CreateIfNotPresent: true,
},
},
},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
if !assert.Equal(t,
strings.TrimSpace(tc.expectedOutput),
strings.TrimSpace(filtertest_test.RunFilter(t, tc.input, tc.filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,9 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package namespace contains a kio.Filter implementation of the kustomize
// namespace transformer.
//
// Special cases for known Kubernetes resources have been hardcoded in addition
// to those defined by the FsSlice.
package namespace

View File

@@ -0,0 +1,50 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package namespace_test
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/filters/namespace"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
fss := builtinconfig.MakeDefaultConfig().NameSpace
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: bar
`)}},
Filters: []kio.Filter{namespace.Filter{Namespace: "app", FsSlice: fss}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// namespace: app
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// namespace: app
}

View File

@@ -0,0 +1,167 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package namespace
import (
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
type Filter struct {
// Namespace is the namespace to apply to the inputs
Namespace string `yaml:"namespace,omitempty"`
// FsSlice contains the FieldSpecs to locate the namespace field
FsSlice types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
var _ kio.Filter = Filter{}
func (ns Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
return kio.FilterAll(yaml.FilterFunc(ns.run)).Filter(nodes)
}
// Run runs the filter on a single node rather than a slice
func (ns Filter) run(node *yaml.RNode) (*yaml.RNode, error) {
// hacks for hardcoded types -- :(
if err := ns.hacks(node); err != nil {
return nil, err
}
// Remove the fieldspecs that are for hardcoded fields. The fieldspecs
// exist for backwards compatibility with other implementations
// of this transformation.
// This implementation of the namespace transformation
// Does not use the fieldspecs for implementing cases which
// require hardcoded logic.
ns.FsSlice = ns.removeFieldSpecsForHacks(ns.FsSlice)
// transformations based on data -- :)
err := node.PipeE(fsslice.Filter{
FsSlice: ns.FsSlice,
SetValue: fsslice.SetScalar(ns.Namespace),
CreateKind: yaml.ScalarNode, // Namespace is a ScalarNode
CreateTag: yaml.StringTag,
})
return node, err
}
// hacks applies the namespace transforms that are hardcoded rather
// than specified through FieldSpecs.
func (ns Filter) hacks(obj *yaml.RNode) error {
meta, err := obj.GetMeta()
if err != nil {
return err
}
if err := ns.metaNamespaceHack(obj, meta); err != nil {
return err
}
return ns.roleBindingHack(obj, meta)
}
// metaNamespaceHack is a hack for implementing the namespace transform
// for the metadata.namespace field on namespace scoped resources.
// namespace scoped resources are determined by NOT being present
// in a blacklist of cluster-scoped resource types (by apiVersion and kind).
//
// This hack should be updated to allow individual resources to specify
// if they are cluster scoped through either an annotation on the resources,
// or through inlined OpenAPI on the resource as a YAML comment.
func (ns Filter) metaNamespaceHack(obj *yaml.RNode, meta yaml.ResourceMeta) error {
gvk := fsslice.GetGVK(meta)
if !gvk.IsNamespaceableKind() {
return nil
}
f := fsslice.Filter{
FsSlice: []types.FieldSpec{
{Path: types.MetadataNamespacePath, CreateIfNotPresent: true},
},
SetValue: fsslice.SetScalar(ns.Namespace),
CreateKind: yaml.ScalarNode, // Namespace is a ScalarNode
}
_, err := f.Filter(obj)
return err
}
// roleBindingHack is a hack for implementing the namespace transform
// for RoleBinding and ClusterRoleBinding resource types.
// RoleBinding and ClusterRoleBinding have namespace set on
// elements of the "subjects" field if and only if the subject elements
// "name" is "default". Otherwise the namespace is not set.
//
// Example:
//
// kind: RoleBinding
// subjects:
// - name: "default" # this will have the namespace set
// ...
// - name: "something-else" # this will not have the namespace set
// ...
func (ns Filter) roleBindingHack(obj *yaml.RNode, meta yaml.ResourceMeta) error {
if meta.Kind != roleBindingKind && meta.Kind != clusterRoleBindingKind {
return nil
}
// Lookup the namespace field on all elements.
// We should change the fieldspec so this isn't necessary.
obj, err := obj.Pipe(yaml.Lookup(subjectsField))
if err != nil || yaml.IsEmpty(obj) {
return err
}
// add the namespace to each "subject" with name: default
err = obj.VisitElements(func(o *yaml.RNode) error {
// copied from kunstruct based kustomize NamespaceTransformer plugin
// The only case we need to force the namespace
// if for the "service account". "default" is
// kind of hardcoded here for right now.
name, err := o.Pipe(
yaml.Lookup("name"), yaml.Match("default"),
)
if err != nil || yaml.IsEmpty(name) {
return err
}
// set the namespace for the default account
v := yaml.NewScalarRNode(ns.Namespace)
return o.PipeE(
yaml.LookupCreate(yaml.ScalarNode, "namespace"),
yaml.FieldSetter{Value: v},
)
})
return err
}
// removeFieldSpecsForHacks removes from the list fieldspecs that
// have hardcoded implementations
func (ns Filter) removeFieldSpecsForHacks(fs types.FsSlice) types.FsSlice {
var val types.FsSlice
for i := range fs {
// implemented by metaNamespaceHack
if fs[i].Path == types.MetadataNamespacePath {
continue
}
// implemented by roleBindingHack
if fs[i].Kind == roleBindingKind && fs[i].Path == subjectsField {
continue
}
// implemented by roleBindingHack
if fs[i].Kind == clusterRoleBindingKind && fs[i].Path == subjectsField {
continue
}
val = append(val, fs[i])
}
return val
}
const (
subjectsField = "subjects"
roleBindingKind = "RoleBinding"
clusterRoleBindingKind = "ClusterRoleBinding"
)

View File

@@ -0,0 +1,311 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package namespace_test
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/filters/namespace"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
filtertest_test "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
var tests = []TestCase{
{
name: "add",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
namespace: foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: foo
`,
filter: namespace.Filter{Namespace: "foo"},
},
{
name: "null_ns",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
namespace: null
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: null
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
namespace: foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: foo
`,
filter: namespace.Filter{Namespace: "foo"},
},
{
name: "add-recurse",
input: `
apiVersion: example.com/v1
kind: Foo
---
apiVersion: example.com/v1
kind: Bar
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
namespace: foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
namespace: foo
`,
filter: namespace.Filter{Namespace: "foo"},
},
{
name: "update",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
# update this namespace
namespace: bar
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: bar
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
# update this namespace
namespace: foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: foo
`,
filter: namespace.Filter{Namespace: "foo"},
},
{
name: "update-rolebinding",
input: `
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: default
---
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: default
namespace: foo
---
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: something
---
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: something
namespace: foo
`,
expected: `
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: default
namespace: bar
metadata:
namespace: bar
---
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: default
namespace: bar
metadata:
namespace: bar
---
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: something
metadata:
namespace: bar
---
apiVersion: example.com/v1
kind: RoleBinding
subjects:
- name: something
namespace: foo
metadata:
namespace: bar
`,
filter: namespace.Filter{Namespace: "bar"},
},
{
name: "update-clusterrolebinding",
input: `
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: default
---
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: default
namespace: foo
---
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: something
---
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: something
namespace: foo
`,
expected: `
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: default
namespace: bar
---
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: default
namespace: bar
---
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: something
---
apiVersion: example.com/v1
kind: ClusterRoleBinding
subjects:
- name: something
namespace: foo
`,
filter: namespace.Filter{Namespace: "bar"},
},
{
name: "data-fieldspecs",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
namespace: foo
a:
b:
c: foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: foo
a:
b:
c: foo
`,
filter: namespace.Filter{Namespace: "foo"},
fsslice: []types.FieldSpec{
{
Path: "a/b/c",
CreateIfNotPresent: true,
},
},
},
}
type TestCase struct {
name string
input string
expected string
filter namespace.Filter
fsslice types.FsSlice
}
var config = builtinconfig.MakeDefaultConfig()
func TestNamespace_Filter(t *testing.T) {
for i := range tests {
test := tests[i]
t.Run(test.name, func(t *testing.T) {
test.filter.FsSlice = append(config.NameSpace, test.fsslice...)
if !assert.Equal(t,
strings.TrimSpace(test.expected),
strings.TrimSpace(
filtertest_test.RunFilter(t, test.input, test.filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package namespace contains a kio.Filter implementation of the kustomize
// patchjson6902 transformer
package patchjson6902

View File

@@ -0,0 +1,55 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package patchjson6902
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
namespace: bar
`)}},
Filters: []kio.Filter{
Filter{
Patch: `
- op: replace
path: /metadata/namespace
value: "ns"
`,
},
},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// namespace: ns
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// namespace: ns
}

View File

@@ -0,0 +1,65 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package patchjson6902
import (
"strings"
jsonpatch "github.com/evanphx/json-patch"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
k8syaml "sigs.k8s.io/yaml"
)
type Filter struct {
Patch string
decodedPatch jsonpatch.Patch
}
var _ kio.Filter = Filter{}
func (pf Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
decodedPatch, err := pf.decodePatch()
if err != nil {
return nil, err
}
pf.decodedPatch = decodedPatch
return kio.FilterAll(yaml.FilterFunc(pf.run)).Filter(nodes)
}
func (pf Filter) decodePatch() (jsonpatch.Patch, error) {
patch := pf.Patch
// If the patch doesn't look like a JSON6902 patch, we
// try to parse it to json.
if !strings.HasPrefix(pf.Patch, "[") {
p, err := k8syaml.YAMLToJSON([]byte(patch))
if err != nil {
return nil, err
}
patch = string(p)
}
decodedPatch, err := jsonpatch.DecodePatch([]byte(patch))
if err != nil {
return nil, err
}
return decodedPatch, nil
}
func (pf Filter) run(node *yaml.RNode) (*yaml.RNode, error) {
// We don't actually use the kyaml library for manipulating the
// yaml here. We just marshal it to json and rely on the
// jsonpatch library to take care of applying the patch.
// This means ordering might not be preserved with this filter.
b, err := node.MarshalJSON()
if err != nil {
return nil, err
}
res, err := pf.decodedPatch.Apply(b)
if err != nil {
return nil, err
}
err = node.UnmarshalJSON(res)
return node, err
}

View File

@@ -0,0 +1,173 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package patchjson6902
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
filtertest "sigs.k8s.io/kustomize/api/testutils/filtertest"
)
const input = `
apiVersion: apps/v1
kind: Deployment
metadata:
name: myDeploy
spec:
replica: 2
template:
metadata:
labels:
old-label: old-value
spec:
containers:
- image: nginx
name: nginx
`
func TestSomething(t *testing.T) {
testCases := []struct {
testName string
input string
filter Filter
expectedOutput string
}{
{
testName: "single operation, json",
input: input,
filter: Filter{
Patch: `[
{"op": "replace", "path": "/spec/replica", "value": 5}
]`,
},
expectedOutput: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: myDeploy
spec:
replica: 5
template:
metadata:
labels:
old-label: old-value
spec:
containers:
- image: nginx
name: nginx
`,
},
{
testName: "multiple operations, json",
input: input,
filter: Filter{
Patch: `[
{"op": "replace", "path": "/spec/template/spec/containers/0/name", "value": "my-nginx"},
{"op": "add", "path": "/spec/replica", "value": 999},
{"op": "add", "path": "/spec/template/spec/containers/0/command", "value": ["arg1", "arg2", "arg3"]}
]`,
},
expectedOutput: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: myDeploy
spec:
replica: 999
template:
metadata:
labels:
old-label: old-value
spec:
containers:
- command:
- arg1
- arg2
- arg3
image: nginx
name: my-nginx
`,
},
{
testName: "single operation, yaml",
input: input,
filter: Filter{
Patch: `
- op: replace
path: /spec/replica
value: 5
`,
},
expectedOutput: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: myDeploy
spec:
replica: 5
template:
metadata:
labels:
old-label: old-value
spec:
containers:
- image: nginx
name: nginx
`,
},
{
testName: "multiple operations, yaml",
input: input,
filter: Filter{
Patch: `
- op: replace
path: /spec/template/spec/containers/0/name
value: my-nginx
- op: add
path: /spec/replica
value: 999
- op: add
path: /spec/template/spec/containers/0/command
value:
- arg1
- arg2
- arg3
`,
},
expectedOutput: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: myDeploy
spec:
replica: 999
template:
metadata:
labels:
old-label: old-value
spec:
containers:
- command:
- arg1
- arg2
- arg3
image: nginx
name: my-nginx
`,
},
}
for _, tc := range testCases {
t.Run(tc.testName, func(t *testing.T) {
if !assert.Equal(t,
strings.TrimSpace(tc.expectedOutput),
strings.TrimSpace(
filtertest.RunFilter(t, tc.input, tc.filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package patchstrategicmerge contains a kio.Filter implementation of the
// kustomize strategic merge patch transformer.
package patchstrategicmerge

View File

@@ -0,0 +1,49 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package patchstrategicmerge
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
func ExampleFilter() {
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
replicas: 3
`)}},
Filters: []kio.Filter{Filter{
Patch: yaml.MustParse(`
spec:
template:
containers:
- image: nginx
`),
}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// spec:
// replicas: 3
// template:
// containers:
// - image: nginx
}

View File

@@ -0,0 +1,21 @@
package patchstrategicmerge
import (
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
"sigs.k8s.io/kustomize/kyaml/yaml/merge2"
)
type Filter struct {
Patch *yaml.RNode
}
var _ kio.Filter = Filter{}
func (pf Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
return kio.FilterAll(yaml.FilterFunc(pf.run)).Filter(nodes)
}
func (pf Filter) run(node *yaml.RNode) (*yaml.RNode, error) {
return merge2.Merge(pf.Patch, node)
}

View File

@@ -0,0 +1,162 @@
package patchstrategicmerge
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
filtertest "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
func TestFilter(t *testing.T) {
testCases := map[string]struct {
input string
patch *yaml.RNode
expected string
}{
"simple patch": {
input: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
`,
patch: yaml.MustParse(`
metadata:
name: yourDeploy
`),
expected: `
apiVersion: apps/v1
metadata:
name: yourDeploy
kind: Deployment
`,
},
"container patch": {
input: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
template:
spec:
containers:
- name: foo1
- name: foo2
- name: foo3
`,
patch: yaml.MustParse(`
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
template:
spec:
containers:
- name: foo0
`),
expected: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
template:
spec:
containers:
- name: foo1
- name: foo2
- name: foo3
- name: foo0
`,
},
"volumes patch": {
input: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
template:
spec:
volumes:
- name: foo1
- name: foo2
- name: foo3
`,
patch: yaml.MustParse(`
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
template:
spec:
volumes:
- name: foo0
`),
expected: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
template:
spec:
volumes:
- name: foo1
- name: foo2
- name: foo3
- name: foo0
`,
},
"nested patch": {
input: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
containers:
- name: nginx
args:
- abc
`,
patch: yaml.MustParse(`
spec:
containers:
- name: nginx
args:
- def
`),
expected: `
apiVersion: apps/v1
metadata:
name: myDeploy
kind: Deployment
spec:
containers:
- name: nginx
args:
- def
`,
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
f := Filter{
Patch: tc.patch,
}
if !assert.Equal(t,
strings.TrimSpace(tc.expected),
strings.TrimSpace(
filtertest.RunFilter(t, tc.input, f))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package prefixsuffix contains a kio.Filter implementation of the kustomize
// PrefixSuffixTransformer.
package prefixsuffix

View File

@@ -0,0 +1,47 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package prefixsuffix_test
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/filters/prefixsuffix"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
fss := builtinconfig.MakeDefaultConfig().NamePrefix
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`)}},
Filters: []kio.Filter{prefixsuffix.Filter{Prefix: "baz-", FsSlice: fss}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: baz-instance
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: baz-instance
}

View File

@@ -0,0 +1,44 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package prefixsuffix
import (
"fmt"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// Filter applies resource name prefix's and suffix's using the fieldSpecs
type Filter struct {
Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
Suffix string `json:"suffix,omitempty" yaml:"suffix,omitempty"`
FsSlice types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
var _ kio.Filter = Filter{}
func (ns Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
return kio.FilterAll(yaml.FilterFunc(ns.run)).Filter(nodes)
}
// Run runs the filter on a single node rather than a slice
func (ns Filter) run(node *yaml.RNode) (*yaml.RNode, error) {
// transformations based on data -- :)
err := node.PipeE(fsslice.Filter{
FsSlice: ns.FsSlice,
SetValue: ns.set,
CreateKind: yaml.ScalarNode, // Name is a ScalarNode
CreateTag: yaml.StringTag,
})
return node, err
}
func (ns Filter) set(node *yaml.RNode) error {
return fsslice.SetScalar(fmt.Sprintf(
"%s%s%s", ns.Prefix, node.YNode().Value, ns.Suffix))(node)
}

View File

@@ -0,0 +1,167 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package prefixsuffix_test
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/filters/prefixsuffix"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
filtertest_test "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
var tests = []TestCase{
{
name: "prefix",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: foo-instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: foo-instance
`,
filter: prefixsuffix.Filter{Prefix: "foo-"},
},
{
name: "suffix",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance-foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance-foo
`,
filter: prefixsuffix.Filter{Suffix: "-foo"},
},
{
name: "prefix-suffix",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: bar-instance-foo
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: bar-instance-foo
`,
filter: prefixsuffix.Filter{Prefix: "bar-", Suffix: "-foo"},
},
{
name: "data-fieldspecs",
input: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
a:
b:
c: d
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
a:
b:
c: d
`,
expected: `
apiVersion: example.com/v1
kind: Foo
metadata:
name: foo-instance
a:
b:
c: foo-d
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: foo-instance
a:
b:
c: foo-d
`,
filter: prefixsuffix.Filter{Prefix: "foo-"},
fsslice: []types.FieldSpec{
{
Path: "a/b/c",
},
},
},
}
type TestCase struct {
name string
input string
expected string
filter prefixsuffix.Filter
fsslice types.FsSlice
}
var config = builtinconfig.MakeDefaultConfig()
func TestFilter(t *testing.T) {
for i := range tests {
test := tests[i]
t.Run(test.name, func(t *testing.T) {
test.filter.FsSlice = append(config.NamePrefix, test.fsslice...)
if !assert.Equal(t,
strings.TrimSpace(test.expected),
strings.TrimSpace(
filtertest_test.RunFilter(t, test.input, test.filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,6 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package replicacount contains a kio.Filter implementation of the kustomize
// ReplicaCountTransformer.
package replicacount

View File

@@ -0,0 +1,64 @@
package replicacount
import (
"bytes"
"log"
"os"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
)
func ExampleFilter() {
err := kio.Pipeline{
Inputs: []kio.Reader{&kio.ByteReader{Reader: bytes.NewBufferString(`
apiVersion: example.com/v1
kind: Foo
metadata:
name: instance
spec:
template:
replicas: 5
---
apiVersion: example.com/v1
kind: Bar
metadata:
name: instance
spec:
template:
replicas: 5
`)}},
Filters: []kio.Filter{Filter{
Replica: types.Replica{
Count: 42,
Name: "instance",
},
FsSlice: types.FsSlice{
{
Path: "spec/template/replicas",
},
},
}},
Outputs: []kio.Writer{kio.ByteWriter{Writer: os.Stdout}},
}.Execute()
if err != nil {
log.Fatal(err)
}
// Output:
// apiVersion: example.com/v1
// kind: Foo
// metadata:
// name: instance
// spec:
// template:
// replicas: 42
// ---
// apiVersion: example.com/v1
// kind: Bar
// metadata:
// name: instance
// spec:
// template:
// replicas: 42
}

View File

@@ -0,0 +1,49 @@
package replicacount
import (
"strconv"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// Filter updates/sets replicas fields using the fieldSpecs
type Filter struct {
Replica types.Replica `json:"replica,omitempty" yaml:"replica,omitempty"`
// FsSlice contains the FieldSpecs to locate the namespace field
FsSlice types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
var _ kio.Filter = Filter{}
func (rc Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
return kio.FilterAll(yaml.FilterFunc(rc.run)).Filter(nodes)
}
// run processes each node individually.
func (rc Filter) run(node *yaml.RNode) (*yaml.RNode, error) {
meta, err := node.GetMeta()
if err != nil {
return nil, err
}
// only update resources where the name matches the Replica name.
if meta.Name != rc.Replica.Name {
return node, nil
}
err = node.PipeE(fsslice.Filter{
FsSlice: rc.FsSlice,
SetValue: rc.set,
CreateKind: yaml.ScalarNode, // replicas is a ScalarNode
CreateTag: yaml.IntTag,
})
return node, err
}
func (rc Filter) set(node *yaml.RNode) error {
return fsslice.SetScalar(strconv.FormatInt(rc.Replica.Count, 10))(node)
}

View File

@@ -0,0 +1,199 @@
package replicacount
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
filtertest_test "sigs.k8s.io/kustomize/api/testutils/filtertest"
"sigs.k8s.io/kustomize/api/types"
)
func TestFilter(t *testing.T) {
var config = builtinconfig.MakeDefaultConfig()
testCases := map[string]struct {
input string
expected string
filter Filter
fsslice types.FsSlice
}{
"update field": {
input: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep
spec:
replicas: 5
`,
expected: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep
spec:
replicas: 42
`,
filter: Filter{
Replica: types.Replica{
Name: "dep",
Count: 42,
},
},
fsslice: types.FsSlice{
{
Path: "spec/replicas",
},
},
},
"add field": {
input: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
template:
other: something
`,
expected: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
template:
other: something
replicas: 42
`,
filter: Filter{
Replica: types.Replica{
Name: "cus",
Count: 42,
},
},
fsslice: types.FsSlice{
{
Path: "spec/template/replicas",
CreateIfNotPresent: true,
},
},
},
"add_field_null": {
input: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
template:
other: something
replicas: null
`,
expected: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
template:
other: something
replicas: 42
`,
filter: Filter{
Replica: types.Replica{
Name: "cus",
Count: 42,
},
},
fsslice: types.FsSlice{
{
Path: "spec/template/replicas",
CreateIfNotPresent: true,
},
},
},
"no update if CreateIfNotPresent is false": {
input: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
template:
other: something
`,
expected: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
template:
other: something
`,
filter: Filter{
Replica: types.Replica{
Name: "cus",
Count: 42,
},
},
fsslice: types.FsSlice{
{
Path: "spec/template/replicas",
},
},
},
"update multiple fields": {
input: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
replicas: 5
template:
replicas: 5
`,
expected: `
apiVersion: custom/v1
kind: Custom
metadata:
name: cus
spec:
replicas: 42
template:
replicas: 42
`,
filter: Filter{
Replica: types.Replica{
Name: "cus",
Count: 42,
},
},
fsslice: types.FsSlice{
{
Path: "spec/template/replicas",
},
{
Path: "spec/replicas",
},
},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
tc.filter.FsSlice = append(config.Replicas, tc.fsslice...)
if !assert.Equal(t,
strings.TrimSpace(tc.expected),
strings.TrimSpace(
filtertest_test.RunFilter(t, tc.input, tc.filter))) {
t.FailNow()
}
})
}
}

View File

@@ -0,0 +1,124 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package valueadd
import (
"strings"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
// An 'Add' operation aspiring to IETF RFC 6902 JSON.
//
// The filter tries to add a value to a node at a particular field path.
//
// Kinds of target fields:
//
// - Non-existent target field.
//
// The field will be added and the value inserted.
//
// - Existing field, scalar or map.
//
// E.g. 'spec/template/spec/containers/[name:nginx]/image'
//
// This behaves like an IETF RFC 6902 Replace operation would;
// the existing value is replaced without complaint, even though
// this is an Add operation. In contrast, a Replace operation
// must fail (report an error) if the field doesn't exist.
//
// - Existing field, list (array)
// Not supported yet.
// TODO: Honor fields with RFC-6902-style array indices
// TODO: like 'spec/template/spec/containers/2'
// TODO: Modify kyaml/yaml/PathGetter to allow this.
// The value will be inserted into the array at the given position,
// shifting other contents. To instead replace an array entry, use
// an implementation of an IETF RFC 6902 Replace operation.
//
// For the common case of a filepath in the field value, and a desire
// to add the value to the filepath (rather than replace the filepath),
// use a non-zero value of FilePathPosition (see below).
type Filter struct {
// Value is the value to add.
//
// Empty values are disallowed, i.e. this filter isn't intended
// for use in erasing or removing fields. For that, use a filter
// more aligned with the IETF RFC 6902 JSON Remove operation.
//
// At the time of writing, Value's value should be a simple string,
// not a JSON document. This particular filter focuses on easing
// injection of a single-sourced cloud project and/or cluster name
// into various fields, especially namespace and various filepath
// specifications.
Value string
// FieldPath is a JSON-style path to the field intended to hold the value.
FieldPath string
// FilePathPosition is a filepath field index.
//
// Call the value of this field _i_.
//
// If _i_ is zero, negative or unspecified, this field has no effect.
//
// If _i_ is > 0, then it's assumed that
// - 'Value' is a string that can work as a directory or file name,
// - the field value intended for replacement holds a filepath.
//
// The filepath is split into a string slice, the value is inserted
// at position [i-1], shifting the rest of the path to the right.
// A value of i==1 puts the new value at the start of the path.
// This change never converts an absolute path to a relative path,
// meaning adding a new field at position i==1 will preserve a
// leading slash. E.g. if Value == 'PEACH'
//
// OLD : NEW : FilePathPosition
// --------------------------------------------------------
// {empty} : PEACH : irrelevant
// / : /PEACH : irrelevant
// pie : PEACH/pie : 1 (or less to prefix)
// /pie : /PEACH/pie : 1 (or less to prefix)
// raw : raw/PEACH : 2 (or more to postfix)
// /raw : /raw/PEACH : 2 (or more to postfix)
// a/nice/warm/pie : a/nice/warm/PEACH/pie : 4
// /a/nice/warm/pie : /a/nice/warm/PEACH/pie : 4
//
// For robustness (liberal input, conservative output) FilePathPosition
// values that that are too large to index the split filepath result in a
// postfix rather than an error. So use 1 to prefix, 9999 to postfix.
FilePathPosition int `json:"filePathPosition,omitempty" yaml:"filePathPosition,omitempty"`
}
var _ kio.Filter = Filter{}
func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
_, err := kio.FilterAll(yaml.FilterFunc(
func(node *yaml.RNode) (*yaml.RNode, error) {
fields := strings.Split(f.FieldPath, "/")
// TODO: support SequenceNode.
// Presumably here one could look for array indices (digits) at
// the end of the field path (as described in IETF RFC 6902 JSON),
// and if found, take it as a signal that this should be a
// SequenceNode instead of a ScalarNode, and insert the value
// into the proper slot, shifting every over.
n, err := node.Pipe(yaml.LookupCreate(yaml.ScalarNode, fields...))
if err != nil {
return node, err
}
// TODO: allow more kinds
if err := yaml.ErrorIfInvalid(n, yaml.ScalarNode); err != nil {
return nil, err
}
newValue := f.Value
if f.FilePathPosition > 0 {
newValue = filesys.InsertPathPart(
n.YNode().Value, f.FilePathPosition-1, newValue)
}
return n.Pipe(yaml.FieldSetter{StringValue: newValue})
})).Filter(nodes)
return nodes, err
}

View File

@@ -0,0 +1,109 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package valueadd
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
filtertest_test "sigs.k8s.io/kustomize/api/testutils/filtertest"
)
const someResource = `
kind: SomeKind
spec:
resourceRef:
external: projects/whatever
`
func TestValueAddFilter(t *testing.T) {
testCases := map[string]struct {
input string
expectedOutput string
filter Filter
}{
"simpleAdd": {
input: `
kind: SomeKind
`,
expectedOutput: `
kind: SomeKind
spec:
resourceRef:
external: valueAdded
`,
filter: Filter{
Value: "valueAdded",
FieldPath: "spec/resourceRef/external",
},
},
"replaceExisting": {
input: someResource,
expectedOutput: `
kind: SomeKind
spec:
resourceRef:
external: valueAdded
`,
filter: Filter{
Value: "valueAdded",
FieldPath: "spec/resourceRef/external",
},
},
"prefixExisting": {
input: someResource,
expectedOutput: `
kind: SomeKind
spec:
resourceRef:
external: valueAdded/projects/whatever
`,
filter: Filter{
Value: "valueAdded",
FieldPath: "spec/resourceRef/external",
FilePathPosition: 1,
},
},
"postfixExisting": {
input: someResource,
expectedOutput: `
kind: SomeKind
spec:
resourceRef:
external: projects/whatever/valueAdded
`,
filter: Filter{
Value: "valueAdded",
FieldPath: "spec/resourceRef/external",
FilePathPosition: 99,
},
},
"placeInMiddleOfExisting": {
input: someResource,
expectedOutput: `
kind: SomeKind
spec:
resourceRef:
external: projects/valueAdded/whatever
`,
filter: Filter{
Value: "valueAdded",
FieldPath: "spec/resourceRef/external",
FilePathPosition: 2,
},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {
filter := tc.filter
if !assert.Equal(t,
strings.TrimSpace(tc.expectedOutput),
strings.TrimSpace(filtertest_test.RunFilter(t, tc.input, filter))) {
t.FailNow()
}
})
}
}

21
api/go.mod Normal file
View File

@@ -0,0 +1,21 @@
module sigs.k8s.io/kustomize/api
go 1.14
require (
github.com/evanphx/json-patch v4.5.0+incompatible
github.com/go-openapi/spec v0.19.5
github.com/golangci/golangci-lint v1.21.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.4.0
github.com/yujunz/go-getter v1.4.1-lite
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.17.0
k8s.io/apimachinery v0.17.0
k8s.io/client-go v0.17.0
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
sigs.k8s.io/kustomize/kyaml v0.3.4
sigs.k8s.io/yaml v1.2.0
)

590
api/go.sum Normal file
View File

@@ -0,0 +1,590 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1 h1:VlW4R6jmBIv3/u1JNlawEvJMM4J+dPORPaZasQee8Us=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4=
github.com/bombsimon/wsl v1.2.5 h1:9gTOkIwVtoDZywvX802SDHokeX4kW1cKnV8ZTVAPkRs=
github.com/bombsimon/wsl v1.2.5/go.mod h1:43lEF/i0kpXbLCeDXL9LMT8c92HyBywXb0AsgMHYngM=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/dustmop/soup v1.1.2-0.20190516214245-38228baa104e/go.mod h1:CgNC6SGbT+Xb8wGGvzilttZL1mc5sQ/5KkcxsZttMIk=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-critic/go-critic v0.3.5-0.20190904082202-d79a9f0c64db h1:GYXWx7Vr3+zv833u+8IoXbNnQY0AdXsxAgI0kX7xcwA=
github.com/go-critic/go-critic v0.3.5-0.20190904082202-d79a9f0c64db/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA=
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-lintpack/lintpack v0.5.2 h1:DI5mA3+eKdWeJ40nU4d6Wc26qmdG8RCi/btYq0TuRN0=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=
github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs=
github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk=
github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64=
github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw=
github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY=
github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g=
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8=
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astequal v1.0.0 h1:4zxD8j3JRFNyLN46lodQuqz3xdKSrur7U/sr0SDS/gQ=
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k=
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg=
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
github.com/go-toolsmith/pkgload v1.0.0 h1:4DFWWMXVfbcN5So1sBNW9+yeiMqLFGl1wFLTL5R0Tgg=
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2XQaA=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b h1:ekuhfTjngPhisSjOJ0QWKpPQE8/rbknHaes6WVJj5Hw=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 h1:YYWNAGTKWhKpcLLt7aSj/odlKrSrelQwlovBpDuf19w=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZBf8NjltjWihK2QfBBBZuv91cMFfDHw=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 h1:pe9JHs3cHHDQgOFXJJdYkK6fLz2PWyYtP4hthoCMvs8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70uaOiMbNnluTg7gyQhtGqLQncQh+4J8=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.21.0 h1:HxAxpR8Z0M8omihvQdsD3PF0qPjlqYqp2vMJzstoKeI=
github.com/golangci/golangci-lint v1.21.0/go.mod h1:phxpHK52q7SE+5KpPnti4oZTdFCEsn/tKN+nFvCKXfk=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 h1:EL/O5HGrF7Jaq0yNhBLucz9hTuRzj2LdwGBOaENgxIk=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 h1:leSNB7iYzLYSSx3J/s5sVf4Drkc68W2wm4Ixh/mr0us=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1aiNg8JbBMO2+E1WIQ+j/gL4SQqGPg=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3 h1:JVnpOZS+qxli+rgVl98ILOXVNbW+kb5wcxeGx8ShUIw=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0=
github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb h1:RHba4YImhrUVQDHUCe2BNSOz4tVy2yGyXhvYDvxGgeE=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/paulmach/orb v0.1.3/go.mod h1:VFlX/8C+IQ1p6FTRRKzKoOPJnvEtA5G0Veuqwbu//Vk=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d h1:K6eOUihrFLdZjZnA4XlRp864fmWXv9YTIk7VPLhRacA=
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/securego/gosec v0.0.0-20191002120514-e680875ea14d h1:BzRvVq1EHuIjxpijCEKpAxzKUUMurOQ4sknehIATRh8=
github.com/securego/gosec v0.0.0-20191002120514-e680875ea14d/go.mod h1:w5+eXa0mYznDkHaMCXA4XYffjlH+cy1oyKbfzJXa2Do=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sourcegraph/go-diff v0.5.1 h1:gO6i5zugwzo1RVTvgvfwCOSVegNuvnNi6bAD1QCmkHs=
github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok=
github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ultraware/funlen v0.0.2 h1:Av96YVBwwNSe4MLR7iI/BIa3VyI7/djnto/pK3Uxbdo=
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.4 h1:If7Va4cM03mpgrNH9k49/VOicWpGoG70XPBFFODYDsg=
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/uudashr/gocognit v0.0.0-20190926065955-1655d0de0517 h1:ChMKTho2hWKpks/nD/FL2KqM1wuVt62oJeiE8+eFpGs=
github.com/uudashr/gocognit v0.0.0-20190926065955-1655d0de0517/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI=
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yujunz/go-getter v1.4.1-lite h1:FhvNc94AXMZkfqUwfMKhnQEC9phkphSGdPTL7tIdhOM=
github.com/yujunz/go-getter v1.4.1-lite/go.mod h1:sbmqxXjyLunH1PkF3n7zSlnVeMvmYUuIl9ZVs/7NyCc=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg=
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c h1:Vco5b+cuG5NNfORVxZy6bYZQ7rsigisU1WQFkvQ0L5E=
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff h1:XdBG6es/oFDr1HwaxkxgVve7NB281QhxgK/i4voubFs=
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 h1:XZx7nhd5GMaZpmDaEHFVafUZC7ya0fuo7cSJ3UCKYmM=
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
k8s.io/api v0.17.0 h1:H9d/lw+VkZKEVIUc8F3wgiQ+FUXTTr21M87jXLU7yqM=
k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI=
k8s.io/apimachinery v0.17.0 h1:xRBnuie9rXcPxUkDizUsGvPf1cnlZCFu210op7J7LJo=
k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/client-go v0.17.0 h1:8QOGvUGdqDMFrm9sD6IUFl256BcffynGoe80sxgTEDg=
k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f h1:Cq7MalBHYACRd6EesksG1Q8EoIAKOsiZviGKbOLIej4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
sigs.k8s.io/kustomize/kyaml v0.3.4 h1:RhxnabYltv4mdD5+I7pIaJtae+eaTn4TiZqPT7K+C7A=
sigs.k8s.io/kustomize/kyaml v0.3.4/go.mod h1:XJL84E6sOFeNrQ7CADiemc1B0EjIxHo3OhW4o1aJYNw=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=

52
api/hasher/hasher.go Normal file
View File

@@ -0,0 +1,52 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package hasher
import (
"crypto/sha256"
"encoding/json"
"fmt"
"sort"
)
// SortArrayAndComputeHash sorts a string array and
// returns a hash for it
func SortArrayAndComputeHash(s []string) (string, error) {
sort.Strings(s)
data, err := json.Marshal(s)
if err != nil {
return "", err
}
return Encode(Hash(string(data)))
}
// Copied from https://github.com/kubernetes/kubernetes
// /blob/master/pkg/kubectl/util/hash/hash.go
func Encode(hex string) (string, error) {
if len(hex) < 10 {
return "", fmt.Errorf(
"input length must be at least 10")
}
enc := []rune(hex[:10])
for i := range enc {
switch enc[i] {
case '0':
enc[i] = 'g'
case '1':
enc[i] = 'h'
case '3':
enc[i] = 'k'
case 'a':
enc[i] = 'm'
case 'e':
enc[i] = 't'
}
}
return string(enc), nil
}
// Hash returns the hex form of the sha256 of the argument.
func Hash(data string) string {
return fmt.Sprintf("%x", sha256.Sum256([]byte(data)))
}

41
api/hasher/hasher_test.go Normal file
View File

@@ -0,0 +1,41 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package hasher_test
import (
"testing"
. "sigs.k8s.io/kustomize/api/hasher"
)
func TestSortArrayAndComputeHash(t *testing.T) {
array1 := []string{"a", "b", "c", "d"}
array2 := []string{"c", "b", "d", "a"}
h1, err := SortArrayAndComputeHash(array1)
if err != nil {
t.Errorf("unexpected error %v", err)
}
if h1 == "" {
t.Errorf("failed to hash %v", array1)
}
h2, err := SortArrayAndComputeHash(array2)
if err != nil {
t.Errorf("unexpected error %v", err)
}
if h2 == "" {
t.Errorf("failed to hash %v", array2)
}
if h1 != h2 {
t.Errorf("hash is not consistent with reordered list: %s %s", h1, h2)
}
}
func TestHash(t *testing.T) {
// hash the empty string to be sure that sha256 is being used
expect := "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
sum := Hash("")
if expect != sum {
t.Errorf("expected hash %q but got %q", expect, sum)
}
}

89
api/ifc/ifc.go Normal file
View File

@@ -0,0 +1,89 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package ifc holds miscellaneous interfaces used by kustomize.
package ifc
import (
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
)
// Validator provides functions to validate annotations and labels
type Validator interface {
MakeAnnotationValidator() func(map[string]string) error
MakeAnnotationNameValidator() func([]string) error
MakeLabelValidator() func(map[string]string) error
MakeLabelNameValidator() func([]string) error
ValidateNamespace(string) []string
ErrIfInvalidKey(string) error
IsEnvVarName(k string) error
}
// KvLoader reads and validates KV pairs.
type KvLoader interface {
Validator() Validator
Load(args types.KvPairSources) (all []types.Pair, err error)
}
// Loader interface exposes methods to read bytes.
type Loader interface {
// Root returns the root location for this Loader.
Root() string
// New returns Loader located at newRoot.
New(newRoot string) (Loader, error)
// Load returns the bytes read from the location or an error.
Load(location string) ([]byte, error)
// Cleanup cleans the loader
Cleanup() error
}
// Kunstructured allows manipulation of k8s objects
// that do not have Golang structs.
type Kunstructured interface {
Copy() Kunstructured
GetAnnotations() map[string]string
GetBool(path string) (bool, error)
GetFieldValue(string) (interface{}, error)
GetFloat64(path string) (float64, error)
GetGvk() resid.Gvk
GetInt64(path string) (int64, error)
GetKind() string
GetLabels() map[string]string
GetMap(path string) (map[string]interface{}, error)
GetName() string
GetSlice(path string) ([]interface{}, error)
GetString(string) (string, error)
GetStringMap(path string) (map[string]string, error)
GetStringSlice(string) ([]string, error)
Map() map[string]interface{}
MarshalJSON() ([]byte, error)
MatchesAnnotationSelector(selector string) (bool, error)
MatchesLabelSelector(selector string) (bool, error)
Patch(Kunstructured) error
SetAnnotations(map[string]string)
SetGvk(resid.Gvk)
SetLabels(map[string]string)
SetMap(map[string]interface{})
SetName(string)
SetNamespace(string)
UnmarshalJSON([]byte) error
}
// KunstructuredFactory makes instances of Kunstructured.
type KunstructuredFactory interface {
SliceFromBytes([]byte) ([]Kunstructured, error)
FromMap(m map[string]interface{}) Kunstructured
Hasher() KunstructuredHasher
MakeConfigMap(kvLdr KvLoader, args *types.ConfigMapArgs) (Kunstructured, error)
MakeSecret(kvLdr KvLoader, args *types.SecretArgs) (Kunstructured, error)
}
// KunstructuredHasher returns a hash of the argument
// or an error.
type KunstructuredHasher interface {
Hash(Kunstructured) (string, error)
}
// See core.v1.SecretTypeOpaque
const SecretTypeOpaque = "Opaque"

50
api/image/image.go Normal file
View File

@@ -0,0 +1,50 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package image
import (
"regexp"
"strings"
)
// IsImageMatched returns true if the value of t is identical to the
// image name in the full image name and tag as given by s.
func IsImageMatched(s, t string) bool {
// Tag values are limited to [a-zA-Z0-9_.{}-].
// Some tools like Bazel rules_k8s allow tag patterns with {} characters.
// More info: https://github.com/bazelbuild/rules_k8s/pull/423
pattern, _ := regexp.Compile("^" + t + "(@sha256)?(:[a-zA-Z0-9_.{}-]*)?$")
return pattern.MatchString(s)
}
// Split separates and returns the name and tag parts
// from the image string using either colon `:` or at `@` separators.
// Note that the returned tag keeps its separator.
func Split(imageName string) (name string, tag string) {
// check if image name contains a domain
// if domain is present, ignore domain and check for `:`
ic := -1
if slashIndex := strings.Index(imageName, "/"); slashIndex < 0 {
ic = strings.LastIndex(imageName, ":")
} else {
lastIc := strings.LastIndex(imageName[slashIndex:], ":")
// set ic only if `:` is present
if lastIc > 0 {
ic = slashIndex + lastIc
}
}
ia := strings.LastIndex(imageName, "@")
if ic < 0 && ia < 0 {
return imageName, ""
}
i := ic
if ia > 0 {
i = ia
}
name = imageName[:i]
tag = imageName[i:]
return
}

80
api/image/image_test.go Normal file
View File

@@ -0,0 +1,80 @@
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package image
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsImageMatched(t *testing.T) {
testCases := []struct {
testName string
value string
name string
isMatched bool
}{
{
testName: "identical",
value: "nginx",
name: "nginx",
isMatched: true,
},
{
testName: "name is match",
value: "nginx:12345",
name: "nginx",
isMatched: true,
},
{
testName: "name is not a match",
value: "apache:12345",
name: "nginx",
isMatched: false,
},
}
for _, tc := range testCases {
t.Run(tc.testName, func(t *testing.T) {
assert.Equal(t, tc.isMatched, IsImageMatched(tc.value, tc.name))
})
}
}
func TestSplit(t *testing.T) {
testCases := []struct {
testName string
value string
name string
tag string
}{
{
testName: "no tag",
value: "nginx",
name: "nginx",
tag: "",
},
{
testName: "with tag",
value: "nginx:1.2.3",
name: "nginx",
tag: ":1.2.3",
},
{
testName: "with digest",
value: "nginx@12345",
name: "nginx",
tag: "@12345",
},
}
for _, tc := range testCases {
t.Run(tc.testName, func(t *testing.T) {
name, tag := Split(tc.value)
assert.Equal(t, tc.name, name)
assert.Equal(t, tc.tag, tag)
})
}
}

View File

@@ -1,24 +1,12 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package expansion provides functions find and replace $(FOO) style variables in strings.
package expansion
import (
"bytes"
"fmt"
)
const (
@@ -36,15 +24,22 @@ func syntaxWrap(input string) string {
// implements the expansion semantics defined in the expansion spec; it
// returns the input string wrapped in the expansion syntax if no mapping
// for the input is found.
func MappingFuncFor(context ...map[string]string) func(string) string {
return func(input string) string {
func MappingFuncFor(
counts map[string]int,
context ...map[string]interface{}) func(string) interface{} {
return func(input string) interface{} {
for _, vars := range context {
val, ok := vars[input]
if ok {
return val
counts[input]++
switch typedV := val.(type) {
case string, int64, float64, bool:
return typedV
default:
return syntaxWrap(input)
}
}
}
return syntaxWrap(input)
}
}
@@ -52,7 +47,7 @@ func MappingFuncFor(context ...map[string]string) func(string) string {
// Expand replaces variable references in the input string according to
// the expansion spec using the given mapping function to resolve the
// values of variables.
func Expand(input string, mapping func(string) string) string {
func Expand(input string, mapping func(string) interface{}) interface{} {
var buf bytes.Buffer
checkpoint := 0
for cursor := 0; cursor < len(input); cursor++ {
@@ -69,7 +64,14 @@ func Expand(input string, mapping func(string) string) string {
// We were able to read a variable name correctly;
// apply the mapping to the variable name and copy the
// bytes into the buffer
buf.WriteString(mapping(read))
mapped := mapping(read)
if input == syntaxWrap(read) {
// Preserve the type of variable
return mapped
}
// Variable is used in a middle of a string
buf.WriteString(fmt.Sprintf("%v", mapped))
} else {
// Not a variable name; copy the read bytes into the buffer
buf.WriteString(read)
@@ -114,6 +116,6 @@ func tryReadVariableName(input string) (string, bool, int) {
// Not the beginning of an expression, ie, an operator
// that doesn't begin an expression. Return the operator
// and the first rune in the string.
return (string(operator) + string(input[0])), false, 1
return string(operator) + string(input[0]), false, 1
}
}

View File

@@ -0,0 +1,365 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package expansion_test
import (
"fmt"
"testing"
. "sigs.k8s.io/kustomize/api/internal/accumulator/expansion"
)
type expected struct {
count int
edited string
}
func TestMapReference(t *testing.T) {
type env struct {
Name string
Value interface{}
}
envs := []env{
{
Name: "FOO",
Value: "bar",
},
{
Name: "ZOO",
Value: "$(FOO)-1",
},
{
Name: "BLU",
Value: "$(ZOO)-2",
},
{
Name: "INT",
Value: 2,
},
{
Name: "ZINT",
Value: "$(INT)",
},
{
Name: "BOOL",
Value: true,
},
{
Name: "ZBOOL",
Value: "$(BOOL)",
},
}
declaredEnv := map[string]interface{}{
"FOO": "bar",
"ZOO": "$(FOO)-1",
"BLU": "$(ZOO)-2",
"INT": "2",
"ZINT": "$(INT)",
"BOOL": "true",
"ZBOOL": "$(BOOL)",
}
counts := make(map[string]int)
mapping := MappingFuncFor(counts, declaredEnv)
for _, env := range envs {
declaredEnv[env.Name] = Expand(fmt.Sprintf("%v", env.Value), mapping)
}
expectedEnv := map[string]expected{
"FOO": {count: 1, edited: "bar"},
"ZOO": {count: 1, edited: "bar-1"},
"BLU": {count: 0, edited: "bar-1-2"},
"INT": {count: 1, edited: "2"},
"ZINT": {count: 0, edited: "2"},
"BOOL": {count: 1, edited: "true"},
"ZBOOL": {count: 0, edited: "true"},
}
for k, v := range expectedEnv {
if e, a := v, declaredEnv[k]; e.edited != a || e.count != counts[k] {
t.Errorf("Expected %v count=%d, got %v count=%d",
e.edited, e.count, a, counts[k])
} else {
delete(declaredEnv, k)
}
}
if len(declaredEnv) != 0 {
t.Errorf("Unexpected keys in declared env: %v", declaredEnv)
}
}
func TestMapping(t *testing.T) {
context := map[string]interface{}{
"VAR_A": "A",
"VAR_B": "B",
"VAR_C": "C",
"VAR_REF": "$(VAR_A)",
"VAR_EMPTY": "",
}
doExpansionTest(t, context)
}
func TestMappingDual(t *testing.T) {
context := map[string]interface{}{
"VAR_A": "A",
"VAR_EMPTY": "",
}
context2 := map[string]interface{}{
"VAR_B": "B",
"VAR_C": "C",
"VAR_REF": "$(VAR_A)",
}
doExpansionTest(t, context, context2)
}
func doExpansionTest(t *testing.T, context ...map[string]interface{}) {
cases := []struct {
name string
input string
expected string
counts map[string]int
}{
{
name: "whole string",
input: "$(VAR_A)",
expected: "A",
counts: map[string]int{"VAR_A": 1},
},
{
name: "repeat",
input: "$(VAR_A)-$(VAR_A)",
expected: "A-A",
counts: map[string]int{"VAR_A": 2},
},
{
name: "multiple repeats",
input: "$(VAR_A)-$(VAR_B)-$(VAR_B)-$(VAR_B)-$(VAR_A)",
expected: "A-B-B-B-A",
counts: map[string]int{"VAR_A": 2, "VAR_B": 3},
},
{
name: "beginning",
input: "$(VAR_A)-1",
expected: "A-1",
counts: map[string]int{"VAR_A": 1},
},
{
name: "middle",
input: "___$(VAR_B)___",
expected: "___B___",
counts: map[string]int{"VAR_B": 1},
},
{
name: "end",
input: "___$(VAR_C)",
expected: "___C",
counts: map[string]int{"VAR_C": 1},
},
{
name: "compound",
input: "$(VAR_A)_$(VAR_B)_$(VAR_C)",
expected: "A_B_C",
counts: map[string]int{"VAR_A": 1, "VAR_B": 1, "VAR_C": 1},
},
{
name: "escape & expand",
input: "$$(VAR_B)_$(VAR_A)",
expected: "$(VAR_B)_A",
counts: map[string]int{"VAR_A": 1},
},
{
name: "compound escape",
input: "$$(VAR_A)_$$(VAR_B)",
expected: "$(VAR_A)_$(VAR_B)",
},
{
name: "mixed in escapes",
input: "f000-$$VAR_A",
expected: "f000-$VAR_A",
},
{
name: "backslash escape ignored",
input: "foo\\$(VAR_C)bar",
expected: "foo\\Cbar",
counts: map[string]int{"VAR_C": 1},
},
{
name: "backslash escape ignored",
input: "foo\\\\$(VAR_C)bar",
expected: "foo\\\\Cbar",
counts: map[string]int{"VAR_C": 1},
},
{
name: "lots of backslashes",
input: "foo\\\\\\\\$(VAR_A)bar",
expected: "foo\\\\\\\\Abar",
counts: map[string]int{"VAR_A": 1},
},
{
name: "nested var references",
input: "$(VAR_A$(VAR_B))",
expected: "$(VAR_A$(VAR_B))",
},
{
name: "nested var references second type",
input: "$(VAR_A$(VAR_B)",
expected: "$(VAR_A$(VAR_B)",
},
{
name: "value is a reference",
input: "$(VAR_REF)",
expected: "$(VAR_A)",
counts: map[string]int{"VAR_REF": 1},
},
{
name: "value is a reference x 2",
input: "%%$(VAR_REF)--$(VAR_REF)%%",
expected: "%%$(VAR_A)--$(VAR_A)%%",
counts: map[string]int{"VAR_REF": 2},
},
{
name: "empty var",
input: "foo$(VAR_EMPTY)bar",
expected: "foobar",
counts: map[string]int{"VAR_EMPTY": 1},
},
{
name: "unterminated expression",
input: "foo$(VAR_Awhoops!",
expected: "foo$(VAR_Awhoops!",
},
{
name: "expression without operator",
input: "f00__(VAR_A)__",
expected: "f00__(VAR_A)__",
},
{
name: "shell special vars pass through",
input: "$?_boo_$!",
expected: "$?_boo_$!",
},
{
name: "bare operators are ignored",
input: "$VAR_A",
expected: "$VAR_A",
},
{
name: "undefined vars are passed through",
input: "$(VAR_DNE)",
expected: "$(VAR_DNE)",
},
{
name: "multiple (even) operators, var undefined",
input: "$$$$$$(BIG_MONEY)",
expected: "$$$(BIG_MONEY)",
},
{
name: "multiple (even) operators, var defined",
input: "$$$$$$(VAR_A)",
expected: "$$$(VAR_A)",
},
{
name: "multiple (odd) operators, var undefined",
input: "$$$$$$$(GOOD_ODDS)",
expected: "$$$$(GOOD_ODDS)",
},
{
name: "multiple (odd) operators, var defined",
input: "$$$$$$$(VAR_A)",
expected: "$$$A",
counts: map[string]int{"VAR_A": 1},
},
{
name: "missing open expression",
input: "$VAR_A)",
expected: "$VAR_A)",
},
{
name: "shell syntax ignored",
input: "${VAR_A}",
expected: "${VAR_A}",
},
{
name: "trailing incomplete expression not consumed",
input: "$(VAR_B)_______$(A",
expected: "B_______$(A",
counts: map[string]int{"VAR_B": 1},
},
{
name: "trailing incomplete expression, no content, is not consumed",
input: "$(VAR_C)_______$(",
expected: "C_______$(",
counts: map[string]int{"VAR_C": 1},
},
{
name: "operator at end of input string is preserved",
input: "$(VAR_A)foobarzab$",
expected: "Afoobarzab$",
counts: map[string]int{"VAR_A": 1},
},
{
name: "shell escaped incomplete expr",
input: "foo-\\$(VAR_A",
expected: "foo-\\$(VAR_A",
},
{
name: "lots of $( in middle",
input: "--$($($($($--",
expected: "--$($($($($--",
},
{
name: "lots of $( in beginning",
input: "$($($($($--foo$(",
expected: "$($($($($--foo$(",
},
{
name: "lots of $( at end",
input: "foo0--$($($($(",
expected: "foo0--$($($($(",
},
{
name: "escaped operators in variable names are not escaped",
input: "$(foo$$var)",
expected: "$(foo$$var)",
},
{
name: "newline not expanded",
input: "\n",
expected: "\n",
},
}
for _, tc := range cases {
counts := make(map[string]int)
mapping := MappingFuncFor(counts, context...)
expanded := Expand(fmt.Sprintf("%v", tc.input), mapping)
if e, a := tc.expected, expanded; e != a {
t.Errorf("%v: expected %q, got %q", tc.name, e, a)
}
if len(counts) != len(tc.counts) {
t.Errorf("%v: len(counts)=%d != len(tc.counts)=%d",
tc.name, len(counts), len(tc.counts))
}
if len(tc.counts) > 0 {
for k, expectedCount := range tc.counts {
c, ok := counts[k]
if ok {
if c != expectedCount {
t.Errorf(
"%v: k=%s, expected count %d, got %d",
tc.name, k, expectedCount, c)
}
} else {
t.Errorf(
"%v: k=%s, expected count %d, got zero",
tc.name, k, expectedCount)
}
}
}
}
}

View File

@@ -0,0 +1,188 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package accumulator
import (
"encoding/json"
"strings"
"github.com/go-openapi/spec"
"github.com/pkg/errors"
"k8s.io/kube-openapi/pkg/common"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml"
)
type myProperties map[string]spec.Schema
type nameToApiMap map[string]common.OpenAPIDefinition
// LoadConfigFromCRDs parse CRD schemas from paths into a TransformerConfig
func LoadConfigFromCRDs(
ldr ifc.Loader, paths []string) (*builtinconfig.TransformerConfig, error) {
tc := builtinconfig.MakeEmptyConfig()
for _, path := range paths {
content, err := ldr.Load(path)
if err != nil {
return nil, err
}
m, err := makeNameToApiMap(content)
if err != nil {
return nil, errors.Wrapf(err, "unable to parse open API definition from '%s'", path)
}
otherTc, err := makeConfigFromApiMap(m)
if err != nil {
return nil, err
}
tc, err = tc.Merge(otherTc)
if err != nil {
return nil, err
}
}
return tc, nil
}
func makeNameToApiMap(content []byte) (result nameToApiMap, err error) {
if content[0] == '{' {
err = json.Unmarshal(content, &result)
} else {
err = yaml.Unmarshal(content, &result)
}
return
}
func makeConfigFromApiMap(m nameToApiMap) (*builtinconfig.TransformerConfig, error) {
result := builtinconfig.MakeEmptyConfig()
for name, api := range m {
if !looksLikeAk8sType(api.Schema.SchemaProps.Properties) {
continue
}
tc := builtinconfig.MakeEmptyConfig()
err := loadCrdIntoConfig(
tc, makeGvkFromTypeName(name), m, name, []string{})
if err != nil {
return result, err
}
result, err = result.Merge(tc)
if err != nil {
return result, err
}
}
return result, nil
}
// TODO: Get Group and Version for CRD from the
// openAPI definition once
// "x-kubernetes-group-version-kind" is available in CRD
func makeGvkFromTypeName(n string) resid.Gvk {
names := strings.Split(n, filesys.SelfDir)
kind := names[len(names)-1]
return resid.Gvk{Kind: kind}
}
func looksLikeAk8sType(properties myProperties) bool {
_, ok := properties["kind"]
if !ok {
return false
}
_, ok = properties["apiVersion"]
if !ok {
return false
}
_, ok = properties["metadata"]
return ok
}
const (
// "x-kubernetes-annotation": ""
xAnnotation = "x-kubernetes-annotation"
// "x-kubernetes-label-selector": ""
xLabelSelector = "x-kubernetes-label-selector"
// "x-kubernetes-identity": ""
xIdentity = "x-kubernetes-identity"
// "x-kubernetes-object-ref-api-version": <apiVersion name>
xVersion = "x-kubernetes-object-ref-api-version"
// "x-kubernetes-object-ref-kind": <kind name>
xKind = "x-kubernetes-object-ref-kind"
// "x-kubernetes-object-ref-name-key": "name"
// default is "name"
xNameKey = "x-kubernetes-object-ref-name-key"
)
// loadCrdIntoConfig loads a CRD spec into a TransformerConfig
func loadCrdIntoConfig(
theConfig *builtinconfig.TransformerConfig, theGvk resid.Gvk, theMap nameToApiMap,
typeName string, path []string) (err error) {
api, ok := theMap[typeName]
if !ok {
return nil
}
for propName, property := range api.Schema.SchemaProps.Properties {
_, annotate := property.Extensions.GetString(xAnnotation)
if annotate {
err = theConfig.AddAnnotationFieldSpec(
makeFs(theGvk, append(path, propName)))
if err != nil {
return
}
}
_, label := property.Extensions.GetString(xLabelSelector)
if label {
err = theConfig.AddLabelFieldSpec(
makeFs(theGvk, append(path, propName)))
if err != nil {
return
}
}
_, identity := property.Extensions.GetString(xIdentity)
if identity {
err = theConfig.AddPrefixFieldSpec(
makeFs(theGvk, append(path, propName)))
if err != nil {
return
}
}
version, ok := property.Extensions.GetString(xVersion)
if ok {
kind, ok := property.Extensions.GetString(xKind)
if ok {
nameKey, ok := property.Extensions.GetString(xNameKey)
if !ok {
nameKey = "name"
}
err = theConfig.AddNamereferenceFieldSpec(
builtinconfig.NameBackReferences{
Gvk: resid.Gvk{Kind: kind, Version: version},
FieldSpecs: []types.FieldSpec{
makeFs(theGvk, append(path, propName, nameKey))},
})
if err != nil {
return
}
}
}
if property.Ref.GetURL() != nil {
loadCrdIntoConfig(
theConfig, theGvk, theMap,
property.Ref.String(), append(path, propName))
}
}
return nil
}
func makeFs(in resid.Gvk, path []string) types.FieldSpec {
return types.FieldSpec{
CreateIfNotPresent: false,
Gvk: in,
Path: strings.Join(path, "/"),
}
}

View File

@@ -0,0 +1,181 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package accumulator_test
import (
"reflect"
"testing"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/loader"
. "sigs.k8s.io/kustomize/api/internal/accumulator"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
)
// This defines two CRD's: Bee and MyKind.
//
// Bee is boring, it's spec has no dependencies.
//
// MyKind, however, has a spec that contains
// a Bee and a (k8s native) Secret.
const (
crdContent = `
{
"github.com/example/pkg/apis/jingfang/v1beta1.Bee": {
"Schema": {
"description": "Bee",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert
recognized schemas to the latest internal value, and may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer
this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"
},
"spec": {
"$ref": "github.com/example/pkg/apis/jingfang/v1beta1.BeeSpec"
},
"status": {
"$ref": "github.com/example/pkg/apis/jingfang/v1beta1.BeeStatus"
}
}
},
"Dependencies": [
"github.com/example/pkg/apis/jingfang/v1beta1.BeeSpec",
"github.com/example/pkg/apis/jingfang/v1beta1.BeeStatus",
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"
]
},
"github.com/example/pkg/apis/jingfang/v1beta1.BeeSpec": {
"Schema": {
"description": "BeeSpec defines the desired state of Bee"
},
"Dependencies": []
},
"github.com/example/pkg/apis/jingfang/v1beta1.BeeStatus": {
"Schema": {
"description": "BeeStatus defines the observed state of Bee"
},
"Dependencies": []
},
"github.com/example/pkg/apis/jingfang/v1beta1.MyKind": {
"Schema": {
"description": "MyKind",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot be updated.
In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"
},
"spec": {
"$ref": "github.com/example/pkg/apis/jingfang/v1beta1.MyKindSpec"
},
"status": {
"$ref": "github.com/example/pkg/apis/jingfang/v1beta1.MyKindStatus"
}
}
},
"Dependencies": [
"github.com/example/pkg/apis/jingfang/v1beta1.MyKindSpec",
"github.com/example/pkg/apis/jingfang/v1beta1.MyKindStatus",
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"
]
},
"github.com/example/pkg/apis/jingfang/v1beta1.MyKindSpec": {
"Schema": {
"description": "MyKindSpec defines the desired state of MyKind",
"properties": {
"beeRef": {
"x-kubernetes-object-ref-api-version": "v1beta1",
"x-kubernetes-object-ref-kind": "Bee",
"$ref": "github.com/example/pkg/apis/jingfang/v1beta1.Bee"
},
"secretRef": {
"description": "If defined, we use this secret for configuring the MYSQL_ROOT_PASSWORD
If it is not set we generate a secret dynamically",
"x-kubernetes-object-ref-api-version": "v1",
"x-kubernetes-object-ref-kind": "Secret",
"$ref": "k8s.io/api/core/v1.LocalObjectReference"
}
}
},
"Dependencies": [
"github.com/example/pkg/apis/jingfang/v1beta1.Bee",
"k8s.io/api/core/v1.LocalObjectReference"
]
},
"github.com/example/pkg/apis/jingfang/v1beta1.MyKindStatus": {
"Schema": {
"description": "MyKindStatus defines the observed state of MyKind"
},
"Dependencies": []
}
}
`
)
func TestLoadCRDs(t *testing.T) {
nbrs := []builtinconfig.NameBackReferences{
{
Gvk: resid.Gvk{Kind: "Secret", Version: "v1"},
FieldSpecs: []types.FieldSpec{
{
CreateIfNotPresent: false,
Gvk: resid.Gvk{Kind: "MyKind"},
Path: "spec/secretRef/name",
},
},
},
{
Gvk: resid.Gvk{Kind: "Bee", Version: "v1beta1"},
FieldSpecs: []types.FieldSpec{
{
CreateIfNotPresent: false,
Gvk: resid.Gvk{Kind: "MyKind"},
Path: "spec/beeRef/name",
},
},
},
}
expectedTc := &builtinconfig.TransformerConfig{
NameReference: nbrs,
}
fSys := filesys.MakeFsInMemory()
fSys.WriteFile("/testpath/crd.json", []byte(crdContent))
ldr, err := loader.NewLoader(loader.RestrictionRootOnly, "/testpath", fSys)
if err != nil {
t.Fatalf("unexpected error:%v", err)
}
actualTc, err := LoadConfigFromCRDs(ldr, []string{"crd.json"})
if err != nil {
t.Fatalf("unexpected error:%v", err)
}
if !reflect.DeepEqual(actualTc, expectedTc) {
t.Fatalf("expected\n %v\n but got\n %v\n", expectedTc, actualTc)
}
}

View File

@@ -0,0 +1,269 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package accumulator
import (
"fmt"
"log"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/transform"
)
type nameReferenceTransformer struct {
backRefs []builtinconfig.NameBackReferences
}
var _ resmap.Transformer = &nameReferenceTransformer{}
// newNameReferenceTransformer constructs a nameReferenceTransformer
// with a given slice of NameBackReferences.
func newNameReferenceTransformer(br []builtinconfig.NameBackReferences) resmap.Transformer {
if br == nil {
log.Fatal("backrefs not expected to be nil")
}
return &nameReferenceTransformer{backRefs: br}
}
// Transform updates name references in resource A that
// refer to resource B, given that B's name may have
// changed.
//
// For example, a HorizontalPodAutoscaler (HPA)
// necessarily refers to a Deployment, the thing that
// the HPA scales. The Deployment name might change
// (e.g. prefix added), and the reference in the HPA
// has to be fixed.
//
// In the outer loop over the ResMap below, say we
// encounter a specific HPA. Then, in scanning backrefs,
// we encounter an entry like
//
// - kind: Deployment
// fieldSpecs:
// - kind: HorizontalPodAutoscaler
// path: spec/scaleTargetRef/name
//
// This entry says that an HPA, via its
// 'spec/scaleTargetRef/name' field, may refer to a
// Deployment. This match to HPA means we may need to
// modify the value in its 'spec/scaleTargetRef/name'
// field, by searching for the thing it refers to,
// and getting its new name.
//
// As a filter, and search optimization, we compute a
// subset of all resources that the HPA could refer to,
// by excluding objects from other namespaces, and
// excluding objects that don't have the same prefix-
// suffix mods as the HPA.
//
// We look in this subset for all Deployment objects
// with a resId that has a Name matching the field value
// present in the HPA. If no match do nothing; if more
// than one match, it's an error.
//
// We overwrite the HPA name field with the value found
// in the Deployment's name field (the name in the raw
// object - the modified name - not the unmodified name
// in the Deployment's resId).
//
// This process assumes that the name stored in a ResId
// (the ResMap key) isn't modified by name transformers.
// Name transformers should only modify the name in the
// body of the resource object (the value in the ResMap).
//
func (o *nameReferenceTransformer) Transform(m resmap.ResMap) error {
// TODO: Too much looping, here and in transitive calls.
for _, referrer := range m.Resources() {
var candidates resmap.ResMap
for _, target := range o.backRefs {
for _, fSpec := range target.FieldSpecs {
if referrer.OrgId().IsSelected(&fSpec.Gvk) {
if candidates == nil {
candidates = m.SubsetThatCouldBeReferencedByResource(referrer)
}
err := transform.MutateField(
referrer.Map(),
fSpec.PathSlice(),
fSpec.CreateIfNotPresent,
o.getNewNameFunc(
// referrer could be an HPA instance,
// target could be Gvk for Deployment,
// candidate a list of resources "reachable"
// from the HPA.
referrer, target.Gvk, candidates))
if err != nil {
return err
}
}
}
}
}
return nil
}
// selectReferral picks the referral among a subset of candidates.
// It returns the current name and namespace of the selected candidate.
// Note that the content of the referricalCandidateSubset slice is most of the time
// identical to the referralCandidates resmap. Still in some cases, such
// as ClusterRoleBinding, the subset only contains the resources of a specific
// namespace.
func (o *nameReferenceTransformer) selectReferral(
oldName string,
referrer *resource.Resource,
target resid.Gvk,
referralCandidates resmap.ResMap,
referralCandidateSubset []*resource.Resource) (interface{}, interface{}, error) {
for _, res := range referralCandidateSubset {
id := res.OrgId()
if id.IsSelected(&target) && res.GetOriginalName() == oldName {
matches := referralCandidates.GetMatchingResourcesByOriginalId(id.Equals)
// If there's more than one match, there's no way
// to know which one to pick, so emit error.
if len(matches) > 1 {
return nil, nil, fmt.Errorf(
"multiple matches for %s:\n %v",
id, getIds(matches))
}
// In the resource, note that it is referenced
// by the referrer.
res.AppendRefBy(referrer.CurId())
// Return transformed name of the object,
// complete with prefixes, hashes, etc.
return res.GetName(), res.GetNamespace(), nil
}
}
return oldName, nil, nil
}
// utility function to replace a simple string by the new name
func (o *nameReferenceTransformer) getSimpleNameField(
oldName string,
referrer *resource.Resource,
target resid.Gvk,
referralCandidates resmap.ResMap,
referralCandidateSubset []*resource.Resource) (interface{}, error) {
newName, _, err := o.selectReferral(oldName, referrer, target,
referralCandidates, referralCandidateSubset)
return newName, err
}
// utility function to replace name field within a map[string]interface{}
// and leverage the namespace field.
func (o *nameReferenceTransformer) getNameAndNsStruct(
inMap map[string]interface{},
referrer *resource.Resource,
target resid.Gvk,
referralCandidates resmap.ResMap) (interface{}, error) {
// Example:
if _, ok := inMap["name"]; !ok {
return nil, fmt.Errorf(
"%#v is expected to contain a name field", inMap)
}
oldName, ok := inMap["name"].(string)
if !ok {
return nil, fmt.Errorf(
"%#v is expected to contain a name field of type string", oldName)
}
subset := referralCandidates.Resources()
if namespacevalue, ok := inMap["namespace"]; ok {
namespace := namespacevalue.(string)
bynamespace := referralCandidates.GroupedByOriginalNamespace()
if _, ok := bynamespace[namespace]; !ok {
return inMap, nil
}
subset = bynamespace[namespace]
}
newname, newnamespace, err := o.selectReferral(oldName, referrer, target,
referralCandidates, subset)
if err != nil {
return nil, err
}
if (newname == oldName) && (newnamespace == nil) {
// no candidate found.
return inMap, nil
}
inMap["name"] = newname
if newnamespace != "" {
// We don't want value "" to replace value "default" since
// the empty string is handled as a wild card here not default namespace
// by kubernetes.
inMap["namespace"] = newnamespace
}
return inMap, nil
}
func (o *nameReferenceTransformer) getNewNameFunc(
referrer *resource.Resource,
target resid.Gvk,
referralCandidates resmap.ResMap) func(in interface{}) (interface{}, error) {
return func(in interface{}) (interface{}, error) {
switch thing := in.(type) {
case string:
return o.getSimpleNameField(thing, referrer, target,
referralCandidates, referralCandidates.Resources())
case map[string]interface{}:
// Kind: ValidatingWebhookConfiguration
// FieldSpec is webhooks/clientConfig/service
return o.getNameAndNsStruct(thing, referrer, target,
referralCandidates)
case []interface{}:
for idx, item := range thing {
switch value := item.(type) {
case string:
// Kind: Role/ClusterRole
// FieldSpec is rules.resourceNames
newName, err := o.getSimpleNameField(value, referrer, target,
referralCandidates, referralCandidates.Resources())
if err != nil {
return nil, err
}
thing[idx] = newName
case map[string]interface{}:
// Kind: RoleBinding/ClusterRoleBinding
// FieldSpec is subjects
// Note: The corresponding fieldSpec had been changed from
// from path: subjects/name to just path: subjects. This is
// what get mutatefield to request the mapping of the whole
// map containing namespace and name instead of just a simple
// string field containing the name
newMap, err := o.getNameAndNsStruct(value, referrer, target,
referralCandidates)
if err != nil {
return nil, err
}
thing[idx] = newMap
default:
return nil, fmt.Errorf(
"%#v is expected to be either a []string or a []map[string]interface{}", in)
}
}
return in, nil
default:
return nil, fmt.Errorf(
"%#v is expected to be either a string or a []interface{}", in)
}
}
}
func getIds(rs []*resource.Resource) []string {
var result []string
for _, r := range rs {
result = append(result, r.CurId().String()+"\n")
}
return result
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,117 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package accumulator
import (
"fmt"
expansion2 "sigs.k8s.io/kustomize/api/internal/accumulator/expansion"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/transform"
"sigs.k8s.io/kustomize/api/types"
)
type refVarTransformer struct {
varMap map[string]interface{}
replacementCounts map[string]int
fieldSpecs []types.FieldSpec
mappingFunc func(string) interface{}
}
// newRefVarTransformer returns a new refVarTransformer
// that replaces $(VAR) style variables with values.
// The fieldSpecs are the places to look for occurrences of $(VAR).
func newRefVarTransformer(
varMap map[string]interface{}, fs []types.FieldSpec) *refVarTransformer {
return &refVarTransformer{
varMap: varMap,
fieldSpecs: fs,
}
}
// replaceVars accepts as 'in' a string, or string array, which can have
// embedded instances of $VAR style variables, e.g. a container command string.
// The function returns the string with the variables expanded to their final
// values.
func (rv *refVarTransformer) replaceVars(in interface{}) (interface{}, error) {
switch vt := in.(type) {
case []interface{}:
var xs []interface{}
for _, a := range in.([]interface{}) {
x, ok := a.(string)
if !ok {
return nil, fmt.Errorf("expected array of strings, found %v", in)
}
xs = append(xs, expansion2.Expand(x, rv.mappingFunc))
}
return xs, nil
case map[string]interface{}:
inMap := in.(map[string]interface{})
xs := make(map[string]interface{}, len(inMap))
for k, v := range inMap {
s, ok := v.(string)
if !ok {
// This field can not contain a $(VAR) since it is not
// of string type. For instance .spec.replicas: 3 in
// a Deployment object
xs[k] = v
} else {
// This field can potentially contains a $(VAR) since it is
// of string type. For instance .spec.replicas: $(REPLICAS)
// in a Deployment object
xs[k] = expansion2.Expand(s, rv.mappingFunc)
}
}
return xs, nil
case interface{}:
s, ok := in.(string)
if !ok {
// This field can not contain a $(VAR) since it is not of string type.
return in, nil
}
// This field can potentially contain a $(VAR) since it is
// of string type.
return expansion2.Expand(s, rv.mappingFunc), nil
// staticcheck erroneously claims that `case nil`
// is unreachable here, so suppressing it.
//nolint:staticcheck
case nil:
return nil, nil
default:
return "", fmt.Errorf("invalid type encountered %T", vt)
}
}
// UnusedVars returns slice of Var names that were unused
// after a Transform run.
func (rv *refVarTransformer) UnusedVars() []string {
var unused []string
for k := range rv.varMap {
_, ok := rv.replacementCounts[k]
if !ok {
unused = append(unused, k)
}
}
return unused
}
// Transform replaces $(VAR) style variables with values.
func (rv *refVarTransformer) Transform(m resmap.ResMap) error {
rv.replacementCounts = make(map[string]int)
rv.mappingFunc = expansion2.MappingFuncFor(
rv.replacementCounts, rv.varMap)
for _, res := range m.Resources() {
for _, fieldSpec := range rv.fieldSpecs {
if res.OrgId().IsSelected(&fieldSpec.Gvk) {
if err := transform.MutateField(
res.Map(), fieldSpec.PathSlice(),
false, rv.replaceVars); err != nil {
return err
}
}
}
}
return nil
}

View File

@@ -0,0 +1,166 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package accumulator
import (
"reflect"
"testing"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
resmaptest_test "sigs.k8s.io/kustomize/api/testutils/resmaptest"
"sigs.k8s.io/kustomize/api/types"
)
func TestRefVarTransformer(t *testing.T) {
type given struct {
varMap map[string]interface{}
fs []types.FieldSpec
res resmap.ResMap
}
type expected struct {
res resmap.ResMap
unused []string
}
testCases := []struct {
description string
given given
expected expected
errMessage string
}{
{
description: "var replacement in map[string]",
given: given{
varMap: map[string]interface{}{
"FOO": "replacementForFoo",
"BAR": "replacementForBar",
"BAZ": int64(5),
"BOO": true,
},
fs: []types.FieldSpec{
{Gvk: resid.Gvk{Version: "v1", Kind: "ConfigMap"}, Path: "data/map"},
{Gvk: resid.Gvk{Version: "v1", Kind: "ConfigMap"}, Path: "data/slice"},
{Gvk: resid.Gvk{Version: "v1", Kind: "ConfigMap"}, Path: "data/interface"},
{Gvk: resid.Gvk{Version: "v1", Kind: "ConfigMap"}, Path: "data/nil"},
{Gvk: resid.Gvk{Version: "v1", Kind: "ConfigMap"}, Path: "data/num"},
},
res: resmaptest_test.NewRmBuilder(
t, resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())).
Add(map[string]interface{}{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": map[string]interface{}{
"name": "cm1",
},
"data": map[string]interface{}{
"map": map[string]interface{}{
"item1": "$(FOO)",
"item2": "bla",
"item3": "$(BAZ)",
"item4": "$(BAZ)+$(BAZ)",
"item5": "$(BOO)",
"item6": "if $(BOO)",
"item7": 2019,
},
"slice": []interface{}{
"$(FOO)",
"bla",
"$(BAZ)",
"$(BAZ)+$(BAZ)",
"$(BOO)",
"if $(BOO)",
},
"interface": "$(FOO)",
"nil": nil,
"num": 2019,
}}).ResMap(),
},
expected: expected{
res: resmaptest_test.NewRmBuilder(
t, resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())).
Add(map[string]interface{}{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": map[string]interface{}{
"name": "cm1",
},
"data": map[string]interface{}{
"map": map[string]interface{}{
"item1": "replacementForFoo",
"item2": "bla",
"item3": int64(5),
"item4": "5+5",
"item5": true,
"item6": "if true",
"item7": 2019,
},
"slice": []interface{}{
"replacementForFoo",
"bla",
int64(5),
"5+5",
true,
"if true",
},
"interface": "replacementForFoo",
"nil": nil,
"num": 2019,
}}).ResMap(),
unused: []string{"BAR"},
},
},
{
description: "var replacement panic in map[string]",
given: given{
varMap: map[string]interface{}{},
fs: []types.FieldSpec{
{Gvk: resid.Gvk{Version: "v1", Kind: "ConfigMap"}, Path: "data/slice"},
},
res: resmaptest_test.NewRmBuilder(
t, resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())).
Add(map[string]interface{}{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": map[string]interface{}{
"name": "cm1",
},
"data": map[string]interface{}{
"slice": []interface{}{5}, // noticeably *not* a []string
}}).ResMap(),
},
errMessage: "expected array of strings, found [5]",
},
}
for _, tc := range testCases {
t.Run(tc.description, func(t *testing.T) {
// arrange
tr := newRefVarTransformer(tc.given.varMap, tc.given.fs)
// act
err := tr.Transform(tc.given.res)
// assert
if tc.errMessage != "" {
if err == nil {
t.Fatalf("missing expected error %v", tc.errMessage)
} else if err.Error() != tc.errMessage {
t.Fatalf("actual error doesn't match expected error: \nACTUAL: %v\nEXPECTED: %v", err.Error(), tc.errMessage)
}
} else {
if err != nil {
t.Errorf("unexpected error: %v", err)
}
a, e := tc.given.res, tc.expected.res
if !reflect.DeepEqual(a, e) {
err = e.ErrorIfNotEqualLists(a)
t.Fatalf("actual doesn't match expected: \nACTUAL:\n%v\nEXPECTED:\n%v\nERR: %v", a, e, err)
}
}
})
}
}

View File

@@ -0,0 +1,166 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package accumulator
import (
"fmt"
"log"
"strings"
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
)
// ResAccumulator accumulates resources and the rules
// used to customize those resources. It's a ResMap
// plus stuff needed to modify the ResMap.
type ResAccumulator struct {
resMap resmap.ResMap
tConfig *builtinconfig.TransformerConfig
varSet types.VarSet
}
func MakeEmptyAccumulator() *ResAccumulator {
ra := &ResAccumulator{}
ra.resMap = resmap.New()
ra.tConfig = &builtinconfig.TransformerConfig{}
ra.varSet = types.NewVarSet()
return ra
}
// ResMap returns a copy of the internal resMap.
func (ra *ResAccumulator) ResMap() resmap.ResMap {
return ra.resMap.ShallowCopy()
}
// Vars returns a copy of underlying vars.
func (ra *ResAccumulator) Vars() []types.Var {
return ra.varSet.AsSlice()
}
func (ra *ResAccumulator) AppendAll(
resources resmap.ResMap) error {
return ra.resMap.AppendAll(resources)
}
func (ra *ResAccumulator) AbsorbAll(
resources resmap.ResMap) error {
return ra.resMap.AbsorbAll(resources)
}
func (ra *ResAccumulator) MergeConfig(
tConfig *builtinconfig.TransformerConfig) (err error) {
ra.tConfig, err = ra.tConfig.Merge(tConfig)
return err
}
func (ra *ResAccumulator) GetTransformerConfig() *builtinconfig.TransformerConfig {
return ra.tConfig
}
func (ra *ResAccumulator) MergeVars(incoming []types.Var) error {
for _, v := range incoming {
targetId := resid.NewResIdWithNamespace(v.ObjRef.GVK(), v.ObjRef.Name, v.ObjRef.Namespace)
idMatcher := targetId.GvknEquals
if targetId.Namespace != "" || !targetId.IsNamespaceableKind() {
// Preserve backward compatibility. An empty namespace means
// wildcard search on the namespace hence we still use GvknEquals
idMatcher = targetId.Equals
}
matched := ra.resMap.GetMatchingResourcesByOriginalId(idMatcher)
if len(matched) > 1 {
return fmt.Errorf(
"found %d resId matches for var %s "+
"(unable to disambiguate)",
len(matched), v)
}
if len(matched) == 1 {
matched[0].AppendRefVarName(v)
}
}
return ra.varSet.MergeSlice(incoming)
}
func (ra *ResAccumulator) MergeAccumulator(other *ResAccumulator) (err error) {
err = ra.AppendAll(other.resMap)
if err != nil {
return err
}
err = ra.MergeConfig(other.tConfig)
if err != nil {
return err
}
return ra.varSet.MergeSet(other.varSet)
}
func (ra *ResAccumulator) findVarValueFromResources(v types.Var) (interface{}, error) {
for _, res := range ra.resMap.Resources() {
for _, varName := range res.GetRefVarNames() {
if varName == v.Name {
s, err := res.GetFieldValue(v.FieldRef.FieldPath)
if err != nil {
return "", fmt.Errorf(
"field specified in var '%v' "+
"not found in corresponding resource", v)
}
return s, nil
}
}
}
return "", fmt.Errorf(
"var '%v' cannot be mapped to a field "+
"in the set of known resources", v)
}
// makeVarReplacementMap returns a map of Var names to
// their final values. The values are strings intended
// for substitution wherever the $(var.Name) occurs.
func (ra *ResAccumulator) makeVarReplacementMap() (map[string]interface{}, error) {
result := map[string]interface{}{}
for _, v := range ra.Vars() {
s, err := ra.findVarValueFromResources(v)
if err != nil {
return nil, err
}
result[v.Name] = s
}
return result, nil
}
func (ra *ResAccumulator) Transform(t resmap.Transformer) error {
return t.Transform(ra.resMap)
}
func (ra *ResAccumulator) ResolveVars() error {
replacementMap, err := ra.makeVarReplacementMap()
if err != nil {
return err
}
if len(replacementMap) == 0 {
return nil
}
t := newRefVarTransformer(
replacementMap, ra.tConfig.VarReference)
err = ra.Transform(t)
if len(t.UnusedVars()) > 0 {
log.Printf(
"well-defined vars that were never replaced: %s\n",
strings.Join(t.UnusedVars(), ","))
}
return err
}
func (ra *ResAccumulator) FixBackReferences() (err error) {
if ra.tConfig.NameReference == nil {
return nil
}
return ra.Transform(newNameReferenceTransformer(
ra.tConfig.NameReference))
}

Some files were not shown because too many files have changed in this diff Show More