Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93
stars
52
forks
source link
WASM compiled functions don't like non-strings in YAML #675
Use the above resources with a WASM compiled function such as set-namespace.
Original issue comments:
Comment user: https://github.com/wmuizelaar
Comment created at: 2022-10-17T18:40:02Z
Comment last updated at: 2022-10-17T18:40:02Z
Comment body: To add to this: I can also reproduce this without using the WASM function, and in above example only chante the mutator-image to gcr.io/kpt-fn/set-namespace:v0.4.1
Package "kpt-test":
[RUNNING] "gcr.io/kpt-fn/set-namespace:v0.4.1"
[FAIL] "gcr.io/kpt-fn/set-namespace:v0.4.1" in 800ms
Results:
[error]: SubObject has unmatched field type: `data/namespace
Stderr:
"failed to evaluate function: SubObject has unmatched field type: `data/namespace"
Exit code: 1
This seems to be caused by YAML automatically thinking that a numeric field should be considered as pure numeric. Should this always be casted as a string (and is this therefore a bug), or should we as a user make sure that when there is a potential for all numeric fields, that we quote those values to enforce them to be read as a string?
Original issue URL: https://github.com/kptdev/kpt/issues/3626 Original issue user: https://github.com/wleese Original issue created at: 2022-10-17T13:13:02Z Original issue last updated at: 2022-11-15T21:49:53Z Original issue body: ### Expected behavior
Render should succeed regardless of
"123"
or123
values in yaml.Actual behavior
Information
kptfile
set-namespace is compiled to WASM.
package-context.yaml
Saw the behavior with
apply-replacements
as well.Steps to reproduce the behavior
Use the above resources with a WASM compiled function such as set-namespace.
Original issue comments: Comment user: https://github.com/wmuizelaar Comment created at: 2022-10-17T18:40:02Z Comment last updated at: 2022-10-17T18:40:02Z Comment body: To add to this: I can also reproduce this without using the WASM function, and in above example only chante the mutator-image to
gcr.io/kpt-fn/set-namespace:v0.4.1
This seems to be caused by YAML automatically thinking that a numeric field should be considered as pure numeric. Should this always be casted as a string (and is this therefore a bug), or should we as a user make sure that when there is a potential for all numeric fields, that we quote those values to enforce them to be read as a string?