list-setters: Simple Example #
Overview #
In this example, we will see how to list setters in a package.
Fetch the example package #
Get the example package by running the following commands:
$ kpt pkg get https://github.com/kptdev/krm-functions-catalog.git/examples/list-setters-simple
Function invocation #
Invoke the function by running the following command:
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/list-setters:latest
Expected result #
[RUNNING] "ghcr.io/kptdev/krm-functions-catalog/list-setters:latest"
[PASS] "ghcr.io/kptdev/krm-functions-catalog/list-setters:latest"
Results:
[INFO] Name: env, Value: [stage, dev], Type: array, Count: 1
[INFO] Name: nginx-replicas, Value: 3, Type: int, Count: 1
[INFO] Name: tag, Value: 1.16.2, Type: str, Count: 1
Note: #
Refer to the apply-setters function documentation for information about updating the field values parameterized by setters.