Stephen Kitt
bcf100f592
Use canonical json-patch v4 import
...
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).
Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).
Signed-off-by: Stephen Kitt <skitt@redhat.com >
2024-02-16 12:23:04 +01:00
Krzysztof Gibuła
d73f0fd097
add test for values merge replace
2024-01-29 22:06:36 +01:00
Krzysztof Gibuła
bf286dce76
wrap errors and add comments
2024-01-29 22:06:36 +01:00
Krzysztof Gibuła
d768fc371c
replace mergo with kyaml/yaml/merge2
2024-01-29 22:06:36 +01:00
Stephen Kitt
bf485f66d3
Revert "Switch to json-patch v5"
...
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 >
2023-12-07 18:40:29 +01:00
koba1t
8eee90d2c6
Back to development mode; unpin the modules
2023-12-07 19:56:35 +09:00
koba1t
c259c478e5
Update api to v0.16.0
2023-12-07 19:30:36 +09:00
koba1t
71f6f4c7d7
Update kyaml to v0.16.0
2023-12-07 19:00:00 +09:00
Kubernetes Prow Robot
eb7f91ffcd
Merge pull request #5270 from MrFreezeex/helm-kube-api
...
helm: add support for kube-version and add cli args for both kube-version and api-versions
2023-11-15 21:13:59 +01:00
Kubernetes Prow Robot
e219b8864e
Merge pull request #5421 from prashantrewar/swap-yaml-library
...
Replace gopkg.in/yaml.v2 with sigs.k8s.io/yaml/goyaml.v2
2023-11-10 17:14:41 +01:00
Arthur Outhenin-Chalandre
790ca0e7b6
helm: add kube-version and api-versions on CLI args
...
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 >
2023-11-02 16:46:41 +01:00
Ardika Bagus
6640f8799e
test: add Kustomize test case for multiple helm charts with different version
...
Signed-off-by: Ardika Bagus <me@ardikabs.com >
2023-11-02 06:27:39 +07:00
Ardika Bagus
790dbf0fdf
chore: rename chart and test case with clear intention
2023-11-02 06:23:50 +07:00
Ardika Bagus
b7b85b10fc
chore: remove unnecessary code, and using testdata instead of inline
...
Signed-off-by: Ardika Bagus <me@ardikabs.com >
2023-11-02 06:23:50 +07:00
Ardika Bagus
5505af439a
chore: fix lint, assert with required
2023-11-02 06:22:11 +07:00
Ardika Bagus
cc35d3c4e5
fix: fix while using local charts with version
...
fix https://github.com/kubernetes-sigs/kustomize/issues/5163
Signed-off-by: Ardika Bagus <me@ardikabs.com >
2023-11-02 06:22:11 +07:00
Dustin Lish
a0f131cf86
Fix using same helm chart with different versions ( #4999 )
...
* 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
2023-11-02 06:22:11 +07:00
Prashant Rewar
2ab117166f
replace gopkg.in/yaml.v2 with sigs.k8s.io/yaml/goyaml.v2
...
Signed-off-by: Prashant Rewar <108176843+prashantrewar@users.noreply.github.com >
2023-11-01 14:40:41 +05:30
Carl Henrik Lunde
5c7f8b8d73
perf: improve applyOrdering by avoid call to GetByCurrentId
...
This shaves of 14 seconds (one third) of the execution time for a
kustomization tree with 4000 documents, from 40.68s to 27.41s
0 0% 5.44% 18.42s 40.56% sigs.k8s.io/kustomize/api/krusty.(*Kustomizer).applySortOrder
0 0% 5.44% 18.40s 40.52% sigs.k8s.io/kustomize/api/internal/builtins.applyOrdering
before
(pprof) top20 -cum
Showing nodes accounting for 5.85s, 12.88% of 45.41s total
Dropped 622 nodes (cum <= 0.23s)
Showing top 20 nodes out of 157
flat flat% sum% cum cum%
0 0% 0% 40.68s 89.58% github.com/spf13/cobra.(*Command).Execute
0 0% 0% 40.68s 89.58% github.com/spf13/cobra.(*Command).ExecuteC
0 0% 0% 40.68s 89.58% github.com/spf13/cobra.(*Command).execute
0 0% 0% 40.68s 89.58% main.main
0 0% 0% 40.68s 89.58% runtime.main
0 0% 0% 40.68s 89.58% sigs.k8s.io/kustomize/kustomize/v5/commands/build.NewCmdBuild.func1
0 0% 0% 40.12s 88.35% sigs.k8s.io/kustomize/api/krusty.(*Kustomizer).Run
0.51s 1.12% 1.12% 33.20s 73.11% sigs.k8s.io/kustomize/api/resource.(*Resource).CurId
0 0% 1.12% 26.95s 59.35% sigs.k8s.io/kustomize/api/resmap.(*resWrangler).GetMatchingResourcesByCurrentId
0.35s 0.77% 1.89% 26.95s 59.35% sigs.k8s.io/kustomize/api/resmap.(*resWrangler).filteredById
0.07s 0.15% 2.05% 25.53s 56.22% sigs.k8s.io/kustomize/api/resmap.GetCurrentId
0 0% 2.05% 21.68s 47.74% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).MakeCustomizedResMap (inline)
0 0% 2.05% 21.68s 47.74% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).makeCustomizedResMap
0.54s 1.19% 3.24% 19.75s 43.49% sigs.k8s.io/kustomize/api/resource.(*Resource).GetGvk (inline)
1s 2.20% 5.44% 19.21s 42.30% sigs.k8s.io/kustomize/kyaml/resid.GvkFromNode
0 0% 5.44% 18.42s 40.56% sigs.k8s.io/kustomize/api/internal/builtins.(*SortOrderTransformerPlugin).Transform
0 0% 5.44% 18.42s 40.56% sigs.k8s.io/kustomize/api/krusty.(*Kustomizer).applySortOrder
0 0% 5.44% 18.40s 40.52% sigs.k8s.io/kustomize/api/internal/builtins.applyOrdering
0.87s 1.92% 7.36% 16.55s 36.45% sigs.k8s.io/kustomize/kyaml/yaml.visitMappingNodeFields
2.51s 5.53% 12.88% 15.68s 34.53% sigs.k8s.io/kustomize/kyaml/yaml.visitFieldsWhileTrue
after
(pprof) top20 -cum
Showing nodes accounting for 1.23s, 3.85% of 31.98s total
Dropped 584 nodes (cum <= 0.16s)
Showing top 20 nodes out of 184
flat flat% sum% cum cum%
0 0% 0% 27.41s 85.71% github.com/spf13/cobra.(*Command).Execute
0 0% 0% 27.41s 85.71% github.com/spf13/cobra.(*Command).ExecuteC
0 0% 0% 27.41s 85.71% github.com/spf13/cobra.(*Command).execute
0 0% 0% 27.41s 85.71% main.main
0 0% 0% 27.41s 85.71% runtime.main
0 0% 0% 27.41s 85.71% sigs.k8s.io/kustomize/kustomize/v5/commands/build.NewCmdBuild.func1
0 0% 0% 26.85s 83.96% sigs.k8s.io/kustomize/api/krusty.(*Kustomizer).Run
0 0% 0% 22.07s 69.01% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).MakeCustomizedResMap (inline)
0 0% 0% 22.07s 69.01% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).makeCustomizedResMap
0.38s 1.19% 1.19% 20.69s 64.70% sigs.k8s.io/kustomize/api/resource.(*Resource).CurId
0 0% 1.19% 13.64s 42.65% sigs.k8s.io/kustomize/api/resmap.(*resWrangler).Append
0 0% 1.19% 13.55s 42.37% sigs.k8s.io/kustomize/api/resmap.(*resWrangler).GetMatchingResourcesByCurrentId (inline)
0.12s 0.38% 1.56% 13.55s 42.37% sigs.k8s.io/kustomize/api/resmap.(*resWrangler).filteredById
0.01s 0.031% 1.59% 12.67s 39.62% sigs.k8s.io/kustomize/api/resmap.GetCurrentId
0.21s 0.66% 2.25% 12.49s 39.06% sigs.k8s.io/kustomize/api/resource.(*Resource).GetGvk (inline)
0.51s 1.59% 3.85% 12.28s 38.40% sigs.k8s.io/kustomize/kyaml/resid.GvkFromNode
0 0% 3.85% 11.52s 36.02% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).IgnoreLocal
0 0% 3.85% 10.53s 32.93% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).AccumulateTarget
0 0% 3.85% 10.53s 32.93% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).accumulateResources
0 0% 3.85% 10.53s 32.93% sigs.k8s.io/kustomize/api/internal/target.(*KustTarget).accumulateTarget
2023-10-30 22:31:52 +01:00
Sylvain Rabot
b1f100e3da
Run go work sync and go mod tidy
...
```shell
go work sync
for i in $(find . -name go.mod); do (cd $(dirname $i); go mod tidy); done
```
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr >
2023-10-28 13:05:11 +02:00
Natasha Sarkar
96ad106ee1
Use upstream go-yaml fork and remove our internal one ( #5412 )
...
* test new yaml fork
* delete old kyaml fork
* update to sigs yaml 1.4.0
* remove comments
2023-10-25 19:48:22 +02:00
koba1t
0465637335
Back to development mode; unpin the modules
2023-10-20 05:30:43 +09:00
koba1t
16395012d1
Update api to v0.15.0
2023-10-20 02:36:50 +09:00
koba1t
8668b74622
Update kyaml to v0.15.0
2023-10-20 01:07:49 +09:00
Jan-Otto Kröpke
d64ac13447
kustomize: Add support for OCI based helm repos ( #5167 )
...
* kustomize: Add support for OCI based helm repos
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de >
* Update api/internal/builtins/HelmChartInflationGenerator.go
* Update plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go
* go fmt
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de >
* s/expectedHelmExternalDns/expectedHelmExternalDNS
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de >
* commit
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de >
* commit with content
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de >
* Apply suggestions from maintainer
* go work sync
* added test
---------
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de >
2023-10-17 21:24:00 +02:00
Kazuki Suda
f5ca753377
Update imdario/mergo to v0.3.13
...
Co-authored-by: Krzysztof Gibuła <krzysztof.gibula@gmail.com >
Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com >
2023-09-24 16:34:45 +09:00
Kazuki Suda
0d4849ff98
Add a test case for issue 4905
...
```
===== ACTUAL BEGIN ========================================
apiVersion: v1
data:
config.yaml: "null"
kind: ConfigMap
metadata:
name: issue4905
===== ACTUAL END ==========================================
EXPECTED ACTUAL
-------- ------
apiVersion: v1 apiVersion: v1
data: data:
X config.yaml: |- config.yaml: "null"
X item1: 1 kind: ConfigMap
X item2: 2 metadata:
X kind: ConfigMap name: issue4905
X metadata:
X name: issue4905
hasgett.go:22: Expected not equal to actual
--- FAIL: TestHelmChartInflationGeneratorIssue4905 (0.24s)
```
Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com >
2023-09-24 16:33:43 +09:00
yugo kobayashi
59696d1ace
fix a patch files accept multiple patches ( #5194 )
...
* 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
2023-09-15 16:20:13 -07:00
Stephen Kitt
b692e49b1e
Switch to json-patch v5
...
json-patch was bumped to v5 in k/k as a result of
https://github.com/kubernetes/kubernetes/pull/118384 ; this aligns with
that, but switches to the v5 module, which is documented as
gopkg.in/evanphx/json-patch.v5.
Signed-off-by: Stephen Kitt <skitt@redhat.com >
2023-08-26 08:42:07 +02:00
natasha41575
ff75dd6cd5
release cleanup
2023-07-31 12:27:44 -05:00
natasha41575
5ce14e5024
pin to cmd/config and api
2023-07-31 11:28:25 -05:00
natasha41575
4a893ce8c6
pin to kyaml
2023-07-31 11:08:00 -05:00
natasha41575
eeff67d88d
unpin everything
2023-06-19 12:05:59 -05:00
natasha41575
5e7cc3437d
pintoapi
2023-06-19 11:35:33 -05:00
natasha41575
8c0e0b3b47
pin to kyaml
2023-06-19 10:45:18 -05:00
koba1t
d1647a51af
fix e2econtainer test
2023-06-07 02:19:55 +09:00
koba1t
5b76aa9d2f
update go 1.20
2023-06-06 22:39:06 +09:00
Jefftree
7c98e531f2
make test-go-mod
2023-05-31 19:54:13 +00:00
natasha41575
fd508f0e3a
release cleanup
2023-05-17 10:41:37 -05:00
natasha41575
84642b1fed
pin to api v0.13.4
2023-05-09 14:48:02 -05:00
natasha41575
4b807107a6
pin to kyaml and cmd/config released versions
2023-05-09 14:27:34 -05:00
Natasha Sarkar
3d6f40bd5e
Revert "Fix using same helm chart with different versions ( #4999 )"
...
This reverts commit 0f244a4a07 .
2023-05-09 13:16:22 -05:00
natasha41575
529a25d30b
unpin everything
2023-05-05 15:38:19 -05:00
natasha41575
7dcb2a50ff
pin to api 0.13.3
2023-05-05 15:12:27 -05:00
natasha41575
1f98338481
pin to kyaml v0.14.2
2023-05-05 14:32:02 -05:00
Dustin Lish
0f244a4a07
Fix using same helm chart with different versions ( #4999 )
...
* 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
2023-04-24 15:09:02 -07:00
Yutaro
42bf3c0e2b
prevent all uses of YAML aliases from being overwritten by a transformer ( #5096 )
...
* return copied Node
* add a test case about imageTagTransformer for anchor scenario
* add TestPatchTransformerAnchor
* TestReplacementTransformerAnchor
2023-03-31 16:07:50 -07:00
Kubernetes Prow Robot
5dff9df1f7
Merge pull request #5099 from justinsb/dont_swallow_helm_errors
...
Don't swallow helm execution errors
2023-03-20 12:35:09 -07:00
justinsb
c151147258
Don't swallow helm execution errors
...
These are otherwise hard to debug.
2023-03-20 19:14:07 +00:00
justinsb
317fcadccb
Fix unused error value
...
The linter was complaining about err being unchecked.
2023-03-20 19:11:11 +00:00