diff --git a/pkg/models/openpitrix/repos.go b/pkg/models/openpitrix/repos.go index a8f696b184..f31b5ad1d4 100644 --- a/pkg/models/openpitrix/repos.go +++ b/pkg/models/openpitrix/repos.go @@ -220,10 +220,6 @@ func (c *repoOperator) ModifyRepo(id string, request *ModifyRepoRequest) error { if userInfo != nil { cred.Password, _ = userInfo.Password() cred.Username = userInfo.Username() - } else { - // trim the old credential - cred.Password, _ = userInfo.Password() - cred.Username = userInfo.Username() } } else if strings.HasPrefix(*request.URL, "s3://") { cfg := v1alpha1.S3Config{} diff --git a/pkg/models/resources/v1alpha3/federatedingress/federatedingresses.go b/pkg/models/resources/v1alpha3/federatedingress/federatedingresses.go index 13ba1a1df0..ee60153b9f 100644 --- a/pkg/models/resources/v1alpha3/federatedingress/federatedingresses.go +++ b/pkg/models/resources/v1alpha3/federatedingress/federatedingresses.go @@ -73,9 +73,5 @@ func (g *fedIngressGetter) filter(object runtime.Object, filter query.Filter) bo if !ok { return false } - - switch filter.Field { - default: - return v1alpha3.DefaultObjectMetaFilter(deployment.ObjectMeta, filter) - } + return v1alpha3.DefaultObjectMetaFilter(deployment.ObjectMeta, filter) } diff --git a/pkg/models/resources/v1alpha3/ingress/ingresses.go b/pkg/models/resources/v1alpha3/ingress/ingresses.go index 9044e54a89..2c9eb37e0a 100644 --- a/pkg/models/resources/v1alpha3/ingress/ingresses.go +++ b/pkg/models/resources/v1alpha3/ingress/ingresses.go @@ -78,9 +78,5 @@ func (g *ingressGetter) filter(object runtime.Object, filter query.Filter) bool if !ok { return false } - - switch filter.Field { - default: - return v1alpha3.DefaultObjectMetaFilter(deployment.ObjectMeta, filter) - } + return v1alpha3.DefaultObjectMetaFilter(deployment.ObjectMeta, filter) } diff --git a/pkg/models/tenant/metering.go b/pkg/models/tenant/metering.go index 0079c4840f..652a46a78f 100644 --- a/pkg/models/tenant/metering.go +++ b/pkg/models/tenant/metering.go @@ -242,16 +242,9 @@ func (t *tenantOperator) makeQueryOptions(user user.Info, q meteringv1alpha1.Que return } if decision != authorizer.DecisionAllow { - if q.WorkspaceName != "" { - // specified by WorkspaceName & NamespaceName and not allowed - if q.NamespaceName != "" { - return qo, errors.New(fmt.Sprintf(meteringv1alpha1.ErrScopeNotAllowed, nsScope)) - } - } else { - // specified by NamespaceName & NamespaceName and not allowed - if q.NamespaceName != "" { - return qo, errors.New(fmt.Sprintf(meteringv1alpha1.ErrScopeNotAllowed, nsScope)) - } + // specified by WorkspaceName & NamespaceName and not allowed + if q.NamespaceName != "" { + return qo, errors.New(fmt.Sprintf(meteringv1alpha1.ErrScopeNotAllowed, nsScope)) } if q.ResourceFilter == "" {