Skip to content

Commit

Permalink
microcloud/cmd/microcloud: Update microceph disk args
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Hershberger <[email protected]>
  • Loading branch information
MggMuggins committed Apr 10, 2024
1 parent 4fa7264 commit d04299d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
8 changes: 7 additions & 1 deletion microcloud/cmd/microcloud/ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,13 @@ func (c *CmdControl) askRemotePool(systems map[string]InitSystem, autoSetup bool
system.MicroCephDisks = []cephTypes.DisksPost{}
}

system.MicroCephDisks = append(system.MicroCephDisks, cephTypes.DisksPost{Path: path, Wipe: wipeMap[entry]})
system.MicroCephDisks = append(
system.MicroCephDisks,
cephTypes.DisksPost{
Path: []string{path},
Wipe: wipeMap[entry],
},
)

systems[target] = system
}
Expand Down
2 changes: 1 addition & 1 deletion microcloud/cmd/microcloud/main_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func setupCluster(s *service.Handler, systems map[string]InitSystem) error {
}

logger.Debug("Adding disk to MicroCeph", logger.Ctx{"peer": s.Name, "disk": disk.Path})
err = cephClient.AddDisk(context.Background(), c, &disk)
_, err = cephClient.AddDisk(context.Background(), c, &disk)
if err != nil {
return err
}
Expand Down
16 changes: 14 additions & 2 deletions microcloud/cmd/microcloud/main_init_preseed.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,13 @@ func (p *Preseed) Parse(s *service.Handler, bootstrap bool) (map[string]InitSyst
}

for _, disk := range directCeph {
system.MicroCephDisks = append(system.MicroCephDisks, cephTypes.DisksPost{Path: disk.Path, Wipe: disk.Wipe})
system.MicroCephDisks = append(
system.MicroCephDisks,
cephTypes.DisksPost{
Path: []string{disk.Path},
Wipe: disk.Wipe,
},
)
}

// Setup ceph pool for disks specified to MicroCeph.
Expand Down Expand Up @@ -566,7 +572,13 @@ func (p *Preseed) Parse(s *service.Handler, bootstrap bool) (map[string]InitSyst
}

for _, disk := range matched {
system.MicroCephDisks = append(system.MicroCephDisks, cephTypes.DisksPost{Path: parseDiskPath(disk), Wipe: filter.Wipe})
system.MicroCephDisks = append(
system.MicroCephDisks,
cephTypes.DisksPost{
Path: []string{parseDiskPath(disk)},
Wipe: filter.Wipe,
},
)
// There should only be one ceph pool per system.
if !addedCephPool {
if bootstrap {
Expand Down

0 comments on commit d04299d

Please sign in to comment.