-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
auto_encrypt: use server-port instead #6287
Conversation
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.
This looks good @i0rek, thanks for catching that issue.
One other thing to update is this test file:
https://github.com/hashicorp/consul/blob/beb91cf5d9fc7c3d50f7e70612d630c4c5428d42/agent/consul/auto_encrypt_test.go
The whole test file could probably be removed, since the aim was to check the port-related behavior.
agent/consul/auto_encrypt.go
Outdated
@@ -116,27 +115,14 @@ func (c *Client) RequestAutoEncryptCerts(servers []string, defaultPort int, toke | |||
|
|||
// resolveAddr is used to resolve the host into IPs, port, and error. | |||
// If no port is given, use the default |
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.
This comment should be updated to remove references to ports, since resolveAddr just returns IPs now.
One other question: since we are relying on the error string from |
Thanks for the review @freddygv! I kept the your tests since they are useful even without the port and I added a test for the error message as suggested. |
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.
AutoEncrypt needs the server port in order to receive the certificates.