{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/nomad/pulls/comments/193572374","pull_request_review_id":126571040,"id":193572374,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzU3MjM3NA==","diff_hunk":"@@ -1060,6 +1060,109 @@ func TestServer_ShouldReload_ShouldHandleMultipleChanges(t *testing.T) {\n \t}\n }\n \n+func TestServer_ShouldReload_ReturnTrueForVaultConfigChanges(t *testing.T) {\n+\tt.Parallel()\n+\trequire := require.New(t)\n+\n+\tagent := &Agent{\n+\t\tlogger: log.New(ioutil.Discard, \"\", 0),\n+\t\tconfig: DevConfig(),\n+\t}\n+\n+\tvaultConfig := &sconfig.VaultConfig{\n+\t\tEnabled: helper.BoolToPtr(true),\n+\t\tAddr:    \"http://127.0.0.1:8200\",\n+\t\tRole:    \"nomad-cluster\",\n+\t\tToken:   \"4f7cece4-5035-f5e6-ba8f-18314a7a0333\",\n+\t}\n+\tagent.config.Vault = vaultConfig\n+\n+\tnewConfig := DevConfig()\n+\tnewVaultConfig := &sconfig.VaultConfig{\n+\t\tEnabled: helper.BoolToPtr(true),\n+\t\tAddr:    \"http://127.0.0.1:8200\",\n+\t\tRole:    \"nomad-cluster\",\n+\t\tToken:   \"7c17ef0b-83df-b6f0-5401-d419\",\n+\t}\n+\tnewConfig.Vault = newVaultConfig\n+\n+\tshouldReloadAgent, shouldReloadHTTP, shouldReloadRPC := agent.ShouldReload(newConfig)\n+\trequire.True(shouldReloadAgent)\n+\trequire.False(shouldReloadHTTP)\n+\trequire.True(shouldReloadRPC)\n+}\n+\n+func TestServer_ShouldReload_ForVaultConfigUpgradeOrDowngrade(t *testing.T) {\n+\tt.Parallel()\n+\trequire := require.New(t)\n+\n+\t// Test downgrading a vault configuration","path":"command/agent/agent_test.go","position":40,"original_position":40,"commit_id":"12acae738e47d02cbbc49385b3556c50c0c78121","original_commit_id":"12acae738e47d02cbbc49385b3556c50c0c78121","user":{"login":"preetapan","id":460133,"node_id":"MDQ6VXNlcjQ2MDEzMw==","avatar_url":"https://avatars1.githubusercontent.com/u/460133?v=4","gravatar_id":"","url":"https://api.github.com/users/preetapan","html_url":"https://github.com/preetapan","followers_url":"https://api.github.com/users/preetapan/followers","following_url":"https://api.github.com/users/preetapan/following{/other_user}","gists_url":"https://api.github.com/users/preetapan/gists{/gist_id}","starred_url":"https://api.github.com/users/preetapan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preetapan/subscriptions","organizations_url":"https://api.github.com/users/preetapan/orgs","repos_url":"https://api.github.com/users/preetapan/repos","events_url":"https://api.github.com/users/preetapan/events{/privacy}","received_events_url":"https://api.github.com/users/preetapan/received_events","type":"User","site_admin":false},"body":"Suggest making this a table driven test to make it easy to add more, and read clarity","created_at":"2018-06-06T21:58:17Z","updated_at":"2018-06-06T21:58:17Z","html_url":"https://github.com/hashicorp/nomad/pull/4386#discussion_r193572374","pull_request_url":"https://api.github.com/repos/hashicorp/nomad/pulls/4386","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/comments/193572374"},"html":{"href":"https://github.com/hashicorp/nomad/pull/4386#discussion_r193572374"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4386"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/nomad/pulls/4386","id":193151031,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMTUxMDMx","html_url":"https://github.com/hashicorp/nomad/pull/4386","diff_url":"https://github.com/hashicorp/nomad/pull/4386.diff","patch_url":"https://github.com/hashicorp/nomad/pull/4386.patch","issue_url":"https://api.github.com/repos/hashicorp/nomad/issues/4386","number":4386,"state":"open","locked":false,"title":"Reload Vault config on SIGHUP","user":{"login":"chelseakomlo","id":2530163,"node_id":"MDQ6VXNlcjI1MzAxNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/2530163?v=4","gravatar_id":"","url":"https://api.github.com/users/chelseakomlo","html_url":"https://github.com/chelseakomlo","followers_url":"https://api.github.com/users/chelseakomlo/followers","following_url":"https://api.github.com/users/chelseakomlo/following{/other_user}","gists_url":"https://api.github.com/users/chelseakomlo/gists{/gist_id}","starred_url":"https://api.github.com/users/chelseakomlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chelseakomlo/subscriptions","organizations_url":"https://api.github.com/users/chelseakomlo/orgs","repos_url":"https://api.github.com/users/chelseakomlo/repos","events_url":"https://api.github.com/users/chelseakomlo/events{/privacy}","received_events_url":"https://api.github.com/users/chelseakomlo/received_events","type":"User","site_admin":false},"body":"- Fixes an issue where refactoring logic to determine whether to reload a Nomad agent did not take into account changes to Vault configuration. ","created_at":"2018-06-06T21:51:45Z","updated_at":"2018-06-06T21:58:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"034d47f16c696a34f6d2505ae9c5fc3dc19a7e56","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/nomad/pulls/4386/commits","review_comments_url":"https://api.github.com/repos/hashicorp/nomad/pulls/4386/comments","review_comment_url":"https://api.github.com/repos/hashicorp/nomad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/nomad/issues/4386/comments","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/12acae738e47d02cbbc49385b3556c50c0c78121","head":{"label":"hashicorp:b-vault-reload","ref":"b-vault-reload","sha":"12acae738e47d02cbbc49385b3556c50c0c78121","user":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":36653430,"node_id":"MDEwOlJlcG9zaXRvcnkzNjY1MzQzMA==","name":"nomad","full_name":"hashicorp/nomad","owner":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/nomad","description":"Nomad is a flexible, enterprise-grade cluster scheduler designed to easily integrate into existing workflows. Nomad can run a diverse workload of micro-service, batch, containerized and non-containerized applications. Nomad is easy to operate and scale and integrates seamlessly with Consul and Vault.","fork":false,"url":"https://api.github.com/repos/hashicorp/nomad","forks_url":"https://api.github.com/repos/hashicorp/nomad/forks","keys_url":"https://api.github.com/repos/hashicorp/nomad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/nomad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/nomad/teams","hooks_url":"https://api.github.com/repos/hashicorp/nomad/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/nomad/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/nomad/events","assignees_url":"https://api.github.com/repos/hashicorp/nomad/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/nomad/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/nomad/tags","blobs_url":"https://api.github.com/repos/hashicorp/nomad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/nomad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/nomad/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/nomad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/nomad/languages","stargazers_url":"https://api.github.com/repos/hashicorp/nomad/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/nomad/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/nomad/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/nomad/subscription","commits_url":"https://api.github.com/repos/hashicorp/nomad/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/nomad/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/nomad/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/nomad/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/nomad/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/nomad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/nomad/merges","archive_url":"https://api.github.com/repos/hashicorp/nomad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/nomad/downloads","issues_url":"https://api.github.com/repos/hashicorp/nomad/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/nomad/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/nomad/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/nomad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/nomad/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/nomad/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/nomad/deployments","created_at":"2015-06-01T10:21:00Z","updated_at":"2018-06-06T21:49:15Z","pushed_at":"2018-06-06T21:52:37Z","git_url":"git://github.com/hashicorp/nomad.git","ssh_url":"git@github.com:hashicorp/nomad.git","clone_url":"https://github.com/hashicorp/nomad.git","svn_url":"https://github.com/hashicorp/nomad","homepage":"https://www.nomadproject.io/","size":101954,"stargazers_count":3573,"watchers_count":3573,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":706,"mirror_url":null,"archived":false,"open_issues_count":348,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":706,"open_issues":348,"watchers":3573,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"6d4321c7ff29931ebf70611b814084a426a9a04a","user":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":36653430,"node_id":"MDEwOlJlcG9zaXRvcnkzNjY1MzQzMA==","name":"nomad","full_name":"hashicorp/nomad","owner":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/nomad","description":"Nomad is a flexible, enterprise-grade cluster scheduler designed to easily integrate into existing workflows. Nomad can run a diverse workload of micro-service, batch, containerized and non-containerized applications. Nomad is easy to operate and scale and integrates seamlessly with Consul and Vault.","fork":false,"url":"https://api.github.com/repos/hashicorp/nomad","forks_url":"https://api.github.com/repos/hashicorp/nomad/forks","keys_url":"https://api.github.com/repos/hashicorp/nomad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/nomad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/nomad/teams","hooks_url":"https://api.github.com/repos/hashicorp/nomad/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/nomad/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/nomad/events","assignees_url":"https://api.github.com/repos/hashicorp/nomad/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/nomad/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/nomad/tags","blobs_url":"https://api.github.com/repos/hashicorp/nomad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/nomad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/nomad/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/nomad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/nomad/languages","stargazers_url":"https://api.github.com/repos/hashicorp/nomad/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/nomad/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/nomad/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/nomad/subscription","commits_url":"https://api.github.com/repos/hashicorp/nomad/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/nomad/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/nomad/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/nomad/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/nomad/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/nomad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/nomad/merges","archive_url":"https://api.github.com/repos/hashicorp/nomad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/nomad/downloads","issues_url":"https://api.github.com/repos/hashicorp/nomad/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/nomad/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/nomad/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/nomad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/nomad/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/nomad/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/nomad/deployments","created_at":"2015-06-01T10:21:00Z","updated_at":"2018-06-06T21:49:15Z","pushed_at":"2018-06-06T21:52:37Z","git_url":"git://github.com/hashicorp/nomad.git","ssh_url":"git@github.com:hashicorp/nomad.git","clone_url":"https://github.com/hashicorp/nomad.git","svn_url":"https://github.com/hashicorp/nomad","homepage":"https://www.nomadproject.io/","size":101954,"stargazers_count":3573,"watchers_count":3573,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":706,"mirror_url":null,"archived":false,"open_issues_count":348,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":706,"open_issues":348,"watchers":3573,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4386"},"html":{"href":"https://github.com/hashicorp/nomad/pull/4386"},"issue":{"href":"https://api.github.com/repos/hashicorp/nomad/issues/4386"},"comments":{"href":"https://api.github.com/repos/hashicorp/nomad/issues/4386/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4386/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4386/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/nomad/statuses/12acae738e47d02cbbc49385b3556c50c0c78121"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"preetapan"}}