mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
commands: fix invalid reload on boot
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@ -33,6 +33,9 @@ func (ng *NodeGroup) Leave(name string) error {
|
||||
func (ng *NodeGroup) Update(name, endpoint string, platforms []string, endpointsSet bool, actionAppend bool) error {
|
||||
i := ng.findNode(name)
|
||||
if i == -1 && !actionAppend {
|
||||
if len(ng.Nodes) > 0 {
|
||||
return errors.Errorf("node %s not found, did you mean to append?", name)
|
||||
}
|
||||
ng.Nodes = nil
|
||||
}
|
||||
if i != -1 {
|
||||
@ -87,13 +90,12 @@ func (ng *NodeGroup) validateDuplicates(ep string) error {
|
||||
}
|
||||
|
||||
func (ng *NodeGroup) findNode(name string) int {
|
||||
i := -1
|
||||
for ii, n := range ng.Nodes {
|
||||
for i, n := range ng.Nodes {
|
||||
if n.Name == name {
|
||||
i = ii
|
||||
return i
|
||||
}
|
||||
}
|
||||
return i
|
||||
return -1
|
||||
}
|
||||
|
||||
func (ng *NodeGroup) nextNodeName() string {
|
||||
|
Reference in New Issue
Block a user