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

fix: Ignore audit config not found error when removing the log subsystem #1350

Merged
merged 1 commit into from
Dec 22, 2022
Merged
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
7 changes: 6 additions & 1 deletion pkg/controller/cluster/log-search.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ func (c *Controller) deleteLogHeadlessService(ctx context.Context, tenant *minio
if k8serrors.IsNotFound(err) {
return nil
}
// Delete the audit webhook configuration and ignore config not found error
if _, err := adminClnt.DelConfigKV(ctx, fmt.Sprintf("audit_webhook:%s", tenant.LogSearchAPIDeploymentName())); err != nil {
return err
// TODO(@vadmeste): Remove XMinioConfigError check with is not returned since Dec 2022
if adminErr := madmin.ToErrorResponse(err); adminErr.Code != "XMinioConfigError" &&
adminErr.Code != "XMinioConfigNotFoundError" {
return err
}
}
klog.V(2).Infof("Deleting Log Headless Service for %s", tenant.Namespace)
err = c.kubeClientSet.CoreV1().Services(tenant.Namespace).Delete(ctx, tenant.LogHLServiceName(), metav1.DeleteOptions{})
Expand Down