Skip to content

Commit 256b523

Browse files
committed
dump/restore tools.yaml
1 parent 0b3b671 commit 256b523

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

cmd/docker-mcp/backup/dump.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func Dump(ctx context.Context, docker docker.Client) ([]byte, error) {
2626
return nil, err
2727
}
2828

29+
toolsConfig, err := config.ReadTools(ctx, docker)
30+
if err != nil {
31+
return nil, err
32+
}
33+
2934
catalogConfig, err := catalog.ReadConfig()
3035
if err != nil {
3136
return nil, err
@@ -74,6 +79,7 @@ func Dump(ctx context.Context, docker docker.Client) ([]byte, error) {
7479
Registry: string(registryContent),
7580
Catalog: string(catalogContent),
7681
CatalogFiles: catalogFiles,
82+
Tools: string(toolsConfig),
7783
Secrets: secrets,
7884
Policy: policy,
7985
}

cmd/docker-mcp/backup/restore.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ func Restore(ctx context.Context, backupData []byte) error {
2121
if err := config.WriteRegistry([]byte(backup.Registry)); err != nil {
2222
return err
2323
}
24+
if err := config.WriteTools([]byte(backup.Tools)); err != nil {
25+
return err
26+
}
2427

2528
catalogBefore, err := catalog.ReadConfig()
2629
if err != nil {

cmd/docker-mcp/backup/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Backup struct {
77
Registry string `json:"registry"`
88
Catalog string `json:"catalog"`
99
CatalogFiles map[string]string `json:"catalogFiles"`
10+
Tools string `json:"tools"`
1011
Secrets []desktop.Secret `json:"secrets"`
1112
Policy string `json:"policy"`
1213
}

0 commit comments

Comments
 (0)