mirror of
https://github.com/rancher/norman.git
synced 2025-09-17 07:40:10 +00:00
Check for cluster name in annotations
This commit is contained in:
committed by
Darren Shepherd
parent
4d46cbab5b
commit
93bfc4ea3a
@@ -30,6 +30,15 @@ func ObjectInCluster(cluster string, obj interface{}) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if clusterName == "" {
|
||||||
|
if a := getValue(obj, "Annotations"); a.IsValid() {
|
||||||
|
if c := a.MapIndex(reflect.ValueOf("field.cattle.io/projectId")); c.IsValid() {
|
||||||
|
if parts := strings.SplitN(c.String(), ":", 2); len(parts) == 2 {
|
||||||
|
clusterName = parts[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return clusterName == cluster
|
return clusterName == cluster
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user