Commit Graph

460 Commits

Author SHA1 Message Date
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
Katrina Verey
a86723c3a3 Fix regression 4388 2022-02-02 12:36:03 -05: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
Natasha Sarkar
b0636459dd Revert "[fix] configMapGenerator: extra space in end of line gives "\n" instead of line breaks" 2022-01-12 09:30:41 -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
1c5ce6975f Merge pull request #4312 from m-Bilal/fix-4240
Fixes 4240; added null check on namespace when resource is a RoleBinding
2022-01-10 09:43:13 -08:00
m-Bilal
ff7b2f20d5 Throwing error instead of silently ignoring invalid input 2022-01-01 21:52:37 +05:30
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
Kubernetes Prow Robot
77b1af2d91 Merge pull request #4352 from natasha41575/FilterErrors
prevent internal annotations from showing up in the errors thrown by filters
2021-12-29 13:45:22 -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
c659306ee2 don't surface entire node content in error message 2021-12-22 16:56:02 -08:00
Kubernetes Prow Robot
233f1a3c2a Merge pull request #4344 from natasha41575/ResIdStr
improve gvk and resid strings for error messages
2021-12-22 12:27:03 -08:00
Julian
3dbc88bf94 Refactor the PrefixSuffixTransformer into separate prefix- and suffix transformers (#4318)
* 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
2021-12-22 12:01:06 -08:00
natasha41575
6dfc238aa2 improve gvk and resid strings for error messages 2021-12-22 11:39:07 -08:00
Kubernetes Prow Robot
c0b61b9442 Merge pull request #4332 from natasha41575/OriginCollection
collect origin data only when the option is set
2021-12-13 13:10:26 -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
natasha41575
a3d547ccd3 fix issue with multiline configmap data with extra space 2021-12-03 15:28:22 -08: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
Justin SB
6552b90657 Cache the OrgId for nameReferenceTransformer
Because this is in an inner loop and is fairly memory-allocation
expensive even on a single allocation, it comes up top-of-the-list in
memory allocation pprof profiles, for example with the coredns
ClusterAddon.

Add simple caching.
2021-09-07 14:06:38 -04: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
Natasha Sarkar
9a27a9f19f replace genargs with two separate annotations 2021-07-29 15:46:09 -07:00
Natasha Sarkar
91f74e8d16 replace Resource.options with annotations (#4061) 2021-07-23 18:19:05 -07:00
Kubernetes Prow Robot
259fcfcef8 Merge pull request #4002 from natasha41575/resref
replace Resource.refBy with annotations
2021-07-08 17:26:54 -07:00
Natasha Sarkar
a84badb834 replace Resource.refBy with annotations 2021-07-07 15:22:36 -07:00
Haibing Zhou
8c14b9d1af api/internal/git: handle .git suffix in repospec
This change adds a new test case for parsing url with `.git` suffix. In
that case, we should have the full url as clone spec with an empty
abspath.
2021-07-05 13:10:35 -07:00
Jeff Regan
936ac37a2e Update repospec_test.go 2021-06-21 14:30:11 -07:00
Francesc Campoy
7fae7d1bd6 Move api/filesys to kyaml/filesys (#3997)
* Move api/filesys to kyaml/filesys

* Add deprecated version of api/filesys with aliases to new code

* Use new kyaml/filesys package and update dependencies

* Migrate to kyaml/filesys and update dependencies

* Skip tests that break on Windows
2021-06-16 11:42:00 -07:00
Khris Richardson
727e24f365 append AsCurrentUser to FnPluginLoadingOptions 2021-06-15 12:29:59 -07:00
Kubernetes Prow Robot
065432e074 Merge pull request #3984 from natasha41575/replacementWithDot
Replacement with dot
2021-06-10 18:12:13 -07:00
monopole
86dd74fd62 Gather some string slice utils. 2021-06-10 13:34:20 -07:00
Natasha Sarkar
218da9858f support mapping values with '.' in replacements fieldpaths 2021-06-10 11:33:05 -07:00
Kubernetes Prow Robot
39f24ef8d2 Merge pull request #3956 from natasha41575/ReplacementPreviousIds
replacements should be able to use previous IDs
2021-06-09 10:45:26 -07:00
Mikhail Mazurskiy
a3ed120efb Handle errors 2021-06-05 09:43:13 +10:00
Natasha Sarkar
6adefe4562 replacements should be able to use previous IDs 2021-06-03 12:14:27 -07:00
Natasha Sarkar
84724a3ebf smarter path splitter for replacements 2021-06-01 17:15:54 -07:00
Kubernetes Prow Robot
af96bb4bda Merge pull request #3914 from natasha41575/GkeServiceAccountGenerator
Gke service account generator
2021-05-27 15:36:23 -07:00
Natasha Sarkar
5a2a7709a4 add IAMPolicyGenerator 2021-05-26 16:54:38 -07:00
monopole
172adc404f Consolidate scripts into k8s-traditional hack dir. 2021-05-24 17:09:11 -07:00
monopole
a6b9445702 Fix repospec test 2021-05-20 09:52:59 -07:00
Josh Komoroske
24a64bdee3 URL based configuration for git exec timeouts and git submodule cloning
Adds a number of user-accessable options for configuring internal git resource
cloning behavior.
- Git commands are executed with a configurable timeout by including a parameter
  like "?timeout=2m30s" in the resource URL. This can improve cloning a large
  repository, or over a slow network.
- Git submodule cloning can be disabled by including a parameter like
  "?submodules=false" in the resource URL.
- Switch the overall query parsing to use url.Parse() and be more extensible.
2021-05-19 00:07:02 -07:00
monopole
5c4e363f11 Remove delegation to RNode in Resource. 2021-05-11 10:49:17 -07:00
monopole
82abd7e9ea Simplify kind and name change code. 2021-05-09 16:20:39 -07:00