Skip to content

Commit e5297fc

Browse files
committed
chore: bump resource_list to items
Signed-off-by: Peefy <[email protected]>
1 parent f6dda6f commit e5297fc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ metadata:
7878
name: set-annotation
7979
spec:
8080
# EDIT THE SOURCE!
81-
# This should be your KCL code which preloads the `ResourceList` to `option("resource_list")
81+
# This should be your KCL code which preloads the `ResourceList` to `option("items")
8282
source: |
83-
[resource | {if resource.kind == "Deployment": metadata.annotations: {"managed-by" = "helm-kcl-plugin"}} for resource in option("resource_list").items]
83+
[resource | {if resource.kind == "Deployment": metadata.annotations: {"managed-by" = "helm-kcl-plugin"}} for resource in option("items")]
8484
8585
repositories:
8686
- name: workload
@@ -198,7 +198,7 @@ make docker-run-release
198198

199199
Here's what you can do in the KCL script:
200200

201-
+ Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
201+
+ Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
202202
+ Return a KPM list for output resources.
203203
+ Return an error using `assert {condition}, {error_message}`.
204204
+ Read the environment variables. e.g. `option("PATH")` (Not yet implemented).

examples/workload-charts-with-kcl/kcl-run.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ metadata:
55
name: set-annotation
66
spec:
77
# EDIT THE SOURCE!
8-
# This should be your KCL code which preloads the `ResourceList` to `option("resource_list")
8+
# This should be your KCL code which preloads the `ResourceList` to `option("items")
99
source: |
10-
[resource | {if resource.kind == "Deployment": metadata.annotations: {"managed-by" = "helm-kcl-plugin"}} for resource in option("resource_list").items]
10+
[resource | {if resource.kind == "Deployment": metadata.annotations: {"managed-by" = "helm-kcl-plugin"}} for resource in option("items")]
1111
1212
repositories:
1313
- name: workload

0 commit comments

Comments
 (0)