mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 17:37:12 +00:00
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
22 lines
595 B
Go
22 lines
595 B
Go
package utils
|
|
|
|
import (
|
|
"github.com/kyverno/kyverno/pkg/engine/response"
|
|
"github.com/kyverno/kyverno/pkg/policyreport"
|
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
|
)
|
|
|
|
func BuildDeletionPrInfo(oldR unstructured.Unstructured) policyreport.Info {
|
|
return policyreport.Info{
|
|
Namespace: oldR.GetNamespace(),
|
|
Results: []policyreport.EngineResponseResult{
|
|
{Resource: response.ResourceSpec{
|
|
Kind: oldR.GetKind(),
|
|
APIVersion: oldR.GetAPIVersion(),
|
|
Namespace: oldR.GetNamespace(),
|
|
Name: oldR.GetName(),
|
|
UID: string(oldR.GetUID()),
|
|
}},
|
|
},
|
|
}
|
|
}
|