-
Notifications
You must be signed in to change notification settings - Fork 38
feat: allow member agent use OS's root certificate authority (follow up) #365
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
Conversation
…lternative system environment
| caBundle, ok := os.LookupEnv("CA_BUNDLE") | ||
| if ok && caBundle == "" { | ||
| err := errors.New("environment variable CA_BUNDLE should not be empty") | ||
| klog.ErrorS(err, "failed to validate system variables") |
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.
Why not return the err here? I am not sure why we just log this as user can't see the error log. I don't think an empty env is valid. I assume that not setting it means using os default but setting it as "" ambiguous.
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.
I think that is a copy/paste bug. I fixed that and added unit test in this commit.
cmd/memberagent/main.go
Outdated
| return nil, err | ||
| } | ||
|
|
||
| hubConfig.TLSClientConfig.CAFile = caBundle |
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.
we should only set caBundle or caData
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.
fixed in this commit
Signed-off-by: Zhiying Lin <zhiyingl456@gmail.com> Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
Description of your changes
This is following up some comments on another PR: #364 after PR merged.
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer