forked from toolshed/abra
feat: abra app cp enhancements
This commit is contained in:
@ -68,3 +68,15 @@ func GetContainer(c context.Context, cl *client.Client, filters filters.Args, no
|
||||
|
||||
return containers[0], nil
|
||||
}
|
||||
|
||||
// GetContainerFromStackAndService retrieves the container for the given stack and service.
|
||||
func GetContainerFromStackAndService(cl *client.Client, stack, service string) (types.Container, error) {
|
||||
filters := filters.NewArgs()
|
||||
filters.Add("name", fmt.Sprintf("^%s_%s", stack, service))
|
||||
|
||||
container, err := GetContainer(context.Background(), cl, filters, true)
|
||||
if err != nil {
|
||||
return types.Container{}, err
|
||||
}
|
||||
return container, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user