Rename snapshots.Manager => exporter.Exporter

This commit is contained in:
Tom Wiesing 2022-10-17 15:41:33 +02:00
parent 063f3f9b7d
commit 8d2855fdcb
No known key found for this signature in database
23 changed files with 105 additions and 100 deletions

View file

@ -2,7 +2,7 @@ package cmd
import (
wisski_distillery "github.com/FAU-CDI/wisski-distillery"
"github.com/FAU-CDI/wisski-distillery/internal/component/snapshots"
"github.com/FAU-CDI/wisski-distillery/internal/component/exporter"
"github.com/FAU-CDI/wisski-distillery/internal/core"
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
"github.com/tkw1536/goprogram/exit"
@ -41,18 +41,18 @@ func (bk backup) Run(context wisski_distillery.Context) error {
// prune old backups
if !bk.NoPrune {
defer logging.LogOperation(func() error {
return dis.ExportManager().PruneExports(context.IOStream)
return dis.Exporter().PruneExports(context.IOStream)
}, context.IOStream, "Pruning old backups")
}
// do the handling
err := dis.ExportManager().MakeExport(context.IOStream, snapshots.ExportTask{
err := dis.Exporter().MakeExport(context.IOStream, exporter.ExportTask{
Dest: bk.Positionals.Dest,
StagingOnly: bk.StagingOnly,
Instance: nil,
BackupDescription: snapshots.BackupDescription{
BackupDescription: exporter.BackupDescription{
ConcurrentSnapshots: bk.ConcurrentSnapshots,
},
})

View file

@ -2,7 +2,7 @@ package cmd
import (
wisski_distillery "github.com/FAU-CDI/wisski-distillery"
"github.com/FAU-CDI/wisski-distillery/internal/component/snapshots"
"github.com/FAU-CDI/wisski-distillery/internal/component/exporter"
"github.com/FAU-CDI/wisski-distillery/internal/core"
"github.com/tkw1536/goprogram/exit"
)
@ -45,7 +45,7 @@ func (sn snapshot) Run(context wisski_distillery.Context) error {
}
// do a snapshot of it!
err = dis.ExportManager().MakeExport(context.IOStream, snapshots.ExportTask{
err = dis.Exporter().MakeExport(context.IOStream, exporter.ExportTask{
Dest: sn.Positionals.Dest,
StagingOnly: sn.StagingOnly,

View file

@ -70,8 +70,8 @@ func (si systemupdate) Run(context wisski_distillery.Context) error {
for _, d := range []string{
dis.Config.DeployRoot,
dis.Instances().Path(),
dis.ExportManager().StagingPath(),
dis.ExportManager().ArchivePath(),
dis.Exporter().StagingPath(),
dis.Exporter().ArchivePath(),
} {
context.Println(d)
if err := dis.Core.Environment.MkdirAll(d, environment.DefaultDirPerm); err != nil {