Fixing linter after rebasing

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2021-01-26 18:20:00 +01:00
parent ecdc170938
commit 6a03c4ff03
5 changed files with 15 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import (
"k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd"
) )
// ListAvailableKubeConfigContexts list kube contexts
func ListAvailableKubeConfigContexts(kubeconfig string) ([]string, error) { func ListAvailableKubeConfigContexts(kubeconfig string) ([]string, error) {
config, err := clientcmd.NewDefaultPathOptions().GetStartingConfig() config, err := clientcmd.NewDefaultPathOptions().GetStartingConfig()
if err != nil { if err != nil {

View File

@ -85,6 +85,11 @@ func (s *composeService) Start(ctx context.Context, project *types.Project, cons
return errdefs.ErrNotImplemented return errdefs.ErrNotImplemented
} }
// Stop executes the equivalent to a `compose stop`
func (s *composeService) Stop(ctx context.Context, project *types.Project, consumer compose.LogConsumer) error {
return errdefs.ErrNotImplemented
}
// Logs executes the equivalent to a `compose logs` // Logs executes the equivalent to a `compose logs`
func (s *composeService) Logs(ctx context.Context, projectName string, consumer compose.LogConsumer, options compose.LogOptions) error { func (s *composeService) Logs(ctx context.Context, projectName string, consumer compose.LogConsumer, options compose.LogOptions) error {
return errdefs.ErrNotImplemented return errdefs.ErrNotImplemented

View File

@ -35,6 +35,7 @@ type ContextParams struct {
FromEnvironment bool FromEnvironment bool
} }
// CreateContextData create Docker context data
func (cp ContextParams) CreateContextData() (interface{}, string, error) { func (cp ContextParams) CreateContextData() (interface{}, string, error) {
if cp.FromEnvironment { if cp.FromEnvironment {
// we use the current kubectl context from a $KUBECONFIG path // we use the current kubectl context from a $KUBECONFIG path

View File

@ -113,7 +113,12 @@ func (s *composeService) removeContainers(ctx context.Context, w progress.Writer
toDelete := container toDelete := container
eg.Go(func() error { eg.Go(func() error {
eventName := "Container " + getCanonicalContainerName(toDelete) eventName := "Container " + getCanonicalContainerName(toDelete)
w.Event(progress.StoppingEvent(eventName))
err := s.stopContainers(ctx, w, []moby.Container{container}) err := s.stopContainers(ctx, w, []moby.Container{container})
if err != nil {
w.Event(progress.ErrorMessageEvent(eventName, "Error while Removing"))
return err
}
w.Event(progress.RemovingEvent(eventName)) w.Event(progress.RemovingEvent(eventName))
err = s.apiClient.ContainerRemove(ctx, toDelete.ID, moby.ContainerRemoveOptions{Force: true}) err = s.apiClient.ContainerRemove(ctx, toDelete.ID, moby.ContainerRemoveOptions{Force: true})
if err != nil { if err != nil {

View File

@ -48,6 +48,9 @@ func (s *composeService) Stop(ctx context.Context, project *types.Project, consu
containers = others containers = others
return err return err
}) })
if err != nil {
return err
}
return eg.Wait() return eg.Wait()
} }