-
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
tlsutil: fix ServerName used for health checks that use TLS #10490
Conversation
In preparation for adding more test cases.
Don't use the agent node name or agent server name when EnableAgentTLSForChecks=false.
c945075
to
d09027c
Compare
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.
LGTM, thanks!
} | ||
|
||
cmpTLSConfig := cmp.Options{ | ||
cmpopts.IgnoreFields(tls.Config{}, "GetCertificate", "GetClientCertificate"), |
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.
oh cool, TIL about cmp being able to ignore 👍🏽
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.
Oh ya! This is one of the big reasons I prefer go-cmp
over reflect.DeepEqual
. Being able to customize the comparison like this makes it much easier to write strict test cases that compare the full return value (instead of picking out parts of the return value and likely missing important fields as they are added).
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/396953. |
…heck tlsutil: fix ServerName used for health checks that use TLS
…-health-check tlsutil: fix ServerName used for health checks that use TLS
Fixes #10481
Related to #9475 (comment)
When
EnableAgentTLSForChecks
is disabled we should not default to the agent server or node name.The specific fix and test case can be seen in the second commit.