Skip to content

classfilterdata: Fix inconsistent results (3.27.x)#6023

Merged
larsewi merged 1 commit into
cfengine:3.27.xfrom
larsewi:classfilterdata-3.27.x
Jan 20, 2026
Merged

classfilterdata: Fix inconsistent results (3.27.x)#6023
larsewi merged 1 commit into
cfengine:3.27.xfrom
larsewi:classfilterdata-3.27.x

Conversation

@larsewi

@larsewi larsewi commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Currently, classfilterdata() does not return a variable for
array_of_XXXs if given data structure's value do not comply completely
to given array_of_XXXs parameter.
On the other hand, classfilterdata() does return a variable when given
object_of_XXXs even if this variable does not completely comply to
object_of_XXXs.

This patch changes classfilterdata() to not return a variable as well
for object_of_XXXs in case given data structure's does not comply.
Also add an acceptance test for it.
This patch also fixes a compiler warning mayby-uninitialized of variable
remove in FnCallClassFilterData() in case parent is of type JSON object.

(cherry picked from commit f53bee0)
Signed-off-by: Lars Erik Wik lars.erik.wik@northern.tech

Back ported from #6021

Currently, classfilterdata() does not return a variable for
array_of_XXXs if given data structure's value do not comply completely
to given array_of_XXXs parameter.
On the other hand, classfilterdata() does return a variable when given
object_of_XXXs even if this variable does not completely comply to
object_of_XXXs.

This patch changes classfilterdata() to not return a variable as well
for object_of_XXXs in case given data structure's does not comply.
Also add an acceptance test for it.
This patch also fixes a compiler warning mayby-uninitialized of variable
remove in FnCallClassFilterData() in case parent is of type JSON object.

(cherry picked from commit f53bee0)
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi

larsewi commented Jan 19, 2026

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins please :)

@cf-bottom

Copy link
Copy Markdown

@larsewi larsewi requested a review from olehermanse January 20, 2026 07:58
@larsewi larsewi merged commit 9277ad3 into cfengine:3.27.x Jan 20, 2026
33 checks passed
@larsewi larsewi deleted the classfilterdata-3.27.x branch April 27, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants