Documentation
¶
Index ¶
- func ClearInventoryObj(infos []*resource.Info) error
- func CreateInventoryObj(inventoryTemplate *resource.Info, resources []*resource.Info) (*resource.Info, error)
- func FindInventoryObj(infos []*resource.Info) (*resource.Info, bool)
- func IsInventoryObject(obj runtime.Object) bool
- func RetrieveInventoryLabel(obj runtime.Object) (string, error)
- func RetrieveObjsFromInventory(infos []*resource.Info) ([]*object.ObjMetadata, error)
- func UnionPastObjs(infos []*resource.Info) ([]object.ObjMetadata, error)
- type MultipleInventoryObjError
- type NoInventoryObjError
- type Options
- type PruneOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearInventoryObj ¶ added in v0.8.0
ClearInventoryObj finds the inventory object in the list of objects, and sets an empty inventory. Returns error if the inventory object is not Unstructured, the inventory object does not exist, or if we can't set the empty inventory on the inventory object. If successful, returns nil.
func CreateInventoryObj ¶ added in v0.8.0
func CreateInventoryObj(inventoryTemplate *resource.Info, resources []*resource.Info) (*resource.Info, error)
CreateInventoryObj creates an inventory object based on a inventory object template. The passed "resources" parameter are applied at the same time as the inventory object, and metadata for each is stored in the inventory object.
func FindInventoryObj ¶ added in v0.8.0
FindInventoryObj returns the "Inventory" object (ConfigMap with inventory label) if it exists, and a boolean describing if it was found.
func IsInventoryObject ¶ added in v0.8.0
IsInventoryObject returns true if the passed object has the inventory label. TODO(seans3): Check type is ConfigMap.
func RetrieveInventoryLabel ¶ added in v0.10.0
RetrieveInventoryLabel returns the string value of the InventoryLabel for the passed object. Returns error if the passed object is nil or is not a inventory object.
func RetrieveObjsFromInventory ¶ added in v0.9.0
func RetrieveObjsFromInventory(infos []*resource.Info) ([]*object.ObjMetadata, error)
RetrieveObjsFromInventoryObj returns a slice of pointers to the object metadata. This function finds the inventory object, then parses the stored resource metadata into ObjMetadata structs. Returns an error if there is a problem parsing the data into ObjMetadata structs, or if the inventory object is not in Unstructured format; nil otherwise. If a inventory object does not exist, or it does not have a "data" map, then returns an empty slice and no error.
func UnionPastObjs ¶ added in v0.10.0
func UnionPastObjs(infos []*resource.Info) ([]object.ObjMetadata, error)
UnionPastObjs takes a set of inventory objects (infos), returning the union of the objects referenced by these inventory objects. Returns an error if any of the passed objects are not inventory objects, or if unable to retrieve the referenced objects from any inventory object.
Types ¶
type MultipleInventoryObjError ¶ added in v0.9.0
func (MultipleInventoryObjError) Error ¶ added in v0.9.0
func (g MultipleInventoryObjError) Error() string
type NoInventoryObjError ¶ added in v0.9.0
type NoInventoryObjError struct{}
func (NoInventoryObjError) Error ¶ added in v0.9.0
func (g NoInventoryObjError) Error() string
type Options ¶ added in v0.8.0
type Options struct { // DryRun defines whether objects should actually be pruned or if // we should just print what would happen without actually doing it. DryRun bool PropagationPolicy metav1.DeletionPropagation }
Options defines a set of parameters that can be used to tune the behavior of the pruner.
type PruneOptions ¶
type PruneOptions struct {
// contains filtered or unexported fields
}
PruneOptions encapsulates the necessary information to implement the prune functionality.
func NewPruneOptions ¶
func NewPruneOptions(currentUids sets.String) *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) error
func (*PruneOptions) Prune ¶
func (po *PruneOptions) Prune(currentObjects []*resource.Info, eventChannel chan<- event.Event, o Options) error
Prune deletes the set of resources which were previously applied (retrieved from previous inventory objects) but omitted in the current apply. Prune also delete all previous inventory objects. Returns an error if there was a problem.
func (*PruneOptions) RetrievePreviousInventoryObjects ¶ added in v0.10.0
func (po *PruneOptions) RetrievePreviousInventoryObjects(label, namespace string) ([]*resource.Info, error)
RetrievePreviousInventoryObjects requests the previous inventory objects using the inventory label from the current inventory object. Sets the field "pastInventoryObjects". Returns an error if the inventory label doesn't exist for the current currentInventoryObject does not exist or if the call to retrieve the past inventory objects fails.