|  |  | @ -5,6 +5,7 @@ import ( | 
			
		
	
		
		
			
				
					
					|  |  |  | 	"fmt" |  |  |  | 	"fmt" | 
			
		
	
		
		
			
				
					
					|  |  |  | 	"io" |  |  |  | 	"io" | 
			
		
	
		
		
			
				
					
					|  |  |  | 	"os" |  |  |  | 	"os" | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	"sort" | 
			
		
	
		
		
			
				
					
					|  |  |  | 	"strings" |  |  |  | 	"strings" | 
			
		
	
		
		
			
				
					
					|  |  |  | 	"text/tabwriter" |  |  |  | 	"text/tabwriter" | 
			
		
	
		
		
			
				
					
					|  |  |  | 	"time" |  |  |  | 	"time" | 
			
		
	
	
		
		
			
				
					|  |  | @ -45,23 +46,30 @@ func runLs(dockerCli command.Cli, in lsOptions) error { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		builders[i] = &nginfo{ng: ng} |  |  |  | 		builders[i] = &nginfo{ng: ng} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	list, err := dockerCli.ContextStore().List() |  |  |  | 	contexts, err := dockerCli.ContextStore().List() | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 	if err != nil { |  |  |  | 	if err != nil { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return err |  |  |  | 		return err | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	ctxbuilders := make([]*nginfo, len(list)) |  |  |  | 	sort.Slice(contexts, func(i, j int) bool { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	for i, l := range list { |  |  |  | 		return contexts[i].Name < contexts[j].Name | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		ctxbuilders[i] = &nginfo{ng: &store.NodeGroup{ |  |  |  | 	}) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			Name: l.Name, |  |  |  | 	for _, c := range contexts { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		ngi := &nginfo{ng: &store.NodeGroup{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			Name: c.Name, | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Nodes: []store.Node{{ |  |  |  | 			Nodes: []store.Node{{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Name:     l.Name, |  |  |  | 				Name:     c.Name, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				Endpoint: l.Name, |  |  |  | 				Endpoint: c.Name, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			}}, |  |  |  | 			}}, | 
			
		
	
		
		
			
				
					
					|  |  |  | 		}} |  |  |  | 		}} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		// if a context has the same name as an instance from the store, do not
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		// add it to the builders list. An instance from the store takes
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		// precedence over context builders.
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if hasNodeGroup(builders, ngi) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			continue | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		builders = append(builders, ngi) | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	builders = append(builders, ctxbuilders...) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	eg, _ := errgroup.WithContext(ctx) |  |  |  | 	eg, _ := errgroup.WithContext(ctx) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	for _, b := range builders { |  |  |  | 	for _, b := range builders { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |