-
Notifications
You must be signed in to change notification settings - Fork 83
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
add support to configure shard_duration to retention_policy resource #170
Conversation
Thanks @kjschnei001 for the PR. I’ll take a look at this soon and should receive feedback this week. |
resources/retention_policy.rb
Outdated
client.alter_retention_policy(new_resource.policy_name, new_resource.database, new_resource.duration, new_resource.replication, new_resource.default) | ||
if current_policy['duration'] != new_resource.duration || current_policy['replicaN'] != new_resource.replication || current_policy['default'] != new_resource.default || current_policy['shard_duration'] != new_resource.shard_duration | ||
client.alter_retention_policy(new_resource.policy_name, new_resource.database, new_resource.duration, new_resource.replication, new_resource.default, shard_duration: new_resource.shard_duration) | ||
updated_by_last_action true |
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.
to be chef14 compliant, you'll need to change this line to new_resource.updated_by_last_action true
resources/retention_policy.rb
Outdated
end | ||
else | ||
client.create_retention_policy(new_resource.policy_name, new_resource.database, new_resource.duration, new_resource.replication, new_resource.default) | ||
client.create_retention_policy(new_resource.policy_name, new_resource.database, new_resource.duration, new_resource.replication, new_resource.default, shard_duration: new_resource.shard_duration) | ||
updated_by_last_action true |
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.
to be chef14 compliant, you'll need to change this line to new_resource.updated_by_last_action true
@kjschnei001 I ran through the kitchen setup just for chef14 clients. Check out my review comments to get it to work. $ kitchen test "default-ubuntu-1404-chef14.*"
...
Recipe: influxdb-test::default
* influxdb_database[test_database] action create (up to date)
* influxdb_user[test_user] action create (up to date)
* influxdb_admin[test_admin] action create (up to date)
* influxdb_retention_policy[test_policy] action create
* influxdb_continuous_query[test_cq] action create (up to date)
Recipe: influxdb::default
* service[influxdb] action restart
- restart service service[influxdb]
...
test_database
exists
default retention policy
exists
its retention is set for 1 week
its shard duration is set for 24 hours
is set for 1 replica
is the default
test continuous queries
... |
Hi @kjschnei001, just checking in to see if you needed any additional help with this PR. |
Sorry about the delay, @bdangit . Your fixes did the trick!:
|
It looks like foodcritic is complaining about that syntax though:
|
@bdangit The continuous integeration tests are failing, but I can't see the page to know why. Can I get your help on this one? |
It looks like the testing is just executing
|
hey @kjschnei001 I'm so sorry about the lack of build visibility feedback you are getting. I have created an issue #171 to use something more open source friendly. W.r.t to the issue at hand this is what I see:
This error looks like something you didn't change. So I suspect that chefdk tool suite has been upgraded within this docker image chef/chefdk What I would do is the following:
Note: I haven't tested above, but hopefully you get the gist of what I am recommending. |
@bdangit Thanks Ben! Running the tests in the docker environment gave me the insight I needed to get the tests passing. |
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.
Thanks @kjschnei001! Before I give the thumbsup, can you please squash your commits?
636d1dc
to
aa65f8b
Compare
@bdangit Sorry for the delay. I have squashed the commits. Are we good to go now? |
awesome! thanks for your PR @kjschnei001! |
@bdangit would you mind cutting a |
@kjschnei001 done! |
I ran the integration tests across 2 different versions of chef and the changes work. I don't think the cookbook in general is written to support chef v14 as I found issues unrelated to things I changed:
Chef 12
Chef 13
Chef 14