Documentation ¶
Index ¶
Constants ¶
const PreventRemoveFilterName = "PreventRemoveFilter"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentUIDFilter ¶
CurrentUIDFilter implements ValidationFilter interface to determine if an object should not be pruned (deleted) because it has recently been applied.
func (CurrentUIDFilter) Filter ¶
func (cuf CurrentUIDFilter) Filter(obj *unstructured.Unstructured) (bool, string, error)
Filter returns true if the passed object should NOT be pruned (deleted) because it has recently been applied.
func (CurrentUIDFilter) Name ¶
func (cuf CurrentUIDFilter) Name() string
Name returns a filter identifier for logging.
type InventoryPolicyApplyFilter ¶
type InventoryPolicyApplyFilter struct { Client dynamic.Interface Mapper meta.RESTMapper Inv inventory.InventoryInfo InvPolicy inventory.InventoryPolicy }
InventoryPolicyApplyFilter implements ValidationFilter interface to determine if an object should be applied based on the cluster object's inventory id, the id for the inventory object, and the inventory policy.
func (InventoryPolicyApplyFilter) Filter ¶
func (ipaf InventoryPolicyApplyFilter) Filter(obj *unstructured.Unstructured) (bool, string, error)
Filter returns true if the passed object should be filtered (NOT applied) and a filter reason string; false otherwise. Returns an error if one occurred during the filter calculation
func (InventoryPolicyApplyFilter) Name ¶
func (ipaf InventoryPolicyApplyFilter) Name() string
Name returns a filter identifier for logging.
type InventoryPolicyFilter ¶
type InventoryPolicyFilter struct { Inv inventory.InventoryInfo InvPolicy inventory.InventoryPolicy }
InventoryPolicyFilter implements ValidationFilter interface to determine if an object should be pruned (deleted) because of the InventoryPolicy and if the objects owning inventory identifier matchs the inventory id.
func (InventoryPolicyFilter) Filter ¶
func (ipf InventoryPolicyFilter) Filter(obj *unstructured.Unstructured) (bool, string, error)
Filter returns true if the passed object should NOT be pruned (deleted) because the "prevent remove" annotation is present; otherwise returns false. Never returns an error.
func (InventoryPolicyFilter) Name ¶
func (ipf InventoryPolicyFilter) Name() string
Name returns a filter identifier for logging.
type LocalNamespacesFilter ¶
LocalNamespacesFilter encapsulates the set of namespaces that are currently in use. Used to ensure we do not delete namespaces with currently applied objects in them.
func (LocalNamespacesFilter) Filter ¶
func (lnf LocalNamespacesFilter) Filter(obj *unstructured.Unstructured) (bool, string, error)
Filter returns true if the passed object should NOT be pruned (deleted) because the it is a namespace that objects still reside in; otherwise returns false. This filter should not be added to the list of filters for "destroying", since every object is being delete. Never returns an error.
func (LocalNamespacesFilter) Name ¶
func (lnf LocalNamespacesFilter) Name() string
Name returns a filter identifier for logging.
type PreventRemoveFilter ¶
type PreventRemoveFilter struct{}
PreventRemoveFilter implements ValidationFilter interface to determine if an object should not be pruned (deleted) because of a "prevent remove" annotation.
func (PreventRemoveFilter) Filter ¶
func (prf PreventRemoveFilter) Filter(obj *unstructured.Unstructured) (bool, string, error)
Filter returns true if the passed object should NOT be pruned (deleted) because the "prevent remove" annotation is present; otherwise returns false. Never returns an error.
func (PreventRemoveFilter) Name ¶
func (prf PreventRemoveFilter) Name() string
Name returns the preferred name for the filter. Usually used for logging.
type ValidationFilter ¶
type ValidationFilter interface { // Name returns a filter name (usually for logging). Name() string // Filter returns true if validation fails. If true a // reason string is included in the return. If an error happens // during filtering it is returned. Filter(obj *unstructured.Unstructured) (bool, string, error) }
ValidationFilter interface decouples apply/prune validation from the concrete structs used for validation. The apply/prune functionality will run validation filters to remove objects which should not be applied or pruned.