mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 18:06:55 +00:00
15 lines
207 B
Go
15 lines
207 B
Go
|
package utils
|
||
|
|
||
|
type Named interface {
|
||
|
GetNamespace() string
|
||
|
GetName() string
|
||
|
}
|
||
|
|
||
|
func Key(obj Named) string {
|
||
|
n, ns := obj.GetName(), obj.GetNamespace()
|
||
|
if ns == "" {
|
||
|
return n
|
||
|
}
|
||
|
return ns + "/" + n
|
||
|
}
|