mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
add --mode flag to run command
This commit is contained in:
@@ -22,6 +22,8 @@ type ServiceOptions struct {
|
||||
Image string
|
||||
Name string
|
||||
Machine string
|
||||
// Mode is the replication mode of the service.
|
||||
Mode string
|
||||
Publish []string
|
||||
}
|
||||
|
||||
@@ -39,6 +41,14 @@ func (c *Client) RunService(ctx context.Context, opts *ServiceOptions) (RunServi
|
||||
return resp, fmt.Errorf("invalid image: %w", err)
|
||||
}
|
||||
|
||||
switch opts.Mode {
|
||||
case docker.DeployModeReplicated:
|
||||
case docker.DeployModeGlobal:
|
||||
return resp, errors.New("global mode is not supported yet")
|
||||
default:
|
||||
return resp, fmt.Errorf("invalid mode: %q", opts.Mode)
|
||||
}
|
||||
|
||||
// Find a machine to run the service on.
|
||||
listResp, err := c.ListMachines(ctx, &emptypb.Empty{})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user