Kishore Jagannath
772fafa892
Rename Orgrepo and Path ( #4922 )
...
* initial changes to rename OrgRepo to RepoPath
* changes to rename Path to KustRootPath
* addressed review comments
* addressed review comments
* docs: Add documentation for namespace transformer
Add a short description of the namespace transformer and example
usage to examples/transformerconfigs/README.md.
References: #629
Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com >
* Localize patchesJson6902, patchesStrategicMerge, replacements (#4904 )
* Localize patchesJson6902, patchesStrategicMerge, replacements
* Address code review feedback
* Improve readability
* Remove deprecation warning check
* Load legacy kustomization fields for `localize` (#4918 )
* Load legacy kustomization
* Expose loadKustFile in kusttarget
* remove FixKustomizationPreUnmarshalling
* remove deprecated cfg and fn commands (#4930 )
* remove deprecated cfg and fn commands
* fix lint error
* run gofmt
* Localize PatchTransformer, PatchJson6902Transformer (#4920 )
* Localize patches, patchesJson6902 custom transformers
* Improve readability
* Localize fields: openapi, configurations, crds (#4907 )
* Localize openapi, configurations, crds
* Add integration test
* Move krusty test
* Address code review feedback
* Implement locRootPath (#4909 )
* Implement locRootPath, and include userinfo, port in locFilePath
* Strip userinfo, port
* Improve readability
* Localize legacy fields
* Localize resources (#4912 )
* Localize resources
* Improve readability
* Add integration tests
* Group test helper functions
* Remove Functionality that Pulls Env Variables from Empty Keys
* Update api/kv/kv.go
Co-authored-by: Katrina Verey <kn.verey@gmail.com >
* refactor Unmarshal Kustomization struct code
* improve error messages
* Run go mod tidy on all modules before update
* Update sigs.k8s.io/yaml to 1.3.0
* fixed test failure because of latest commits
Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com >
Co-authored-by: Lars Kellogg-Stedman <lars@oddbit.com >
Co-authored-by: Anna Song <annasong@google.com >
Co-authored-by: yugo kobayashi <kobdotsh@gmail.com >
Co-authored-by: Natasha Sarkar <natashasarkar@google.com >
Co-authored-by: Cailyn Edwards <cailyn.edwards@shopify.com >
Co-authored-by: Cailyn <cailyn.s.e@gmail.com >
Co-authored-by: Katrina Verey <kn.verey@gmail.com >
Co-authored-by: Katrina Verey <katrina.verey@shopify.com >
2023-01-09 08:45:29 -08:00
Kubernetes Prow Robot
c6ca3ff799
Merge pull request #4929 from koba1t/refactor/cleanup_Unmarshal_kustomization
...
Error on duplicate fields in Kustomization
2023-01-06 10:37:59 -08:00
koba1t
6489e35b7c
improve error messages
2023-01-07 03:30:16 +09:00
Anna Song
06da3b96a2
Localize resources ( #4912 )
...
* Localize resources
* Improve readability
* Add integration tests
* Group test helper functions
2023-01-05 08:47:59 -08:00
Anna Song
3022dd2931
Localize legacy fields
2022-12-22 17:21:16 -05:00
Anna Song
aec35009ed
Implement locRootPath ( #4909 )
...
* Implement locRootPath, and include userinfo, port in locFilePath
* Strip userinfo, port
* Improve readability
2022-12-22 12:15:26 -08:00
Anna Song
de6162625f
Localize fields: openapi, configurations, crds ( #4907 )
...
* Localize openapi, configurations, crds
* Add integration test
* Move krusty test
* Address code review feedback
2022-12-22 12:07:26 -08:00
Anna Song
a1bfab382a
Localize PatchTransformer, PatchJson6902Transformer ( #4920 )
...
* Localize patches, patchesJson6902 custom transformers
* Improve readability
2022-12-16 09:52:17 -08:00
yugo kobayashi
5fed0f76c8
refactor Unmarshal Kustomization struct code
2022-12-13 21:04:50 +00:00
yugo kobayashi
faddb49c89
remove FixKustomizationPreUnmarshalling
2022-12-13 18:50:25 +00:00
Anna Song
4cccb838ce
Load legacy kustomization fields for localize ( #4918 )
...
* Load legacy kustomization
* Expose loadKustFile in kusttarget
2022-12-13 08:19:34 -08:00
Anna Song
292d18983d
Localize patchesJson6902, patchesStrategicMerge, replacements ( #4904 )
...
* Localize patchesJson6902, patchesStrategicMerge, replacements
* Address code review feedback
* Improve readability
* Remove deprecation warning check
2022-12-12 10:41:33 -08:00
Christopher Fry
8a6602db94
Allow name suffix transformer configuration to be overridden
2022-12-08 20:10:05 +00:00
Natasha Sarkar
2db573b6a0
drop support for legacy patches ( #4911 )
...
* drop support for legacy patches
* fix CI
2022-12-07 18:06:24 -08:00
Kubernetes Prow Robot
8a869f6045
Merge pull request #4882 from ChristopherFry/cfry/user-config-priority
...
Add test ensuring user configuration overrides default configuration
2022-12-06 22:46:38 -08:00
Christopher Fry
570865baae
Address peer review
2022-12-05 23:06:50 +00:00
Anna Song
71eb865cea
Localize configMapGenerator, secretGenerator fields ( #4894 )
...
* Localize configMapGenerator, secretGenerator fields
* Improve readability
* Expose kv parseFileSource
* Add localizeGenerator to Localizer
* Improve and test ParseFileSource error messages
2022-12-02 15:31:53 -08:00
Yannis Zarkadas
a502717460
Make ordering configurable ( #4019 )
...
* api: Add new types for customizeable resource ordering
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com >
* plugins: Implement SortOrderTransformer plugin
Implement the SortOrderTransformer plugin. This plugin allows the user
to customize the order that kustomize will output resources in.
The API for the plugin is the following:
sortOptions:
order: legacy | fifo
legacySortOptions:
orderFirst:
- {GVK}
orderLast:
- {GVK}
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com >
* plugins: Add boilerplate and generate code for new SortOrderTransformer
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com >
* build: Add option to denote if the reorder flag was set by the user
We want to take different actions if the reorder flag was set by the
user or filled by the default value. Thus, we propagate this information
from build to the krusty options.
Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com >
* api/krusty: Ensure sort ordering works with CLI flag and kustomization
Sort order can be defined in two places:
- (new) kustomization file
- (old) CLI flag
We want the kustomization file to take precedence over the CLI flag.
Eventually, we may want to move away from having a CLI flag altogether:
https://github.com/kubernetes-sigs/kustomize/issues/3947
Case 1: Sort order set in kustomization file AND in CLI flag.
Print a warning and let the kustomization file take precedence.
Case 2: Sort order set in CLI flag only or not at all.
Follow the CLI flag (defaults to legacy) and reorder at the end.
Case 3: Sort order set in kustomization file only.
Simply build the kustomization.
Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com >
* krusty: Add e2e test for SortOrderTransformer
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com >
* plugins: Purge LegacyOrderTransformer
Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com >
* Update go.work.sum
Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com >
* review: Make review changes
Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com >
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com >
Signed-off-by: Yannis Zarkadas <yanniszark@gmail.com >
2022-12-02 13:59:53 -08:00
Kishore Jagannath
1e2e7bbc0b
Refactor 7 return values in parseGitUrl to RepoSpec(issue 4866, Task1) ( #4900 )
...
* initial commit to refactor 7 return values in parseGitUrl to RepoSpec
* fix review comments
2022-12-02 10:01:53 -08:00
Anna Song
e34d5b5608
Localize components ( #4867 )
2022-12-02 09:33:53 -08:00
Kubernetes Prow Robot
0f4f978956
Merge pull request #4895 from KnVerey/remove-local-last
...
Remove local-only resources at the last minute
2022-12-01 13:20:00 -08:00
Kubernetes Prow Robot
3c8db55f53
Merge pull request #4901 from annasong20/clean-localizer
...
Clean `localizer`
2022-12-01 11:21:54 -08:00
Anna Song
b8611cf0a9
Refactor localizer code
...
* encapsulate kusttarget params
* change dst to string
* ConfirmDir
2022-12-01 09:53:46 -08:00
Kubernetes Prow Robot
baf777c56e
Merge pull request #4893 from KnVerey/pluginator-linter-bug
...
Fix pluginator incompatibility with nolint lines
2022-11-30 08:32:55 -08:00
Katrina Verey
a612cd2b7e
Fix pluginator incompatibility with nolint lines
2022-11-30 11:22:10 -05:00
Katrina Verey
fb0f567b63
Remove local-only resources at the last minute
...
This allows name references to them to be correctly resolved
2022-11-29 19:05:16 -05:00
Kubernetes Prow Robot
f53d018302
Merge pull request #4885 from annasong20/contain-ldr-path
...
Contain `RepoSpec` path in repo
2022-11-29 14:35:08 -08:00
Anna Song
832b552076
Load built-in plugins for kustomize localize ( #4869 )
...
* Load and filter built-in plugins
* Improve readability
* Process plugins as resources instead of bytes
* Throw error for validators
* Differentiate generators, transformers processing
* Enable validators
* add wrapper error
* improve documentation
2022-11-28 13:23:42 -08:00
Anna Song
0eff094faf
Calculate localized path for remote file ( #4878 )
...
* Calculate localized path for remote file
* Add documentation
2022-11-28 09:36:06 -08:00
Anna Song
07063a2652
Prevent repoSpec path from exiting repo
2022-11-23 14:29:22 -08:00
Christopher Fry
0c4f863bc5
Add test ensuring user configuration overrides default configuration
2022-11-21 23:39:45 +00:00
Anna Song
314b8fbefa
Implement localizeFile() skeleton for patches ( #4865 )
...
* Implement localizeFile()
* Fix lint
* Address code review feedback
* Remove unnecessary String(), Error() with string formatters
* Remove processing of un-implemented methods
* Improve readability
* Remove unimplemented addLocalizeDir, hitsLocalizeDir
* Improve documentation
* Remove deprecated patchesJson6902 logic
2022-11-16 10:24:48 -08:00
Anna Song
f79e16b352
Improve localizer readability ( #4860 )
...
* Replace '%s' with %q
* Change ambiguous cli-"Arg" suffix in func arg names
* Remove repetitive "loc" in names
* Apply readability changes to localizer
* Fix comment
2022-11-16 08:42:49 -08:00
Kubernetes Prow Robot
b20e611413
Merge pull request #4723 from koba1t/emit_a_warning_when_deprecated_fields_are_used
...
Emit a warning on build when deprecated fields are used
2022-11-16 08:32:50 -08:00
Kubernetes Prow Robot
e638e408b0
Merge pull request #4802 from oscr/the-the
...
grammar: replace all occurrences of "the the" with "the"
2022-11-16 08:22:48 -08:00
Anna Song
84bd402cc0
Fix RepoSpec query extraction ( #4863 )
...
* Clean query processing
* Improve readability
* Remove redundant code
* Add comment
* Return path literal when not parsable
* Handle url.Parse() error in future
2022-11-14 09:38:41 -08:00
Anna Song
50e731a1d9
Implement localizer skeleton for kustomize localize ( #4859 )
...
* Add localizer outline
* Add localizer unit tests
* include previous change
* Add proper NewLocalizer, Localize unit tests
mock processKust
* Address code review feedback
* Make processKustFn public
* Remove mock testing
2022-11-10 09:24:54 -08:00
Anna Song
beb2825f82
Improve readability of ifc.Loader's Repo() method ( #4857 )
...
* Improve ldr Repo() method readability
* Change Repo() implementations and calls
* Improve readability of conditions in ldr.New()
* Fix details
2022-11-08 14:48:14 -08:00
yugo kobayashi
3e6ede9645
fix_failed_lint_on_master
2022-11-04 07:12:46 +00:00
sun min
f9d553689e
update dependencies of libs using go workspace mode
2022-11-02 13:44:23 +08:00
Ahmed AbouZaid
3e447da6ef
proposal v2.1
2022-10-22 03:16:41 +02:00
Ahmed AbouZaid
ea21b37d67
proposal v2
2022-10-22 03:16:41 +02:00
Ahmed AbouZaid
d29febecb7
Fix krm exec function working dir
2022-10-22 03:16:41 +02:00
Kubernetes Prow Robot
bf7a0f9004
Merge pull request #4805 from aibarbetta/fix-4717
...
[address #4717 ] Re-do create template/metadata when using includeTemplates if not present
2022-10-11 09:23:02 -07:00
Agustina Barbetta
d14dfb604c
Use WrapPrefixf
2022-10-08 20:37:24 -03:00
Lars Kellogg-Stedman
38da7ca15c
Add support for helm --no-hooks flag
...
This commit adds the `skipHooks` option to the helm chart support in order
to expose the --no-hooks flag introduced to Helm in [1].
Using Kustomize to inflate a Helm chart would in some situations result in
different results than using `helm install`. This is because `helm
template`, by default, will render chart tests in the `templates/test`
directory, which can lead to undesired resources in the output.
See [2] for additional discussion.
[1]: https://github.com/helm/helm/pull/6444
[2]: https://github.com/helm/helm/issues/6443
Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com >
2022-10-07 17:14:06 -04:00
Ed Overton
d37fabf876
convert PrevIds to use apiVersion instead meta
...
Since PrevIds uses only the apiVersion information from the metadata,
change the retrieval from the full meta to just the apiVersion.
2022-09-27 14:03:59 -04:00
Agustina Barbetta
eb1529b516
use %w to format errors
2022-09-25 09:19:31 -03:00
Agustina Barbetta
c750c0089d
use fmt instead of errors
2022-09-25 09:07:47 -03:00
Agustina Barbetta
2b9ef61f88
error wraps for linter
2022-09-23 18:30:00 -03:00