-
Notifications
You must be signed in to change notification settings - Fork 250
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
feat: project-manager支持原生ns接口 #3612
Conversation
f2fdc14
to
84d876e
Compare
84d876e
to
b7d776d
Compare
return errorx.NewClusterErr(err.Error()) | ||
} | ||
|
||
if req.GetProjectIDOrCode() != "-" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以提前返回,if 层级太多了
if err := json.Unmarshal(ns.Object.Raw, &pom); err != nil { | ||
return namespaceList, err | ||
} | ||
if shared && pom.Annotations != nil && pom.Annotations[constant.AnnotationKeyProjectCode] != projectCode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是
if !shared {
continue
}
if pom.Annotations == nil {
continue
}
if pom.Annotations[constant.AnnotationKeyProjectCode] != projectCode {
continue
}
if err != nil { | ||
return errorx.NewInnerErr(err.Error()) | ||
} | ||
mt, err = nsutils.FilterTableNamespaces(mt, true, project.ProjectCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里都是共享集群,没必要传递共享集群标志
47dea7c
to
63eda50
Compare
feat: project-manager支持原生ns接口