mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Add default entity and edge to graph on runtime load
This commit is contained in:
		
							parent
							
								
									94e5081bac
								
							
						
					
					
						commit
						2e6b241dc7
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -257,6 +257,13 @@ func (runtime *Runtime) restore() error {
 | 
			
		|||
		return len(ic.Links) < len(jc.Links)
 | 
			
		||||
	})
 | 
			
		||||
	for _, container := range containers {
 | 
			
		||||
 | 
			
		||||
		// Try to set the default name for a container if it exists prior to links
 | 
			
		||||
		// Ignore the error because if it already exists you will get an invalid constraint
 | 
			
		||||
		if _, err := runtime.containerGraph.Set(fmt.Sprintf("/%s", container.ID), container.ID); err != nil {
 | 
			
		||||
			utils.Debugf("Setting default id - %s", err)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err := runtime.Register(container); err != nil {
 | 
			
		||||
			utils.Debugf("Failed to register container %s: %s", container.ID, err)
 | 
			
		||||
			continue
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue