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 ¶ added in v0.30.0
func (*AnnotationPreventedDeletionError) Error ¶ added in v0.30.0
func (e *AnnotationPreventedDeletionError) Error() string
func (*AnnotationPreventedDeletionError) Is ¶ added in v0.30.0
func (e *AnnotationPreventedDeletionError) Is(err error) bool
type ApplyPreventedDeletionError ¶ added in v0.30.0
func (*ApplyPreventedDeletionError) Error ¶ added in v0.30.0
func (e *ApplyPreventedDeletionError) Error() string
func (*ApplyPreventedDeletionError) Is ¶ added in v0.30.0
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 ¶ added in v0.30.0
type DependencyActuationMismatchError struct { Object object.ObjMetadata Strategy actuation.ActuationStrategy Relationship Relationship Relation object.ObjMetadata RelationStrategy actuation.ActuationStrategy }
func (*DependencyActuationMismatchError) Error ¶ added in v0.30.0
func (e *DependencyActuationMismatchError) Error() string
func (*DependencyActuationMismatchError) Is ¶ added in v0.30.0
func (e *DependencyActuationMismatchError) Is(err error) bool
type DependencyFilter ¶ added in v0.29.0
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 ¶ added in v0.29.0
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 ¶ added in v0.29.0
func (dnrf DependencyFilter) Name() string
Name returns the name of the filter for logs and events.
type DependencyPreventedActuationError ¶ added in v0.30.0
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 ¶ added in v0.30.0
func (e *DependencyPreventedActuationError) Error() string
func (*DependencyPreventedActuationError) Is ¶ added in v0.30.0
func (e *DependencyPreventedActuationError) Is(err error) bool
type FatalError ¶ added in v0.30.0
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 ¶ added in v0.30.0
func NewFatalError(err error) *FatalError
func (*FatalError) Error ¶ added in v0.30.0
func (e *FatalError) Error() string
func (*FatalError) Is ¶ added in v0.30.0
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 ¶ added in v0.30.0
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 ¶ added in v0.30.0
func (ipf InventoryPolicyPruneFilter) Filter(obj *unstructured.Unstructured) error
Filter returns an inventory.PolicyPreventedActuationError if the object prune/delete should be skipped.
func (InventoryPolicyPruneFilter) Name ¶ added in v0.30.0
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 ¶ added in v0.30.0
type NamespaceInUseError struct {
Namespace string
}
func (*NamespaceInUseError) Error ¶ added in v0.30.0
func (e *NamespaceInUseError) Error() string
func (*NamespaceInUseError) Is ¶ added in v0.30.0
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 ¶ added in v0.29.0
type Relationship int
const ( RelationshipDependent Relationship = iota // Dependent RelationshipDependency // Dependency )
func (Relationship) String ¶ added in v0.29.0
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.