kpt: Some commands fail on YAML that only contains a list
This produces an error: wrong Node Kind for expected: MappingNode was SequenceNode. Seems like SequenceNode should be allowed?
FieldClearer and FieldMatcher types seem to disallow this.
(
REPRO_HOME=$(mktemp -d)
cat <<EOF >$REPRO_HOME/list_only.yaml
# A comment
- key: value
- string
EOF
kpt pkg init $REPRO_HOME
kpt cfg create-setter $REPRO_HOME key value --stack-trace
)
echo '- key: value\n- string'|kpt cfg cat
error: wrong Node Kind for expected: MappingNode was SequenceNode: value: {- key: value
- string}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 21 (10 by maintainers)
Hi @phanimarupaka, I tried using
.krmignore, but I kept getting thewrong Node Kind error. Can you clarify when that feature was supported? Is it inkpt 0.37.1? And what is its syntax?I’m getting this error message:
I put a
.krmignorefile inupstream/manifestswith the following content:However, neither the relative path, nor the file name seem to be read. I’m still getting the error message during kpt cfg set.
Such top-level lists arise in JSON Patch files written as YAML. It’s necessary to place such patch definitions in files separate from a kustomization.yaml file in order to use setters and substitutions in the content of the patch.
See #510 and #1324 for more of that story.
@natasha41575 @runewake2 I’d consider picking up this ticket if you are blocked on one of the bigger tasks.