Преглед на файлове

Fixing linter after rebasing

Signed-off-by: Guillaume Tardif <[email protected]>
Guillaume Tardif преди 4 години
родител
ревизия
6a03c4ff03
променени са 5 файла, в които са добавени 15 реда и са изтрити 0 реда
  1. 1 0
      kube/charts/kubernetes/context.go
  2. 5 0
      kube/compose.go
  3. 1 0
      kube/context.go
  4. 5 0
      local/compose/down.go
  5. 3 0
      local/compose/stop.go

+ 1 - 0
kube/charts/kubernetes/context.go

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

+ 5 - 0
kube/compose.go

@@ -85,6 +85,11 @@ func (s *composeService) Start(ctx context.Context, project *types.Project, cons
 	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`
 func (s *composeService) Logs(ctx context.Context, projectName string, consumer compose.LogConsumer, options compose.LogOptions) error {
 	return errdefs.ErrNotImplemented

+ 1 - 0
kube/context.go

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

+ 5 - 0
local/compose/down.go

@@ -113,7 +113,12 @@ func (s *composeService) removeContainers(ctx context.Context, w progress.Writer
 		toDelete := container
 		eg.Go(func() error {
 			eventName := "Container " + getCanonicalContainerName(toDelete)
+			w.Event(progress.StoppingEvent(eventName))
 			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))
 			err = s.apiClient.ContainerRemove(ctx, toDelete.ID, moby.ContainerRemoveOptions{Force: true})
 			if err != nil {

+ 3 - 0
local/compose/stop.go

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