Create new 'extras' components for management

This commit is contained in:
Tom Wiesing 2022-10-01 20:18:58 +02:00
parent b6c36b5488
commit 698f04e13e
No known key found for this signature in database
3 changed files with 29 additions and 5 deletions

View file

@ -1,4 +1,4 @@
package control
package extras
import (
"path/filepath"
@ -6,12 +6,18 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/component"
)
func (*Control) BackupName() string {
// Config implements backing up configuration
type Config struct {
component.ComponentBase
}
func (Config) Name() string { return "extra-config" }
func (*Config) BackupName() string {
return "config"
}
// Backup backups all control plane configuration files into dest
func (control *Control) Backup(context component.StagingContext) error {
func (control *Config) Backup(context component.StagingContext) error {
files := control.backupFiles()
return context.AddDirectory("", func() error {
@ -26,7 +32,7 @@ func (control *Control) Backup(context component.StagingContext) error {
}
// backupfiles lists the files to be backed up.
func (control *Control) backupFiles() []string {
func (control *Config) backupFiles() []string {
return []string{
control.Config.ConfigPath,
control.Config.ExecutablePath(),

View file

@ -0,0 +1,2 @@
// Package extras implements additional components to be used for backups and snapshots
package extras