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

Changes remote exec KV read to call GetTokenForAgent(). #3283

Merged
merged 3 commits into from
Jul 17, 2017
Merged

Conversation

slackpad
Copy link
Contributor

This lets it use the acl_agent_token instead of just the acl_token. Docs were also updated accordingly.

Fixes #3160.

@slackpad slackpad requested a review from preetapan July 17, 2017 00:32
cfg.ACLDatacenter = "dc1"
cfg.ACLAgentToken = "root"
cfg.ACLDefaultPolicy = "deny"
testRemoteExecGetSpec(t, cfg)
Copy link
Contributor

@preetapan preetapan Jul 17, 2017

Choose a reason for hiding this comment

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

I am not sure if this is testing anything here. It is passing this config struct to testRemoteExecGetSpec, but that doesn't seem to get passed to the test agent it creates there. What exactly is the intention of this TestRemoteExecGetSpec_ACLAgentToken test case?

cfg.ACLDefaultPolicy = "deny"
testRemoteExecGetSpec(t, cfg)
}

func testRemoteExecGetSpec(t *testing.T, c *Config) {
a := NewTestAgent(t.Name(), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, maybe the second arg is not supposed to be nil but c instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh good catch - yeah this must be working because ACLs aren't getting enabled for either case. This is supposed to make sure we can get the token from the ACL agent token, and the other test checks the ACL token. I'll pass that through and make sure it looks like it's properly using ACLs.

@slackpad
Copy link
Contributor Author

@preetapan did a rebase and updated that unit test, can you please take another look?

@slackpad slackpad merged commit 780e68a into master Jul 17, 2017
@slackpad slackpad deleted the issue-3160 branch July 17, 2017 04:12
@slackpad
Copy link
Contributor Author

The unhappy path test found a similar nil getting passed in for the config, so I fixed that as well.

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.

2 participants