This reverts commit b692e49b1e.
The json-patch bump in k/k was reverted, so the corresponding bump in
kustomize should be reverted too.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
It makes sense to add that as a CLI args since you could use one single
kustomization file/helm chart for multiple clusters. Also it's easier to
have those on the CLI if the user has some kind of tooling that will end
up calling kustomize and that could pass those (i.e.: ArgoCD is doing
that for Helm so it could do that for Kustomize as well that will end up
calling Helm as well).
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
* Fix using same helm chart with different versions
* Fix p.ValuesFile when version is set
* Updated: Fix using same helm chart with different versions
* Add test for issue #4813
* Use if/else for readability, add version check to absChartHome
* fix a patch files accept multiple patches
* fix comments and variable name
* add error handling when using not allowed multiple strategic-merge patches
* fix error message of Multiple Strategic-Merge Patch file
* refactor transformStrategicMerge()
* add TODO comment and test for Multiple JSON patch Yaml documents are not allowed
* refactoring PatchTransformer
* add multiple patch test for PatchTransformer package
* improve error message to PatchTransformer
* refactor const and error message check
* fix some error messages
* Fix using same helm chart with different versions
* Fix p.ValuesFile when version is set
* Updated: Fix using same helm chart with different versions
* Add test for issue #4813
* Use if/else for readability, add version check to absChartHome
* support for more helm template args
* move templateArgs and unit tests to api/types
* undo package name change
* use our own simple helm chart instead of forking one
* add argument to AsHelmArgs
* code review
* lint errors
* 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>
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>
* add tagsuffix to take image tag suffix
* add comments to warn about specifications
* add test and error handle
* fix indent
* update comment
* fix merge errors and return updates
* update image update and fix example
* fix yamls formats
remove tabs in yamls
fix space in image name
tag error in name
* fix spacing issue
format of yaml
set example as above
* spacing of spec in testing templates
* change to switch case
* Refactor prefix filter into its own filter, decoupled from the prefixsuffix filter
* Refactor prefix transformer into its own transformer, decoupled from the prefixsuffix transformer
* Refactor suffix filter into its own filter, decoupled from the prefixsuffix filter
* Refactor suffix transformer into its own transformer, decoupled from the prefixsuffix transformer
* Add a default nameSuffix field spec in addition to the namePrefix
* Remove the PrefixSuffixTransformer from the list of builtin transformers
* Add a multi-transformer to builtinhelpers.TransformFactories
* Remove the implementation of the prefixsuffixtransformer.PrefixSuffixTransformer
* Resolve style and format related feedback from the pull request
* Add test to test the legacy PrefixSuffixTransformer for BC purposes