Skip to content

Commit

Permalink
Merge pull request kubesphere#4406 from RolandMa1986/fix-quility
Browse files Browse the repository at this point in the history
Fix sonarqube scan results
  • Loading branch information
ks-ci-bot authored Nov 2, 2021
2 parents eee3b7d + d1adef0 commit 4d87f59
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 24 deletions.
4 changes: 0 additions & 4 deletions pkg/models/openpitrix/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 1 addition & 5 deletions pkg/models/resources/v1alpha3/ingress/ingresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
13 changes: 3 additions & 10 deletions pkg/models/tenant/metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down

0 comments on commit 4d87f59

Please sign in to comment.