mirror of
https://github.com/rancher/k3k.git
synced 2026-08-19 04:16:16 +00:00
check err nillness (#774)
This commit is contained in:
@@ -26,8 +26,10 @@ func RemovePodMutatingWebhook(ctx context.Context, virtualClient, hostClient ctr
|
||||
},
|
||||
}
|
||||
|
||||
if err := hostClient.Delete(ctx, webhookSecret); !apierrors.IsNotFound(err) {
|
||||
return err
|
||||
if err := hostClient.Delete(ctx, webhookSecret); err != nil {
|
||||
if !apierrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
webhook := &admissionregistrationv1.MutatingWebhookConfiguration{
|
||||
@@ -40,8 +42,10 @@ func RemovePodMutatingWebhook(ctx context.Context, virtualClient, hostClient ctr
|
||||
},
|
||||
}
|
||||
|
||||
if err := virtualClient.Delete(ctx, webhook); !apierrors.IsNotFound(err) {
|
||||
return err
|
||||
if err := virtualClient.Delete(ctx, webhook); err != nil {
|
||||
if !apierrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user