1 // Copyright 2021 The Kubernetes Authors. 2 // SPDX-License-Identifier: Apache-2.0 3 4 package filter 5 6 import ( 7 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" 8 ) 9 10 // ValidationFilter interface decouples apply/prune validation 11 // from the concrete structs used for validation. The apply/prune 12 // functionality will run validation filters to remove objects 13 // which should not be applied or pruned. 14 type ValidationFilter interface { 15 // Name returns a filter name (usually for logging). 16 Name() string 17 // Filter returns an error if validation fails, indicating that actuation 18 // should be skipped for this object. 19 Filter(obj *unstructured.Unstructured) error 20 } 21