ENT-6193, CFE-3421: Added policy function classfilterdata()#5836
Conversation
|
@cf-bottom jenkins, please |
|
Edit: This build is green, but parts of it was not run (DTs). Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12330/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12330/ |
|
@cf-bottom please build in Jenkins again :) |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12354/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12354/ |
|
@cf-bottom jenkins, please |
|
Lars had already done a rebuild so I cancelled tom's build and s/12359/12358/ here. Jenkins: https://ci.cfengine.com/job/pr-pipeline/12358/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12358/ |
|
@cf-bottom let's test this in Jenkins, please |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12360/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12360/ |
|
@cf-bottom let's test this in Jenkins, please |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12366/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12366/ |
|
@cf-bottom jenkins please after fixing up the build host setup some more... |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12370/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12370/ |
nickanderson
left a comment
There was a problem hiding this comment.
I hit a crash when the first argument is a function, e.g. readjson() to pull the json from a file on disk instead of explicitly loading it separately first. Referencing a data container does work for me.
https://northerntech.atlassian.net/browse/CFE-3421?focusedCommentId=123161
Good find @nickanderson. I fixed the segmentation fault. The issue was that I had wrongfully set the function to have a variable amount of arguments (through copy pasta). The first argument however, requires a CFEngine variable identifier or inline JSON. This is similar to other functions (like storejson(), dataexpand(), and many more. If you want to be able to nest function calls into these functions as well, we should create a separate ticket. |
|
@cf-bottom Jenkins please :) |
|
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12373/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12373/ |
|
OK, I tested the latest PR build and see it's no longer dumping core and now it errors fatally: But, I think this function should have "Collecting" (https://docs.cfengine.com/docs/3.24/reference-functions.html#collecting-functions) behavior like This is what allows a function to take a data container specified by it's bare name ( I made this example that illustrates the behavior for Does that make sense? |
nickanderson
left a comment
There was a problem hiding this comment.
I think it should have collecting behavior. https://docs.cfengine.com/docs/3.24/reference-functions.html#collecting-functions
|
Thanks @nickanderson, I was not aware of this. I marked the function arguments as collecting and created an acceptance test to prove that it can now take nested function calls as arguments. |
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-6193, CFE-3421 Changelog: Title Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
b688857 to
4977b5a
Compare
Ticket: ENT-10961, CFE-1840 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Added acceptance test to prove that classfilterdata is a collecting policy function. Ticket: ENT-6193, CFE-3421 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-6193, CFE-3421 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
|
@cf-bottom Jenkins please :) |
|
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/12376/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-12376/ |
Added collecting behavior as requested
Uh oh!
There was an error while loading. Please reload this page.