Create new 'extras' components for management
This commit is contained in:
parent
b6c36b5488
commit
698f04e13e
3 changed files with 29 additions and 5 deletions
|
|
@ -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(),
|
||||
2
internal/component/extras/extras.go
Normal file
2
internal/component/extras/extras.go
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// Package extras implements additional components to be used for backups and snapshots
|
||||
package extras
|
||||
Loading…
Add table
Add a link
Reference in a new issue