Skip to content

Commit

Permalink
microcloud/cmd: Prompt user to skip ceph/ovn on ineligible systems
Browse files Browse the repository at this point in the history
Since some systems might not be able to join ceph or ovn, this adds a
confirmation (defaults to yes) to ensure the user is aware that some
machines might be missing from disk or network interface selection, and
thus ceph or ovn, respectively.

Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Jun 19, 2023
1 parent 5a10ce1 commit 4969691
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions microcloud/cmd/microcloud/ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ func askDisks(sh *service.ServiceHandler, peers map[string]mdns.ServerInfo, boot
if err != nil {
return nil, nil, err
}

if len(peers) != len(availableDisks) && wantsDisks {
wantsDisks, err = cli.AskBool("Some systems are ineligible for distributed storage. Continue anyway? (yes/no) [default=yes]: ", "yes")
if err != nil {
return nil, nil, err
}
}
}

if wantsDisks {
Expand Down Expand Up @@ -516,6 +523,17 @@ func askNetwork(sh *service.ServiceHandler, peers map[string]mdns.ServerInfo, lx
return nil, nil, nil
}

if len(peers) != len(networks) {
wantsSkip, err := cli.AskBool("Some systems are ineligible for distributed networking. Continue anyway? (yes/no) [default=yes]: ", "yes")
if err != nil {
return nil, nil, err
}

if !wantsSkip {
return nil, nil, nil
}
}

// Uplink selection table.
header := []string{"LOCATION", "IFACE", "TYPE"}
fmt.Println("Select exactly one network interface from each cluster member:")
Expand Down

0 comments on commit 4969691

Please sign in to comment.