Skip to content

chore: add checks for server ca certificates in refresh.go#1037

Merged
kgala2 merged 5 commits intomainfrom
fix-refresh-panic
Oct 27, 2025
Merged

chore: add checks for server ca certificates in refresh.go#1037
kgala2 merged 5 commits intomainfrom
fix-refresh-panic

Conversation

@kgala2
Copy link
Contributor

@kgala2 kgala2 commented Oct 23, 2025

This change addresses a panic that can occur during the refresh operation if the server CA certificate is not available in the instance metadata.

A nil check is added to validate the server CA certificate before it is used. If the certificate is nil, a refresh error is now returned instead of causing a panic from a nil pointer dereference.

Fixes: #1032

@kgala2 kgala2 marked this pull request as ready for review October 24, 2025 16:43
@kgala2 kgala2 requested a review from a team as a code owner October 24, 2025 16:43
@kgala2 kgala2 requested a review from enocom October 24, 2025 16:44
Copy link
Member

@enocom enocom left a comment

Choose a reason for hiding this comment

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

LGTM.

From an API perspective, is this an acceptable state?

@kgala2
Copy link
Contributor Author

kgala2 commented Oct 24, 2025

LGTM.

From an API perspective, is this an acceptable state?

The API does not return server CA cert while creation (the first minute of it)

@kgala2 kgala2 requested a review from panavenue October 24, 2025 19:00
@kgala2 kgala2 merged commit 2f89504 into main Oct 27, 2025
21 of 22 checks passed
@kgala2 kgala2 deleted the fix-refresh-panic branch October 27, 2025 17: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.

Panic in internal/cloudsql/refresh.go

4 participants