Closed yuumasato closed 4 years ago
This may have the same root cause:
$ ./yamlp -f ~/git/openscap/tests/probes/yamlfilecontent/openshift-logging.yaml '.spec.outputs'
- type: "elasticsearch"
name: elasticsearch
endpoint: elasticsearch.openshift-logging.svc:9200
mode: 066
secret:
name: fluentd
- type: "elasticsearch"
name: elasticsearch-insecure
endpoint: elasticsearch-insecure.svc.messaging.cluster.local
mode: "066"
insecure: true
- type: "forward"
name: secureforward-offcluster
endpoint: https://secureforward.offcluster.com:9200
mode: "067"
secret:
name: secureforward
$ ./yamlp -f ~/git/openscap/tests/probes/yamlfilecontent/openshift-logging.yaml '.spec.outputs[0]'
Emitter error: expected DOCUMENT-END
$ ./yamlp -f ~/git/openscap/tests/probes/yamlfilecontent/openshift-logging.yaml '.spec.outputs[1]'
Emitter error: expected DOCUMENT-END
$ ./yamlp -f ~/git/openscap/tests/probes/yamlfilecontent/openshift-logging.yaml '.spec.outputs[2]'
Emitter error: expected DOCUMENT-END
Hi @evgenyz , #4 doesn't fix this problem for me, can you take a look at it?
It should be fixed with #5, I've merged it, can you please check. If it is not, please give me the path which breaks things.
@evgenyz The use cases mentioned in this issue work for me, with yamlp
.
@jan-cerny Does it fix your problem as well?
Hi @evgenyz , it seems that it fixes the case reported by @yuumasato . But with the yamlpaths that we use in OpenSCAP tests in test_probes_yamlfilecontent_array.xml it still triggers this error message:
./yamlp -f ~/work/git/openscap/tests/probes/yamlfilecontent/openshift-logging.yaml '.spec.outputs[2].name'
Emitter error: expected DOCUMENT-END
./yamlp -f ~/work/git/openscap/tests/probes/yamlfilecontent/openshift-logging.yaml '.spec.outputs[0:2].name'
Emitter error: expected DOCUMENT-END
Can you check these as well?
OK, these should be fixed by https://github.com/OpenSCAP/yaml-filter/commit/a4a934fc814059cccd014cc64ae809dc46c97aa6
@evgenyz Thanks, I confirm the issue from previous comment is fixed. Also, it makes the failing test for yamlfilecontent probe passing (well almost passing, there was also a small mistake in the test OVAL xml which I fixed in https://github.com/OpenSCAP/openscap/pull/1480/commits/75d720b30bf9c7f55bfd16f7ee87a0a512330c8c)
From master branch using this file, I get error:
Emitter error: expected DOCUMENT-END
Am I doing something wrong?