-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
dynamic reload cluster authentication info for aggregated API servers #85004
Conversation
424bd7b
to
70a1beb
Compare
70a1beb
to
5984ada
Compare
5984ada
to
0afeb3c
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
return result, err | ||
} | ||
proxyCACertFile := path.Join(s.SecureServing.ServerCert.CertDirectory, "proxy-ca.crt") | ||
if err := ioutil.WriteFile(proxyCACertFile, testutil.EncodeCertPEM(proxySigningCert), 0644); err != nil { |
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.
Should the proxyCACertFile be deleted if there is error in subsequent handling in this func ?
|
||
// check to see if we have a change. If the values are the same, do nothing. | ||
existing, ok := uncastExisting.(*caBundleAndVerifier) | ||
if !ok { |
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.
Should c.caBundle be unloaded (cleared) in this case ?
return nil // this can happen if we've been unable load data from the apiserver for some reason | ||
} | ||
|
||
return c.caBundle.Load().(*caBundleAndVerifier).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.
Probably we should add verification that cast to *caBundleAndVerifier is successful.
if err != nil { | ||
return nil, err | ||
} | ||
defer conn.Close() |
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.
It seems we can directly close (without deferring)
if err != nil { | ||
return nil, nil, err | ||
} | ||
conn.Close() |
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.
conn.ConnectionState() depends on completed handshake.
I think we should check the return code from Close() where:
if c.handshakeComplete() {
alertErr = c.closeNotify()
If error is returned from Close(), most likely the assignment on line 77 wouldn't be useful.
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.
conn.ConnectionState() depends on completed handshake.
I think we should check the return code from Close() where:
if c.handshakeComplete() { alertErr = c.closeNotify()
If error is returned from Close(), most likely the assignment on line 77 wouldn't be useful.
Yes, this is a reasonable change. Feel free to get me on slack to review/approve the change. Please update the rest of the file to be consistent.
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.
Created #85284
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
#55) xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
xref: kubernetes/kubernetes#85004 Signed-off-by: Tamal Saha <[email protected]>
Fixes #82141
Final step to automatically reload cluster authentication.
/kind bug
@kubernetes/sig-api-machinery-bugs
/priority important-soon