Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complex capture filters #1256

Open
alexminder opened this issue Jul 26, 2024 · 3 comments
Open

complex capture filters #1256

alexminder opened this issue Jul 26, 2024 · 3 comments

Comments

@alexminder
Copy link

What happened:

How to use complex capture selects based on multiple conditions?
It would be great to see documetation with good portion of such examples.

What you expected to happen:

Currently I don't know how to do such selects in a NNCP.

$ oc get nns NODE -o json|jq  '.status.currentState.interfaces|.[]|select(.driver == "igb" or .driver == "tg3")|.name'
"eno8303"
"eno8403"

This select does no allow to use integer in NNCP capture, because expected string, but nns returns float64:

$ oc get nns NODE -o json|jq  '.status.currentState.interfaces|.[]|select(.ethernet.speed == 10000)|.name'
"eno12399np0"
"eno12409np1"
@qinqon
Copy link
Member

qinqon commented Aug 9, 2024

@alexminder is this issue for the k-nmstate "capture" feature or to compose a proper jq expression ?

@alexminder
Copy link
Author

@qinqon the issue for k-nmstate "capture" feature.
jq as an example to illustrate the impossibility of using such expressions in "capture."

@qinqon
Copy link
Member

qinqon commented Sep 2, 2024

@alexminder can you open an issue at github.com/nmstate/nmstate, we have move the captures "engine" there and we will integrate k-nmstate to what is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants