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

Add an option to disable keyring file #3145

Merged
merged 2 commits into from
Jun 15, 2017
Merged

Add an option to disable keyring file #3145

merged 2 commits into from
Jun 15, 2017

Conversation

kyhavlov
Copy link
Contributor

Also disables keyring file in dev mode.

Closes #835, #2630, and #2784.

@kyhavlov kyhavlov requested a review from slackpad June 14, 2017 00:03
@@ -675,11 +675,11 @@
"revisionTime": "2017-05-25T23:15:04Z"
},
{
"checksumSHA1": "ZkJRgexeNzNZzpw6YnedwoJl7pE=",
"checksumSHA1": "sdjkMflUxYtL/l7n7wYPS0Xj5c0=",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why did vendor.json and the above two files have to change for this, they seem unrelated to the change being made?

@@ -887,8 +887,10 @@ func (a *Agent) makeServer() (*consul.Server, error) {
if err != nil {
return nil, err
}
if err := a.setupKeyrings(config); err != nil {
return nil, fmt.Errorf("Failed to configure keyring: %v", err)
if !a.config.DisableKeyringFile {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor readability thing - Any reason why this config param is not enableKeyRingFile, set to false by default? I find negative boolean feature flags always take a couple of seconds more to follow when you are reading a config file that has them, because its like if its set to true the file won't be written

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a bad idea since we are creating the config and not worrying about BC. If we switch to a bool* we could make this EnableKeyringFile and default it to true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok leaving it disable too, since it defaults to enabled and we have a lot of other things like that in the config. I'll leave it up to you @kyhavlov - either way works.

Copy link
Contributor

@slackpad slackpad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two bits of feedback, otherwise LGTM.

@@ -887,8 +887,10 @@ func (a *Agent) makeServer() (*consul.Server, error) {
if err != nil {
return nil, err
}
if err := a.setupKeyrings(config); err != nil {
return nil, fmt.Errorf("Failed to configure keyring: %v", err)
if !a.config.DisableKeyringFile {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a bad idea since we are creating the config and not worrying about BC. If we switch to a bool* we could make this EnableKeyringFile and default it to true.

@@ -318,6 +318,10 @@ func TestDecodeConfig(t *testing.T) {
c: &Config{EnableSyslog: true},
},
{
in: `{"disable_keyring_file":true}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the website with the new option.

@kyhavlov kyhavlov merged commit 5d99ee8 into master Jun 15, 2017
@kyhavlov kyhavlov deleted the disable-keyring-file branch June 15, 2017 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants