Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v0.8.0
type Options struct { // DryRunStrategy defines whether objects should actually be pruned or if // we should just print what would happen without actually doing it. DryRunStrategy common.DryRunStrategy PropagationPolicy metav1.DeletionPropagation // InventoryPolicy defines the inventory policy of prune. InventoryPolicy inventory.InventoryPolicy }
Options defines a set of parameters that can be used to tune the behavior of the pruner.
type PruneOptions ¶
type PruneOptions struct { InvClient inventory.InventoryClient // True if we are destroying, which deletes the inventory object // as well (possibly) the inventory namespace. Destroy bool // contains filtered or unexported fields }
PruneOptions encapsulates the necessary information to implement the prune functionality.
func NewPruneOptions ¶
func NewPruneOptions() *PruneOptions
NewPruneOptions returns a struct (PruneOptions) encapsulating the necessary information to run the prune. Returns an error if an error occurs gathering this information.
func (*PruneOptions) Initialize ¶
func (po *PruneOptions) Initialize(factory util.Factory, invClient inventory.InventoryClient) error
func (*PruneOptions) Prune ¶
func (po *PruneOptions) Prune(localInv inventory.InventoryInfo, localObjs []*unstructured.Unstructured, currentUIDs sets.String, taskContext *taskrunner.TaskContext, o Options) error
Prune deletes the set of resources which were previously applied but omitted in the current apply. Calculates the set of objects to prune by removing the currently applied objects from the union set of the previously applied objects and currently applied objects stored in the cluster inventory. As a final step, stores the current inventory which is all the successfully applied objects and the prune failures. Does not stop when encountering prune failures. Returns an error for unrecoverable errors.
Parameters:
localInv - locally read inventory object localObjs - locally read, currently applied (attempted) objects currentUIDs - UIDs for successfully applied objects taskContext - task for apply/prune