2019-11-08 18:57:27 -08:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
2019-11-13 13:41:08 -08:00
|
|
|
kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
2019-12-30 17:08:50 -08:00
|
|
|
client "github.com/nirmata/kyverno/pkg/dclient"
|
|
|
|
"github.com/nirmata/kyverno/pkg/engine/context"
|
2019-11-08 18:57:27 -08:00
|
|
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
|
|
|
)
|
|
|
|
|
|
|
|
// PolicyContext contains the contexts for engine to process
|
|
|
|
type PolicyContext struct {
|
|
|
|
// policy to be processed
|
|
|
|
Policy kyverno.ClusterPolicy
|
|
|
|
// resource to be processed
|
2019-11-13 13:13:07 -08:00
|
|
|
NewResource unstructured.Unstructured
|
|
|
|
// old Resource - Update operations
|
|
|
|
OldResource unstructured.Unstructured
|
2020-01-07 10:33:28 -08:00
|
|
|
AdmissionInfo kyverno.RequestInfo
|
2019-11-13 15:46:43 -08:00
|
|
|
// Dynamic client - used by generate
|
|
|
|
Client *client.Client
|
2019-12-30 17:08:50 -08:00
|
|
|
// Contexts to store resources
|
|
|
|
Context context.EvalInterface
|
2019-11-08 18:57:27 -08:00
|
|
|
}
|