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

Fix peer connect panic. Fixes #2173 #2174

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Conversation

plorenz
Copy link
Member

@plorenz plorenz commented Jun 28, 2024

No description provided.

@plorenz plorenz requested review from a team as code owners June 28, 2024 18:49
@@ -231,12 +231,14 @@ func (self *ControllerManager) PeersConnected(peers []*event.ClusterPeer) {
selfAsPeer := self.getCurrentAsClusterPeer()
peerFingerprints := ""
for _, peer := range peers {
fingerprint := nfpem.FingerprintFromCertificate(peer.ServerCert[0])
if len(peer.ServerCert) > 0 {
Copy link
Member

Choose a reason for hiding this comment

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

maybe a nit, but why not just test for nil instead of finding the len ?

Copy link
Member

Choose a reason for hiding this comment

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

covers both cases: nil and empty

Copy link
Member

@dovholuknf dovholuknf left a comment

Choose a reason for hiding this comment

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

just a small question wrt nil vs len checking

@plorenz plorenz merged commit 87225e8 into release-next Jul 1, 2024
5 of 6 checks passed
@plorenz plorenz deleted the fix-peer-connect-panic branch July 1, 2024 14:02
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.

3 participants