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

Improve unit test of certificate package #4204

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pkg/apiserver/certificate/cacert_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"bytes"
"context"
"fmt"
"sync"
"time"

v1 "k8s.io/api/admissionregistration/v1"
Expand All @@ -44,8 +43,6 @@ const (
// CACertController is responsible for taking the CA certificate from the
// caContentProvider and publishing it to the ConfigMap and the APIServices.
type CACertController struct {
mutex sync.RWMutex
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unused field.


// caContentProvider provides the very latest content of the ca bundle.
caContentProvider dynamiccertificates.CAContentProvider
// queue only ever has one item, but it has nice error handling backoff/retry semantics
Expand Down Expand Up @@ -177,7 +174,7 @@ func (c *CACertController) syncConversionWebhooks(caCert []byte) error {
}
if updated {
if _, err := c.apiExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Update(context.TODO(), crdDef, metav1.UpdateOptions{}); err != nil {
return err
return fmt.Errorf("error updating antrea CA cert of CustomResourceDefinition %s: %v", name, err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keep the error format the same as other sync functions.

}
}
}
Expand Down
Loading