Skip to content

fix(webhook): mutex to prevent data race for the use of client set#122

Open
stevensbkang wants to merge 3 commits intodevelopfrom
fix/ks-23/webhook-data-race
Open

fix(webhook): mutex to prevent data race for the use of client set#122
stevensbkang wants to merge 3 commits intodevelopfrom
fix/ks-23/webhook-data-race

Conversation

@stevensbkang
Copy link
Member

No description provided.

@linear
Copy link

linear bot commented Mar 24, 2026

}

// getClientset returns the Kubernetes clientset, or nil if RegisterWebhook has not completed.
func (w *Service) getClientset() *kubernetes.Clientset {

Choose a reason for hiding this comment

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

This is correct in terms of a data-race at the Go level, but please keep in mind that, if RegisterWebhook() gets called again in the future, then some calls will be using the old clientset and some others the new one, all at the same time. This may or may not be a problem, I don't know.

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.

2 participants