mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
chore: validate endpoints is not empty in update machine requests
This commit is contained in:
1 parent
4de17cb63c
commit
2405b156e4
2 files changed
+22
No files matched your search
@@ -260,6 +260,9 @@ func (c *Cluster) UpdateMachine(ctx context.Context, req *pb.UpdateMachineReques
|
||||
}
|
||||
}
|
||||
if req.Endpoints != nil {
|
||||
if len(req.Endpoints) == 0 {
|
||||
return nil, status.Error(codes.InvalidArgument, "endpoints cannot be empty")
|
||||
}
|
||||
updatedMachine.Network.Endpoints = req.Endpoints
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user