mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
chore: validate endpoints is not empty in update machine requests
This commit is contained in:
@@ -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