(ctx context.Context, c *scalingo.Client, stackID string)
| 45 | } |
| 46 | |
| 47 | func 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 | } |