update dependencies (#6519)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-ldap/ldap"
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/klog/v2"
|
||||
appv2 "kubesphere.io/api/application/v2"
|
||||
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
|
||||
@@ -70,9 +69,7 @@ func (h *appHandler) DeleteCategory(req *restful.Request, resp *restful.Response
|
||||
}
|
||||
|
||||
if category.Status.Total > 0 {
|
||||
msg := fmt.Sprintf("can not delete helm category: %s which owns applications", categoryId)
|
||||
klog.Warningf(msg)
|
||||
api.HandleInternalError(resp, nil, errors.New(msg))
|
||||
api.HandleInternalError(resp, nil, fmt.Errorf("can not delete helm category: %s which owns applications", categoryId))
|
||||
return
|
||||
}
|
||||
err = h.client.Delete(req.Request.Context(), &appv2.Category{ObjectMeta: metav1.ObjectMeta{Name: categoryId}})
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@@ -85,7 +86,7 @@ func (c *registryGetter) VerifyRegistryCredential(credential api.RegistryCredent
|
||||
if resp.Status == loginSuccess {
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf(resp.Status)
|
||||
return errors.New(resp.Status)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
package resource
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
@@ -56,11 +57,11 @@ func TestResourceGetter(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
result, err := resource.List(test.Resource, test.Namespace, test.Query)
|
||||
if err != test.ExpectError {
|
||||
if !errors.Is(err, test.ExpectError) {
|
||||
t.Errorf("expected error: %s, got: %s", test.ExpectError, err)
|
||||
}
|
||||
if diff := cmp.Diff(test.ExpectResponse, result); diff != "" {
|
||||
t.Errorf(diff)
|
||||
t.Error(diff)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ func (t *tenantOperator) checkWorkspaceTemplatePermission(user user.Info, worksp
|
||||
return err
|
||||
}
|
||||
if authorize != authorizer.DecisionAllow {
|
||||
return errors.NewForbidden(tenantv1beta1.Resource(tenantv1beta1.ResourcePluralWorkspaceTemplate), workspace, fmt.Errorf(reason))
|
||||
return errors.NewForbidden(tenantv1beta1.Resource(tenantv1beta1.ResourcePluralWorkspaceTemplate), workspace, fmt.Errorf("reason: %s", reason))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user