Commit Graph

73 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
Niklas Wagner
75839a81b3 fix: namespace is not correctly propagate with nested kustomization files 2025-08-12 22:46:22 +02:00
Niklas Wagner
9376a5c4b7 Propagate Namespace correctly to Helm 2025-07-08 19:24:46 +02:00
Kubernetes Prow Robot
e3a7615ccb Merge pull request #5506 from cloud-native-team/master
fix some comments
2024-06-18 12:37:52 -07:00
Colin O'Dell
88c89f422a fix: always show accumulation errors (#5693)
* fix: always show accumulation errors if the resource was successfully loaded as a base

* chore: regression test

* chore: fix lint violations
2024-05-24 20:13:10 -07:00
Ed Overton
f80650e8ce fix: improve accumulation failure message
For accumulation errors when the file load fails due to malformed
YAML and the base load fails due to a timeout, report both errors.
Previously only the malformed YAML error was returned, masking the
git repo timeout.
2024-02-16 12:47:02 -05:00
cui fliter
d56e1d0f46 fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-01-05 16:25:48 +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
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
koba1t
2c2b2ab825 add check that kustomization is empty 2023-04-06 05:32:08 +09:00
Cailyn
8ab4b8d167 remove direct dependency on github/pkg/errors (#4970) 2023-01-13 10:52:25 -08: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
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
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
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
yugo kobayashi
21ee7f7125 Emit a warning when deprecated fields are used 2022-09-01 23:02:50 +00:00
Natasha Sarkar
8868d91670 Revert "Load and calculate Destination of files for kustomize localize (#4652)"
This reverts commit bf17fe1d8f.
2022-08-26 13:26:23 -05:00
Anna Song
bf17fe1d8f Load and calculate Destination of files for kustomize localize (#4652)
* Implement file localization for localize

Implement file localization for new command kustomize localize

* Patch file localization

Fix lint errors, address feedback, begin transition to file loader from
localizer

* Add Repo() to Loader

* Implement locLoader factory + cleanup

* Add domain to RepoSpec

Fix ssh relative url host parsing for non-github domain on the side

* Implement Load(), New(), Root(), Dst() for LocLoader

* Address repospec code review comments

* Address 1st round of code review feedback

* Address feedback #2

Removed localized path calculations to cover edge case and improve readability.

* Remove ldr Cleanup logging

* Address code review round #3

* Address code review feedback #4
2022-08-19 14:33:53 -07:00
Anna Song
d1102fb726 Move demandDirectoryRoot into kyaml/filesys (#4677)
* Move demandDirectoryRoot into kyaml/filesys

* Make root directory platform-agnostic

Support windows root directory. Dogfood own error package.

* Use cleaner windows support implementation

* Address feedback

* Address feedback x2

* Re-apply go.sum changes to avoid CI errors
2022-06-30 11:12:07 -07:00
Kubernetes Prow Robot
d3d92157fa Merge pull request #4567 from mvgmb/master
Add support for remote OpenAPI schema
2022-05-10 11:01:43 -07:00
Mohd Bilal
66e4e1582b fix kustomize 4.5.3+ breaking remote resources (4559) 2022-04-23 06:25:24 +00:00
Mário Bezerra
94af647556 Add support for remote OpenAPI schema 2022-04-19 23:58:04 -03:00
Jennifer Cwagenberg
7888aef305 Raise error for external generators or transformers (#4565)
* Raise error if duplicate orgids for external transformers or external generators are configured

* Remove output of resources in error message

* Remove trailing newline
2022-04-06 15:46:25 -07:00
Mohd Bilal
6dabba1d23 misspell corrected 2022-02-27 07:47:59 +00:00
Mohd Bilal
bd05631887 Error type MalformedYamlError created. api.internal.target.kusttarget.accumulateResources checks for this new error type 2022-02-27 07:21:16 +00:00
Natasha Sarkar
bcebad1664 new command kustomize edit add buildmetadata (#4413)
* new command kustomize edit add buildmetadata

* new commands kustomize edit set buildmetadata and kustomize edit remove buildmetadata
2022-01-26 15:34:50 -08:00
natasha41575
9577d61167 move origin to be an attribute of KustTarget 2022-01-19 17:26:19 -08:00
natasha41575
2c23b960ff set transformer annotation when the option is specified 2022-01-19 17:17:47 -08:00
Kubernetes Prow Robot
13e26004fd Merge pull request #4357 from natasha41575/TransformerAnnotations
define methods, types, and unit tests for transformer annotations
2022-01-10 15:32:28 -08:00
Kubernetes Prow Robot
59c8268245 Merge pull request #4334 from sylr/handle-http-errors
Handle HTTP error codes in file loader
2021-12-30 16:18:51 -08:00
natasha41575
4f21d60045 helper methods, types, and unit tests for transformer annotations 2021-12-29 15:27:34 -08:00
Natasha Sarkar
964bb38ba2 add origin annotation for resources generated by generators (#4341)
* add origin annotation for resources generated by builtin and custom generators

* decouple origin data from generator data and account for inline generators
2021-12-23 10:40:29 -08:00
natasha41575
a8f58b4080 collect origin data only when the option is set 2021-12-13 11:38:03 -08:00
Sylvain Rabot
738573b079 Error on HTTP resources are not nescessarly protocol related
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-12-10 09:27:37 +01:00
Sylvain Rabot
e65e571ed1 Do not try to load HTTP resources from FS when error occurs
It is useless and it clogs the error message.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-12-08 18:24:29 +01:00
Yuwen Ma
a1c5d79d94 Move api/builtin to internal 2021-11-22 15:54:18 -08:00
Yuwen Ma
f4382738ab [fix 4124] Skip local resource until all transformations have completed.
Resources annotated as "local-config" are expected to be ignored. This skip local resource happens in "accumulateResources" which happens before any transformation operations.
However, the local resource may be needed in transformations.
Thus, this change removes the "drop local resource" logic from accumulateResources and removes these local resource after all transformation operations and var operations are done.

Note:
None of the existing ResMap functions can drop the resource slice easily: "Clear" will ruin the resource order, "AppendAll" only adds non-existing resource, "AbsorbAll" only add or modify but not delete.
Thus, we introduce a new func "Intersection" for resourceAccumulator that specificaly removes the resource by ID and keep the original order.
2021-09-16 11:15:05 -07:00
Natasha Sarkar
1e1b9b484a exec function working dir is the kustomization that referenced it (#4125)
* exec function working dir is the kustomization that referenced it

* suggested changes

* more code review

* use a field instead of an annotation

* more code review
2021-08-19 20:15:24 -07:00
Natasha Sarkar
3350c7213c option for origin data as annotation 2021-08-12 20:09:41 -07:00
monopole
5c4e363f11 Remove delegation to RNode in Resource. 2021-05-11 10:49:17 -07:00
monopole
aa5b4814d6 upgrade to helm 3.5.4 and imdario/mergo v0.3.12 2021-04-09 15:05:41 -07:00
Natasha Sarkar
7dd0ade0f9 add openapi/path field to use custom openapi schema document 2021-02-19 14:19:22 -08:00
monopole
e33addc16b Drop hashicorp multierror due to MPL 2021-02-11 12:24:22 -08:00
Natasha Sarkar
866dbf2017 added an openapi field to the kustomization file 2021-01-22 16:06:57 -08:00
Donny Xia
abc88c56c4 support inline transformer and generator 2020-11-12 15:19:14 -08:00
Donny Xia
94d26ba53a improve the readability for multiple errors 2020-11-06 15:16:48 -08:00
jregan
1d91401772 Simplify use of the Merginator. 2020-08-22 08:07:57 -07:00
jregan
edced4b3f6 Delete newly orphaned code. 2020-08-20 13:12:06 -07:00