| 63 | } |
| 64 | |
| 65 | func (a *Application) ContainerName(ctx context.Context) (string, error) { |
| 66 | containers, err := a.namespace.client.ContainerList(ctx, container.ListOptions{All: true}) |
| 67 | if err != nil { |
| 68 | return "", err |
| 69 | } |
| 70 | |
| 71 | for _, c := range containers { |
| 72 | if len(c.Names) == 0 { |
| 73 | continue |
| 74 | } |
| 75 | name := strings.TrimPrefix(c.Names[0], "/") |
| 76 | if a.namespace.containerAppName(name) == a.Settings.Name { |
| 77 | return name, nil |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | return "", fmt.Errorf("no container found for app %s", a.Settings.Name) |
| 82 | } |
| 83 | |
| 84 | func (a *Application) Volume(ctx context.Context) (*ApplicationVolume, error) { |
| 85 | vol, err := FindVolume(ctx, a.namespace, a.Settings.Name) |