Documentation ¶
Index ¶
- Constants
- type AnnotationPreventedDeletionError
- type ApplyPreventedDeletionError
- type CurrentUIDFilter
- type DependencyActuationMismatchError
- type DependencyFilter
- type DependencyPreventedActuationError
- type FatalError
- type InventoryPolicyApplyFilter
- type InventoryPolicyPruneFilter
- type LocalNamespacesFilter
- type NamespaceInUseError
- type Phase
- type PreventRemoveFilter
- type Relationship
- type ValidationFilter
Constants ¶
const DependencyFilterName = "DependencyFilter"
const PreventRemoveFilterName = "PreventRemoveFilter"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnotationPreventedDeletionError ¶
func (*AnnotationPreventedDeletionError) Error ¶
func (e *AnnotationPreventedDeletionError) Error() string
func (*AnnotationPreventedDeletionError) Is ¶
func (e *AnnotationPreventedDeletionError) Is(err error) bool
type ApplyPreventedDeletionError ¶
func (*ApplyPreventedDeletionError) Error ¶
func (e *ApplyPreventedDeletionError) Error() string
func (*ApplyPreventedDeletionError) Is ¶
func (e *ApplyPreventedDeletionError) Is(err error) bool
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) error
Filter returns a ApplyPreventedDeletionError if the object prune/delete should be skipped.
func (CurrentUIDFilter) Name ¶
func (cuf CurrentUIDFilter) Name() string
Name returns a filter identifier for logging.
type DependencyActuationMismatchError ¶
type DependencyActuationMismatchError struct { Object object.ObjMetadata Strategy actuation.ActuationStrategy Relationship Relationship Relation object.ObjMetadata RelationStrategy actuation.ActuationStrategy }
func (*DependencyActuationMismatchError) Error ¶
func (e *DependencyActuationMismatchError) Error() string
func (*DependencyActuationMismatchError) Is ¶
func (e *DependencyActuationMismatchError) Is(err error) bool
type DependencyFilter ¶
type DependencyFilter struct { TaskContext *taskrunner.TaskContext ActuationStrategy actuation.ActuationStrategy DryRunStrategy common.DryRunStrategy }
DependencyFilter implements ValidationFilter interface to determine if an object can be applied or deleted based on the status of it's dependencies.
func (DependencyFilter) Filter ¶
func (dnrf DependencyFilter) Filter(obj *unstructured.Unstructured) error
Filter returns an error if the specified object should be skipped because at least one of its dependencies is Not Found or Not Reconciled. Typed Errors: - DependencyPreventedActuationError - DependencyActuationMismatchError
func (DependencyFilter) Name ¶
func (dnrf DependencyFilter) Name() string
Name returns the name of the filter for logs and events.
type DependencyPreventedActuationError ¶
type DependencyPreventedActuationError struct { Object object.ObjMetadata Strategy actuation.ActuationStrategy Relationship Relationship Relation object.ObjMetadata RelationPhase Phase RelationActuationStatus actuation.ActuationStatus RelationReconcileStatus actuation.ReconcileStatus }
func (*DependencyPreventedActuationError) Error ¶
func (e *DependencyPreventedActuationError) Error() string
func (*DependencyPreventedActuationError) Is ¶
func (e *DependencyPreventedActuationError) Is(err error) bool
type FatalError ¶
type FatalError struct {
Err error
}
FatalError is a wrapper for filters to indicate an error is unrecoverable, not just a reason to skip actuation.
func NewFatalError ¶
func NewFatalError(err error) *FatalError
func (*FatalError) Error ¶
func (e *FatalError) Error() string
func (*FatalError) Is ¶
func (e *FatalError) Is(err error) bool
type InventoryPolicyApplyFilter ¶
type InventoryPolicyApplyFilter struct { Client dynamic.Interface Mapper meta.RESTMapper Inv inventory.Info InvPolicy inventory.Policy }
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) error
Filter returns an inventory.PolicyPreventedActuationError if the object apply should be skipped.
func (InventoryPolicyApplyFilter) Name ¶
func (ipaf InventoryPolicyApplyFilter) Name() string
Name returns a filter identifier for logging.
type InventoryPolicyPruneFilter ¶
InventoryPolicyPruneFilter 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 (InventoryPolicyPruneFilter) Filter ¶
func (ipf InventoryPolicyPruneFilter) Filter(obj *unstructured.Unstructured) error
Filter returns an inventory.PolicyPreventedActuationError if the object prune/delete should be skipped.
func (InventoryPolicyPruneFilter) Name ¶
func (ipf InventoryPolicyPruneFilter) 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) error
Filter returns a NamespaceInUseError if the object prune/delete should be skipped.
func (LocalNamespacesFilter) Name ¶
func (lnf LocalNamespacesFilter) Name() string
Name returns a filter identifier for logging.
type NamespaceInUseError ¶
type NamespaceInUseError struct {
Namespace string
}
func (*NamespaceInUseError) Error ¶
func (e *NamespaceInUseError) Error() string
func (*NamespaceInUseError) Is ¶
func (e *NamespaceInUseError) Is(err error) bool
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) error
Filter returns a AnnotationPreventedDeletionError if the object prune/delete should be skipped.
func (PreventRemoveFilter) Name ¶
func (prf PreventRemoveFilter) Name() string
Name returns the preferred name for the filter. Usually used for logging.
type Relationship ¶
type Relationship int
const ( RelationshipDependent Relationship = iota // Dependent RelationshipDependency // Dependency )
func (Relationship) String ¶
func (i Relationship) String() string
type ValidationFilter ¶
type ValidationFilter interface { // Name returns a filter name (usually for logging). Name() string // Filter returns an error if validation fails, indicating that actuation // should be skipped for this object. Filter(obj *unstructured.Unstructured) 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.