2019-11-09 02:57:27 +00:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
2019-11-13 21:41:08 +00:00
|
|
|
kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
2019-12-31 01:08:50 +00:00
|
|
|
client "github.com/nirmata/kyverno/pkg/dclient"
|
|
|
|
"github.com/nirmata/kyverno/pkg/engine/context"
|
2019-11-09 02:57:27 +00: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 21:13:07 +00:00
|
|
|
NewResource unstructured.Unstructured
|
|
|
|
// old Resource - Update operations
|
|
|
|
OldResource unstructured.Unstructured
|
2020-01-07 18:33:28 +00:00
|
|
|
AdmissionInfo kyverno.RequestInfo
|
2019-11-13 23:46:43 +00:00
|
|
|
// Dynamic client - used by generate
|
|
|
|
Client *client.Client
|
2019-12-31 01:08:50 +00:00
|
|
|
// Contexts to store resources
|
|
|
|
Context context.EvalInterface
|
2019-11-09 02:57:27 +00:00
|
|
|
}
|