Commit Graph

47 Commits

Author SHA1 Message Date
Daniel Wilson
b7cdd9168a Sort built-in Namespace kind before CRDs with the same name (#5458)
* add core api sort priority for NAmespace kind in gvkLessThan

* fix logic

* fix syntax

* fix syntax

* fix logic

* regenerate builtin plugins
2024-09-03 21:57:17 +01:00
Mauren Berti
77354d73b9 chore: add deprecation comment to commonLabels
`commonLabels` is deprecated, but the field did not have a deprecation comment,
like other fields do. Add the deprecation comment, as some IDEs use that as a
guideline to show a strikethrough in the field names (and to follow the pattern
of other deprecated fields).
2024-05-19 21:07:00 -04:00
Nick
f23d45fcb4 Add deprecation warning message to commonLabels (#5464)
* Add commonLabels deprecation warning message

* Add test

* Add warningToRunEditFix message
2023-11-30 17:41:43 +01: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
75fa235498 Only override name of core api version 2023-04-18 09:41:28 +01:00
koba1t
928b823d8f fix using reflect.DeepEqual for check kustomization is empty 2023-04-06 05:52:13 +09:00
koba1t
2c2b2ab825 add check that kustomization is empty 2023-04-06 05:32:08 +09:00
Katrina Verey
dd520f8889 Revert strict decoding of Kustomization due to regression in anchor handling (#5073)
* Revert strict decoding of Kustomization due to regression in anchor handling

* Empty commit
2023-03-13 13:46:47 -07:00
Katrina Verey
d70315fed6 Remove Inventory field from Kustomization
This field has not done anything since v3.5.5. It was missed in the cleanup in https://github.com/kubernetes-sigs/kustomize/pull/2421
2023-01-12 19:11:44 -05:00
koba1t
6489e35b7c improve error messages 2023-01-07 03:30:16 +09:00
yugo kobayashi
5fed0f76c8 refactor Unmarshal Kustomization struct code 2022-12-13 21:04:50 +00:00
yugo kobayashi
faddb49c89 remove FixKustomizationPreUnmarshalling 2022-12-13 18:50:25 +00:00
Yannis Zarkadas
a502717460 Make ordering configurable (#4019)
* 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>
2022-12-02 13:59:53 -08: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
yugo kobayashi
21ee7f7125 Emit a warning when deprecated fields are used 2022-09-01 23:02:50 +00:00
yugo kobayashi
032bf3338e update checker code in patchStrategicMerge 2022-08-28 17:20:21 +00:00
yugo kobayashi
bb7ebe029c support file path patch to patchesStrategicMerge 2022-08-06 20:28:48 +00:00
yugo kobayashi
64f42ea45f add edit-fix for patchesStrategicMerge to patches 2022-08-06 20:28:48 +00:00
Katrina Verey
14947e449b Address new linter complaints 2022-03-31 11:37:26 -04:00
Dingzhu Lurong
b1086ac49b fix broken link 2022-03-09 16:00:59 +08: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
natasha41575
2554d690c8 deprecate enable-managedby-label flag in favor of a field 2022-01-19 16:53:27 -08:00
natasha41575
a8f58b4080 collect origin data only when the option is set 2021-12-13 11:38:03 -08:00
Natasha Sarkar
3350c7213c option for origin data as annotation 2021-08-12 20:09:41 -07:00
Natasha Sarkar
038bc7713b add replacement transformer 2021-04-15 14:12:33 -07:00
monopole
240cda089a Add flag --enable-helm 2021-04-12 13:40:21 -07:00
Donny Xia
ccb95ab269 add conflict check 2021-03-24 10:41:37 -07:00
Donny Xia
5ed2067be9 Add labels field to kustomization 2021-03-22 17:01:45 -07:00
monopole
a8b851f84a Reinstate configmap/secret generator env field. 2021-03-07 20:42:41 -08:00
Natasha Sarkar
866dbf2017 added an openapi field to the kustomization file 2021-01-22 16:06:57 -08:00
Donny Xia
3b79944190 improve target in JSON6902 transformer 2020-11-03 17:13:43 -08:00
Donny Xia
e75d4fc87d convert helm inflator to builtin plugin 2020-10-30 23:18:54 -07:00
Donny Xia
e695b0534d Add metadata field to kustomization file 2020-10-05 11:20:41 -07:00
Eyob Tefera
1bc9225302 Move patches fix to before Write step. 2020-08-12 18:14:03 +00:00
Eyob Tefera
45893b2588 Iteratively convert PatchesJson6902 to Patches. 2020-08-10 17:57:39 +00:00
Donny Xia
897698fb29 Uniform unmarshal function 2020-07-14 17:01:43 -07:00
Donny Xia
a0c1979798 Add validator to kustomization 2020-06-17 14:35:12 -07:00
Paul Martin
34a442bbef Additional tests around reusing the same bases and components 2020-05-28 23:02:31 +01:00
Paul Martin
c5c53011da PoC to add Components to a separate components list (instead of resources)
If this idea is preferred, the code could really do with a refactor (probably using closures to control the behaviour of accumulate directory)
2020-05-18 19:25:29 +01:00
Paul Martin
fdfb58cc3e Require version kustomize.config.k8s.io/v1alpha1 for Component 2020-05-18 19:25:29 +01:00
Paul Martin
1079d8604c Renamed KustomizationPatch to Component 2020-05-18 19:25:29 +01:00
Paul Martin
4454edc14c Implement "kind: KustomizationPatch" to support composition of Kustomize files 2020-05-18 19:25:29 +01:00
jregan
39cb87cf2b Define global const for metadata/namespace field 2020-05-09 18:00:26 -07:00
jregan
3da0afdda0 Activate lint gosimple. 2019-11-16 06:09:54 -08:00
Jeffrey Regan
e5c8b5ec8f Start api directory, which will become a module. 2019-10-17 14:01:20 -07:00