Skip to content

Commit

Permalink
fix(kubeserver): Not found namespace by cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Nov 20, 2024
1 parent 28e38d5 commit 9cc9ab7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kubeserver/models/namespaceresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ func (m *SNamespaceResourceBaseManager) GetGCQuery() *sqlchemy.SQuery {
}

func (m *SNamespaceResourceBaseManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input *api.NamespaceResourceListInput) (*sqlchemy.SQuery, error) {
log.Infof("=====namespace list input: %s", jsonutils.Marshal(input))
q, err := m.SClusterResourceBaseManager.ListItemFilter(ctx, q, userCred, &input.ClusterResourceListInput)
if err != nil {
return nil, errors.Wrapf(err, "SClusterResourceBaseManager.ListItemFilter with input: %s", jsonutils.Marshal(input.ClusterResourceListInput))
}
log.Infof("=====namespace list input: %s", jsonutils.Marshal(input))
if input.Namespace != "" {
ns, err := GetNamespaceManager().GetByIdOrName(userCred, input.Cluster, input.Namespace)
ns, err := GetNamespaceManager().GetByIdOrName(userCred, input.ClusterId, input.Namespace)
if err != nil {
return nil, errors.Wrapf(err, "Not found namespace %s by cluster %s", input.Namespace, input.Cluster)
}
Expand Down

0 comments on commit 9cc9ab7

Please sign in to comment.