37 Star 403 Fork 75

GVPrancher/rancher

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
namespace.go 345 Bytes
Copy Edit Raw Blame History
Dan Ramich authored 2019-06-12 13:38 . goimport linting changes
package namespace
import v1 "k8s.io/api/core/v1"
var projectIDAnnotation = "field.cattle.io/projectId"
func NsByProjectID(obj interface{}) ([]string, error) {
ns, ok := obj.(*v1.Namespace)
if !ok {
return []string{}, nil
}
if id, ok := ns.Annotations[projectIDAnnotation]; ok {
return []string{id}, nil
}
return []string{}, nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.13

Search