Commit Graph

436 Commits

Author SHA1 Message Date
Niklas Wagner
278dd6e55d fix: performance recession when propagating namespace to helm (#5971)
* fix: performance recession when propagating namespace to helm

* fix: handle passing namespace downstream more elegant

* Revert "fix: handle passing namespace downstream more elegant"

This reverts commit 976a7cf2aa.

* Revert "fix: performance recession when propagating namespace to helm"

This reverts commit c7612d1dba.

* fix: use annotation to identify helm chart generated resources

* fix: deduplicate code

* fix: missing import in NamespaceTransformer.go

* ci: allow manual trigger of pipeline in fork

* Revert "ci: allow manual trigger of pipeline in fork"

This reverts commit 8948788fe2.

* fix: test cases

* chore: fix code comment was on wrong line

* chore: fix code comment was on wrong line pt2
2025-09-29 14:08:19 -07:00
Kubernetes Prow Robot
1c0f1bf5ac Merge pull request #5940 from Skaronator/propagate-namespaces
fix: Propagate Namespace correctly to Helm
2025-08-21 04:07:05 -07:00
yugo kobayashi
87d0629bd1 update go 1.24.6 (#5959)
* update go 1.24.6

* fix non-constant format string error

* update golang.org/x/tools@v0.36.0 and github.com/golangci/golangci-lint@v1.64.8 to pass execute golangci-lint

* add a verpose diff output to prow test

* remove pluginator binary version from generated files
2025-08-17 13:05:12 -07:00
Niklas Wagner
75839a81b3 fix: namespace is not correctly propagate with nested kustomization files 2025-08-12 22:46:22 +02:00
zepard
7c04cbb237 Add regex support for Replacement selectors (#5863)
* feat: Add regex support for Replacement selectors

* Add new tests for regex support

* Earlier exit with rejectAny, and fix linting

* Add example Use cases using regex
2025-08-12 11:13:08 -07:00
Niklas Wagner
9376a5c4b7 Propagate Namespace correctly to Helm 2025-07-08 19:24:46 +02:00
Kubernetes Prow Robot
b7340bd369 Merge pull request #5882 from arthurbdiniz/set-git-messages-to-english-for-TestRemoteLoad_LocalProtocol
Set Git messages to English for TestRemoteLoad_LocalProtocol
2025-05-23 01:22:36 -07:00
Timur Demin
dd08aec23e fix: Don't panic on multiple $patch: delete strategic merge patches in a single patch file (#5859)
* chore: add test for multiple $patch: delete patches not panicking

* fix: don't panic on multiple deletion SM patches
2025-03-28 06:04:40 -07:00
Arthur Diniz
e683487ea8 Set Git messages to English for TestRemoteLoad_LocalProtocol
Ensure consistent error message matching by setting LC_ALL=C in
TestRemoteLoad_LocalProtocol, preventing locale-based variations
in Git output.

Signed-off-by: Arthur Diniz <arthurbdiniz@gmail.com>
2025-03-24 23:29:37 +00:00
isarns
a5f43ec75a style: linting 2024-09-09 13:26:53 +03:00
isarns
bbb0b08576 test: add empty list test 2024-08-18 14:56:54 +03:00
isarns
77daec89b8 refactor: inlineAnyEmbeddedLists 2024-08-13 14:35:46 +03:00
isarns
a1fd6efe5d feat: annotation to disable list conversion 2024-08-11 17:44:44 +03:00
Mauren Berti
3065eb36dd fix(namereference): add configuration for new admission API
Include configuration for the new `ValidatingAdmissionPolicy` and
`ValidationAdmissionPolicyBinding` APIs so that Kustomize can natively configure
the `policyName` field in `ValidatingAdmissionPolicyBinding` with the transformed
name of `ValidatingAdmissionPolicy`.
2024-05-19 20:58:03 -04:00
Kubernetes Prow Robot
e676d056b2 Merge pull request #5500 from charles-chenzz/kust-target-tc
add testcase that check yield malformed yaml errors
2024-04-28 23:45:18 -07:00
Mauren
671de1662d feat: support labels key in transformer configuration (#5556)
* feat: support labels key in transformer configuration

Allow the usage of a separate transformer configuration for the labels key,
similar to what is currently available for commonLabels and commonAnnotations.
This aims to provide the same functionality that commonLabels currently provide
for labels, since commonLabels is deprecated and slated for removal in a future
release.

* chore(transformerconfig): add nolint hint

Add a nolint hint to the new method so the returns can stay consistent with
one another.

* fix: changes from code review

* Rename methods `AddCommonLabelFieldSpec` and `AddLabelFieldSpec` to
  `AddCommonLabelsFieldSpec` and `AddLabelsFieldSpec`.
* Add extra test to verify scenarios applying labels to Custom Resource Definitions.
2024-04-25 00:40:44 -07:00
Jonathan King
b3d1df2644 Fix name in a configMapRef missing hash #5047 (#5236)
* Add regression tests

* Update PrefixesSuffixesEquals function

* Try empty prefix/suffix but fall back on duplicates

* Run gofmt

* Remove newline

* Revert unnecessary gofmt change

* Add comment
2024-04-02 12:44:11 -07:00
Kubernetes Prow Robot
d7e60b8451 Merge pull request #5624 from karlkfi/karl-example-500
Use a local test server instead of example.com
2024-03-27 08:28:55 -07:00
Karl Isenberg
9db92fd28d Use a local test server instead of example.com 2024-03-21 13:14:12 -07:00
Karl Isenberg
43868688d5 Use require for Error and NoError
Assert keeps going after failure, but require immediately fails
the tests, making it easier to find the output related to the test
failure, rather than having to comb through a bunch of subsequent
assertion failures. For equality tests, we may or may not want to
continue, but for error checks we almost always want to immediately
fail the test. Exceptions can be changed as-needed.
2024-03-20 13:19:18 -07:00
koba1t
37715863f0 use Strict unmarshal when read TransformerConfig 2024-02-22 05:39:55 +09:00
charles-chenzz
3f921e159b add testcase that yield malformed yaml errors 2024-01-08 19:25:04 +08:00
Arthur Outhenin-Chalandre
dc29923a08 helm: add tests with different kubeVersion
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
2023-11-09 11:37:14 +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
koba1t
af7c088053 fix failed tests for fn framework mount generator 2023-11-02 02:37:00 +09:00
koba1t
7af4e772bd fix failed tests for fn framework generator 2023-11-02 02:37:00 +09:00
koba1t
67a0b43c81 fix failed tests for testing fn framework about get value from env 2023-11-02 02:37:00 +09:00
koba1t
2bff0d6882 fix failure tests that are running for external container image 2023-11-02 02:37:00 +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
charles-chenzz
60d7ee6710 add orgin back when clone repo (due to git submodule). 2023-10-07 07:50:13 +08:00
Varsha Prasad Narsing
7911b2c001 [refactor]: Internalize loader api
This PR intends to move the loader api to
internal. Only the necessary methods which
are needed for the api have been put into
`pkg/loader.go`.

Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
2023-09-28 10:49:45 -04: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
Jeong Jinwoo
9f1d5acdc8 fix: check both prev and current ids for filtering reject targets 2023-08-11 21:37:55 +09:00
Jeong Jinwoo
9756d92a91 test: demonstrate reject not working on targets with changed id 2023-08-11 21:37:07 +09:00
Kubernetes Prow Robot
cd7ba1744e Merge pull request #5189 from annasong20/test-relative-submodules
Add test for issue #5131
2023-07-12 10:03:13 -07:00
Anna Song
da4e881007 Add accumulateResources error tests for local files (#5225)
* Add accumulateResources error tests for local files.

Add tests demonstrating accumulateResources errors when the resource is
a local file. Works to address #4807.

* Improve readability
2023-07-01 11:46:49 -07:00
Anna Song
129d0f90af Add test for issue #5131 2023-06-14 18:32:12 +00:00
Anna Song
168e31bfb6 Add accumulateResources remote file error tests
Test accumulateResources errors when a remote file fails to load. This
is part of the effort to fix issue #4807.
2023-06-09 21:31:27 +00:00
koba1t
d1647a51af fix e2econtainer test 2023-06-07 02:19:55 +09:00
yugo kobayashi
0add0f95e2 change: components apply after all generators and transformers applied (#5170)
* change: components apply after all generator and transformer applied

* fix name for a test case

* add comment about when the components will be executed

* components are applied before transformer
2023-06-02 10:26:54 -07:00
Kubernetes Prow Robot
cf3e81b590 Merge pull request #4949 from koba1t/fix/add_check_kustomization_is_empty
add check that kustomization is empty
2023-05-26 10:36:53 -07:00
Tim Jacomb
7413c6a5fb Regression test 2023-04-18 09:41:28 +01:00
koba1t
2c2b2ab825 add check that kustomization is empty 2023-04-06 05:32:08 +09:00
Kubernetes Prow Robot
d3184da4c6 Merge pull request #5111 from yutaroyamanaka/reenable-skipped-tests
Re-enable tests disabled in #3880
2023-04-05 11:45:48 -07:00
yutaroyamanaka
2649d39fd3 docker build locally because gcr.io/kustomize-functions/e2econtainerconfig doesn't exist in the public 2023-04-04 18:22:43 +09:00
yutaroyamanaka
faab836ec9 use test helpers 2023-04-01 23:16:58 +09:00
yutaroyamanaka
c9f500cc0b add another resource for making sure an existing resource isn't affeced by a generator 2023-04-01 23:13:04 +09:00
Peter Lobsinger
633da991d2 Only strip surrounding quotes if there are at least two characters.
Otherwise, a value consisting of a single quote character triggers a
panic:

    go test krusty/configmaps_test.go
    --- FAIL: TestDataIsSingleQuote (0.00s)
    panic: runtime error: slice bounds out of range [1:0] [recovered]
    	panic: runtime error: slice bounds out of range [1:0]
2023-03-28 14:17:47 -07:00
yutaroyamanaka
71a7a7df13 re-enabled TestFnContainerGenerator with enable-gcp-services 2023-03-27 23:00:24 +09:00
yutaroyamanaka
436a047617 re-enabled TestFnContainerTransformer with e2econtainerconfig container 2023-03-27 21:33:57 +09:00