-
Notifications
You must be signed in to change notification settings - Fork 188
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
ENT-4681: Test proper scoping of classes defined from non-default namespace #3689
Conversation
Thanks for submitting a PR! Maybe @vpodzime can review this? |
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.
Please fix the typos. Also, is there a ticket for this issue?
expression => "any", | ||
scope => "bundle"; # Bundle scoped classes are NOT visible from other bundles | ||
} | ||
body file control { namespace => "default"; } |
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 is this double body file control
supposed to do? And what makes you think it should be like that?
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.
The first one set the namespace to test, the second one returned the namespace to default. So bundle agent example
is in the test
namespace but bundle agent test
is in the default namespace.
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.
Please fix the typos. Also, is there a ticket for this issue?
ACK, and yes, ENT-4681 is the related ticket
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 am quite surprised that the double body file control
just works like this, sequentially. That looks almost like a crime! 😉
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 agree with @vpodzime this looks insane to me. The ordering of bodies and bundles within a file shouldn't matter, at all. Also a body file control
is the control body for the file no? It should be for the whole file. I would expect the last body to overwrite the attributes of the first one, or an error.
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.
Yeah, but this is how it was designed.
https://docs.cfengine.com/docs/3.12/reference-components-file_control_promises.html
This directive can be given multiple times within any file, outside of body and bundle definitions.
tests/acceptance/00_basics/04_bundles/agent-bundle-class-bundle-scope-default-perspective.cf
Outdated
Show resolved
Hide resolved
tests/acceptance/00_basics/04_bundles/agent-bundle-class-bundle-scope-namespace-perspective.cf
Outdated
Show resolved
Hide resolved
Ticket: ENT-4681 Changelog: none
dbd6610
to
2d17459
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.
ACK, but cannot say it looks good to me.
@cf-bottom jenkins |
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/2745/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-2745/ |
No description provided.