Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemovedBackups ¶
RemovedBackups hold backups that are removed from the backup repository.
type RetainedBackups ¶
RetainedBackups hold backups that continue to stay at the backup repository and are not removed.
type Strategy ¶
type Strategy interface {
// FilterForRemoval filters all backups which should or should not be removed by a RetentionManager.
FilterForRemoval(allBackups []k8sv1.Backup) (RemovedBackups, RetainedBackups)
// GetName returns a name of the Strategy implementation.
// The name should roughly describe how the strategy works.
// As the name may be used to be selected by the user,
// the name must only consist of latin characters and ciphers.
GetName() StrategyId
}
Strategy filters a set over all backups into sets of backups that should be removed by the RetentionManager as well as sets of backups that should be kept.
Implementation Note: While Backup processes have a fixed start date, the actual run time of that process may be varying. Because of this, time-measuring implementations (i.e., keep backups for the last seven days) should consider the start date for counting backups. This would allow avoiding timing-related edge-cases of backups whose backup process may swap over to the next day.
type StrategyGetter ¶
type StrategyGetter struct{}
StrategyGetter is capable of returning a Strategy identified by its name.
func NewStrategyGetter ¶
func NewStrategyGetter() *StrategyGetter
NewStrategyGetter creates something capable of returning a Strategy.
func (*StrategyGetter) Get ¶
func (sg *StrategyGetter) Get(name StrategyId) (Strategy, error)
Get returns the Strategy implementation identified by the given name.
type StrategyId ¶
type StrategyId string
StrategyId is an enum identifying a retention strategy.
const ( // KeepAllStrategy retention policy: // The following table gives an overview of the behavior within this strategy: // // | retained backups | time period | // |------------------|-------------| // | ALL | ∞ | // // The maximum of saved backups is ∞. KeepAllStrategy StrategyId = "keepAll" // RemoveAllButKeepLatestStrategy retention policy: // The following table gives an overview of the behavior within this strategy: // // | retained backups | time period | // |------------------|-------------| // | 1 | ∞ | // // The maximum of saved backups is 1. RemoveAllButKeepLatestStrategy StrategyId = "removeAllButKeepLatest" // KeepLastSevenDaysStrategy retention policy: // The following table gives an overview of the behavior within this strategy: // // | retained backups | time period | // |------------------|-------------| // | ALL | 1-7 days | // // The maximum of saved backups is 7 (without consideration of manual backups). KeepLastSevenDaysStrategy StrategyId = "keepLastSevenDays" // KeepLast7DaysOldestOf1Month1Quarter1HalfYear1YearStrategy retention policy: // // The following table gives an overview of the behaviour within this strategy: // // | retained backups | time period | // | ALL | 0 - 7 days | // | 1 | 8 - 30 days | // | 1 | 31 - 90 days | // | 1 | 91 - 180 days | // | 1 | 181 - 360 days | // // The maximum of saved backups is 11 (without consideration of manual backups) // Between interval borders the oldest backup is moving. KeepLast7DaysOldestOf1Month1Quarter1HalfYear1YearStrategy StrategyId = "keep7Days1Month1Quarter1Year" )