Skip to content

Commit

Permalink
Global resolution for nsc run --on (#1364)
Browse files Browse the repository at this point in the history
Towards NSL-4973
  • Loading branch information
n-g authored Dec 27, 2024
1 parent 18b6bfd commit 5e0c08a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/cli/cmd/cluster/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,18 @@ func CreateContainerInstance(ctx context.Context, machineType string, duration t
return resp, nil
}

res, err := api.EnsureCluster(ctx, api.Methods, nil, target)
if err != nil {
return nil, err
}

return tasks.Return(ctx, tasks.Action("nscloud.start-containers").HumanReadablef("Starting containers"),
func(ctx context.Context) (*api.CreateContainersResponse, error) {
var response api.StartContainersResponse
if err := api.Methods.StartContainers.Do(ctx, api.StartContainersRequest{
Id: target,
Container: []*api.ContainerRequest{container},
}, endpoint.ResolveRegionalEndpoint, fnapi.DecodeJSONResponse(&response)); err != nil {
}, api.MaybeEndpoint(res.Cluster.ApiEndpoint), fnapi.DecodeJSONResponse(&response)); err != nil {
return nil, err
}

Expand Down

0 comments on commit 5e0c08a

Please sign in to comment.