-
Notifications
You must be signed in to change notification settings - Fork 289
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
#709 Remove anchors (and create_resources) #763
Conversation
This is a good first pass. Eventually I'd like to not use subclasses that do not provide value on their own, such as ::package and ::service and instead have those entries in the main sensu class. |
manifests/init.pp
Outdated
create_resources('::sensu::check', $checks, $check_defaults) | ||
create_resources('::sensu::filter', $filters, $filter_defaults) | ||
create_resources('::sensu::mutator', $mutators) | ||
$extensions.each { $k,$v } { |
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.
syntax error here that is causing Travis to fail
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.
Now fixed
I'm a bit puzzled why the spec tests are failing. |
Travis errors were due to a mistake i was doing, forgetting to add the defaults params in the created resources. I'd not change/remove whole classes here, to avoid too many more or less radical changes all in one place. Eventually stuff for another ticket. |
Squashed works on this on a single commit for possible merging, as these are some outstanding choices which might need further works:
|
@ghoneycutt some input on the 3 above points is needed to finish this My2c on them
|
I don't think we need I'm OK with the single anchor. The private subclasses should be moved into their parent classes. |
@ghoneycutt I've give a look at the number of private classes: more than I expected:
I'm not so sure it's a good idea to move their content ( i expect not few resources ) to the parent classes, considering the amount of tests that probably have to be changed, resources to be added to existing classes and management of dependencies. So I prefer a second confirmation (sorry :-) before starting the activity. |
Please proceed, as we want to ditch the private classes and caller_module. This should be mostly cut/paste of resources and spec tests into other files. |
So, removed the checks for private classes, but not merged all of them in parent classes. I just consolidated the sensu::enterprise::dashboard class for the moment. Consolidation of other classes on api, client e enterprise might be more impactful on tests (there were no tests for sensu::enterprise::dashboard subclasses). In any case for these cases a new class, to replace the existing ones has to be created: (ie manifests/api.pp to replace manifests/api/config.pp and manifests/api/service.pp). has_restart is still there. Removing it would be backwards incompatible, so it would require a major version bump, if semver is followed. It doesn't harm but at the same time I wonder who needs it. I'd plan its removal when a major version bump is done. |
Please continue with the consolidation of classes. Please keep |
@ghoneycutt consolidated api, client and enterprise classes.
I'd avoid to create giant classes just for the sake or reducing their numbers, considering also all the dependencies workarounds that have to be added. So for me, this is ready to merge. |
Hi @alvagante could you please rebase so this can be merged. |
b415bd9
to
55efcc7
Compare
Removed anchors and create_resources Syntax fix Added forgotten defaults var in init.pp resource hashes Fixed order in hash merging Remove check for private classes usage sensu::enterpise::dashboard class consolidation sensu#709 Removed subclasses incorporated in sensu::enterprise::dashboard Fixed sensu::check notify tests Removed manifests readded by merge Workaround for Puppet 4.x compatibilty - Evaluation Error: Error while evaluating a Resource Statement, Sensu::Write_json[/etc/sensu/conf.d/checks/mycheck.json]: parameter 'notify_list' index 0 expects a Data value, got Type at /home/travis/build/sensu/sensu-puppet/spec/fixtures/modules/sensu/manifests/check.pp:226 on node testing-docker-0c136c1e-7d4c-4d32-9c4c-37325d83735a.ec2.internal
@ghoneycutt rebased with pain and sweat, but should be ok. Resolves: #763 |
Tried to bring up the sensu-server in vagrant and getting errors
|
@ghoneycutt made some tests, it looks like we have the same issue with current master |
@ghoneycutt I think the error is due to how checks files are created:
and not
manually changing the files in conf.d/checks/ on the Vagrant sensu-server vm allows the api service to start. @jeffmccune FYI |
@agoddard This seems like a sensu bug if you cannot specify |
Seems this issue is not related to this PR, so merging this. |
Released in v2.33.1 |
Note: an anchor in init.pp has been temporarily left in place.
It has a purpose and might not trivial to replace.
Could remain in code base as far as I'm concerned.