Skip to content

Commit

Permalink
Unconditionally sync CA cert for Controller webhooks
Browse files Browse the repository at this point in the history
Webhooks are used by other features besided AntreaPolicy. At the moment,
if someone tries to disable AnteraPolicy and enable Egress for example,
the webhooks would not be using the correct CA cert and the Egress API
would not be usable.

Given that we unconditionally create these webhooks in the Antrea
deployment manifest, it makes sense to unconditionally sync the CA cert
for them.

Signed-off-by: Antonin Bas <abas@vmware.com>
  • Loading branch information
antoninbas committed Mar 8, 2022
1 parent 431291f commit 033458e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pkg/apiserver/certificate/cacert_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,16 @@ func (c *CACertController) syncCACert() error {
return err
}

if features.DefaultFeatureGate.Enabled(features.AntreaPolicy) {
if err := c.syncMutatingWebhooks(caCert); err != nil {
return err
}
if err := c.syncValidatingWebhooks(caCert); err != nil {
return err
}
if err := c.syncConversionWebhooks(caCert); err != nil {
return err
}
if err := c.syncMutatingWebhooks(caCert); err != nil {
return err
}
if err := c.syncValidatingWebhooks(caCert); err != nil {
return err
}
if err := c.syncConversionWebhooks(caCert); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 033458e

Please sign in to comment.