-
Notifications
You must be signed in to change notification settings - Fork 105
ENT-4043: Disabled policy versions #3050
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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" }; |
There was a problem hiding this comment.
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)
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."); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victormlg yea, it should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
cb94248
to
47ccda7
Compare
There was a problem hiding this 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.
47ccda7
to
15e2ac3
Compare
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>
15e2ac3
to
b42530a
Compare
Merge together:
cfengine/core#5873