-
Notifications
You must be signed in to change notification settings - Fork 376
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused field.
Codecov Report
@@ Coverage Diff @@
## main #4204 +/- ##
==========================================
+ Coverage 58.30% 60.83% +2.53%
==========================================
Files 384 384
Lines 54376 54375 -1
==========================================
+ Hits 31702 33081 +1379
+ Misses 20257 18873 -1384
- Partials 2417 2421 +4
|
033b832
to
17d2d9e
Compare
17d2d9e
to
56a6814
Compare
existingWebhook *admissionregistrationv1.MutatingWebhookConfiguration | ||
existingOptionalWebhook *admissionregistrationv1.MutatingWebhookConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it simpler to just use an existingWebhook slice, which represents the objects that will be added to storage before testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, refined, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't see update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, misunderstood the comments, merge them into a slice. thanks.
56a6814
to
dcb293d
Compare
Signed-off-by: Lan Luo <luola@vmware.com>
dcb293d
to
5c48b55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/skip-all |
Signed-off-by: Lan Luo <luola@vmware.com>
This is for #4142
Signed-off-by: Lan Luo luola@vmware.com