You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,9 +78,9 @@ metadata:
78
78
name: set-annotation
79
79
spec:
80
80
# 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")
82
82
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")]
84
84
85
85
repositories:
86
86
- name: workload
@@ -198,7 +198,7 @@ make docker-run-release
198
198
199
199
Here's what you can do in the KCL script:
200
200
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).
202
202
+ Return a KPM list for output resources.
203
203
+ Return an error using `assert {condition}, {error_message}`.
204
204
+ Read the environment variables. e.g. `option("PATH")` (Not yet implemented).
0 commit comments