MCPcopy
hub / github.com/open-policy-agent/gatekeeper / GetPolicyVersion

Function GetPolicyVersion

pkg/gator/policy/labels/labels.go:60–66  ·  view source on GitHub ↗

GetPolicyVersion returns the policy version from annotations.

(obj *unstructured.Unstructured)

Source from the content-addressed store, hash-verified

58
59// GetPolicyVersion returns the policy version from annotations.
60func GetPolicyVersion(obj *unstructured.Unstructured) string {
61 annotations := obj.GetAnnotations()
62 if annotations == nil {
63 return ""
64 }
65 return annotations[AnnotationVersion]
66}
67
68// GetBundle returns the bundle name from labels.
69func GetBundle(obj *unstructured.Unstructured) string {

Callers 4

installPolicyFunction · 0.92
ListManagedTemplatesMethod · 0.92
ListManagedTemplatesMethod · 0.92
TestGetPolicyVersionFunction · 0.85

Calls

no outgoing calls

Tested by 2

ListManagedTemplatesMethod · 0.74
TestGetPolicyVersionFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…