-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(VPA): Do not update webhook CA when registerWebhook is disabled #8249
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,8 +68,11 @@ func (cr *certReloader) start(stop <-chan struct{}) error { | |
if err = watcher.Add(cr.tlsKeyPath); err != nil { | ||
return err | ||
} | ||
if err = watcher.Add(cr.clientCaPath); err != nil { | ||
return err | ||
// we watch the CA file ony when registerWebhook is enabled | ||
if cr.mutatingWebhookClient != nil { | ||
if err = watcher.Add(cr.clientCaPath); err != nil { | ||
return err | ||
} | ||
} | ||
|
||
go func() { | ||
|
@@ -123,6 +126,10 @@ func (cr *certReloader) load() error { | |
|
||
func (cr *certReloader) reloadWebhookCA() error { | ||
client := cr.mutatingWebhookClient | ||
if client == nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I'm wrong, but in the current implementation, if the flag is off, then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes but we don't watch the file when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. thanks! adding a comment above line 71 (https://github.com/kubernetes/autoscaler/pull/8249/files#diff-504643e3760ffc997b03797073b201284f6483f8276acd1cf9057c8734e9f5b9R71) will be enough. |
||
// this should never happen as we don't watch the file if mutatingWebhookClient is nil | ||
return fmt.Errorf("webhook client is not set") | ||
} | ||
webhook, err := client.Get(context.TODO(), webhookConfigName, metav1.GetOptions{}) | ||
if err != nil { | ||
return err | ||
|
Uh oh!
There was an error while loading. Please reload this page.