Skip to content
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

vault_secret: Save lease ID to the nested attribute #56

Merged
merged 2 commits into from
May 11, 2016

Conversation

legal90
Copy link
Contributor

@legal90 legal90 commented May 6, 2016

It allows avoiding conflicts with other top-level attributes.
Related comment: 7f2f49d#commitcomment-17324222

cc: @Ginja

It allows to avoid conflicts with other top-level attributes.
@Ginja
Copy link
Contributor

Ginja commented May 7, 2016

Great!

One small suggestion. Should we expose this as a property and have its default value come from an attribute?

@legal90 legal90 changed the title vault_secret: Save secret value to the nested attribute vault_secret: Save lease ID to the nested attribute May 8, 2016
@legal90
Copy link
Contributor Author

legal90 commented May 8, 2016

I've made a mistake in the PR title. In fact, we use node attributes only to save secret lease ID, not the entire secret.

So, this attribute is designed only for the internal technical reason - to validate lease ID in upcoming Chef client runs. IMO, there is no need to customize this property.

However, it is reasonable to make run_state nesting level customizable, because that's exactly how users access secrets in the recipe code. In this PR I haven't touch it: node.run_state[new_resource.path]. Should I do this?

@Ginja
Copy link
Contributor

Ginja commented May 9, 2016

So, this attribute is designed only for the internal technical reason - to validate lease ID in upcoming Chef client runs. IMO, there is no need to customize this property.

True, but we are storing something on node object, and it would be nice to let people change it if they wish (perhaps there is another use we're not thinking of). However, this can always be added later.

I agree with making the reference in run_state customizable. One way would be to change new_resource.path to new_resource.name. However, that may be un-intuitive for users, and may lead to confusion if they don't realize. An additional run state reference property could be added with a default value of nil and if it wasn't declared, the reference would default to new_resource.path.

@codecov-io
Copy link

codecov-io commented May 11, 2016

Current coverage is 52.58%

Merging #56 into master will increase coverage by -21.64%

@@           master        #56   diff @@
========================================
  Files           2          2          
  Lines          97         97          
  Methods         0          0          
  Branches        0          0          
========================================
- Hits           72         51    -21   
- Misses         25         46    +21   
  Partials        0          0          
  1. File ...ries/vault_config.rb (not in diff) was modified. more
    • Misses +21
    • Partials 0
    • Hits -21

Powered by Codecov. Last updated by 53d073a...5518fd4

@legal90
Copy link
Contributor Author

legal90 commented May 11, 2016

@Ginja I'va added resource property run_state_reference. Is it OK, or should be renamed/modified ?

@Ginja
Copy link
Contributor

Ginja commented May 11, 2016

Looks great. Thanks!

@Ginja Ginja merged commit d61f45b into sous-chefs:master May 11, 2016
@legal90 legal90 deleted the secret-nested branch May 11, 2016 14:05
@lock
Copy link

lock bot commented May 19, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants