1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/e2e/framework/id/id.go
Charles-Edouard Brétéché e1db7c9814
feat: add e2e framework and verify image new test (#4094)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-06-09 21:58:07 +08:00

18 lines
648 B
Go

package id
import (
"k8s.io/apimachinery/pkg/runtime/schema"
)
type Id struct {
gvr schema.GroupVersionResource
ns string
name string
}
func New(gvr schema.GroupVersionResource, ns, name string) Id { return Id{gvr, ns, name} }
func (r Id) GetGvr() schema.GroupVersionResource { return r.gvr }
func (r Id) GetNamespace() string { return r.ns }
func (r Id) GetName() string { return r.name }
func (r Id) IsClustered() bool { return r.ns == "" }
func (r Id) IsNamespaced() bool { return !r.IsClustered() }