1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/pkg/policy/utils.go
2020-12-15 15:21:39 -08:00

13 lines
313 B
Go

package policy
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
func isRunningPod(obj unstructured.Unstructured) bool {
objMap := obj.UnstructuredContent()
phase, ok, err := unstructured.NestedString(objMap, "status", "phase")
if !ok || err != nil {
return false
}
return phase == "Running"
}