MCPcopy Create free account
hub / github.com/Scalingo/cli / getStackName

Function getStackName

apps/info.go:47–59  ·  view source on GitHub ↗
(ctx context.Context, c *scalingo.Client, stackID string)

Source from the content-addressed store, hash-verified

45}
46
47func getStackName(ctx context.Context, c *scalingo.Client, stackID string) (string, error) {
48 stacks, err := c.StacksList(ctx)
49 if err != nil {
50 return "", errors.Wrap(ctx, err, "list stacks")
51 }
52
53 for _, stack := range stacks {
54 if stack.ID == stackID {
55 return stack.Name, nil
56 }
57 }
58 return "", errors.Newf(ctx, "unknown stack '%v'", stackID)
59}

Callers 1

InfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected