Skip to content

Conversation

victormlg
Copy link
Contributor

@victormlg victormlg commented Oct 2, 2025

Merge together:
cfengine/core#5873

Copy link
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you have is OK. But I have suggested to simplify it a bit.

inventory/any.cf Outdated
disable_mpf_policy_version::
"policy_version" -> { "ENT-9806" }
string => "$(default:control_common.version)",
meta => { "inventory", "attribute_name=CFEngine policy version" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the class definition above because we aren't using that class to constrain more than a single promise and additionally it didn't seem useful for me to allow users to define the disable_mpf_policy_version class to affect this behavior.

Try this (untested)

Suggested change
meta => { "inventory", "attribute_name=CFEngine policy version" };
"policy_version" -> { "ENT-9806" }
string => "$(default:control_common.version)",
meta => { "inventory", "attribute_name=CFEngine policy version" }
if => isvariable("$(sys.policy_version)"),
comment => concat( "Don't inventory the policy version from policy when it's available",
" as a sys var to avoid duplicate values being inventoried.");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be

if => not(isvariable("sys.policy_version")),

Since we want to define this variable only if sys.policy_version doesn't already exist?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victormlg yea, it should.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing - please fix the , / ; mistake.

Changelog: Disabled policy version in masterfiles because it is now managed and inventoried by default by the core agent inside sys.policy_version.
Ticket: ENT-4043
Signed-off-by: Victor Moene <victor.moene@northern.tech>
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