mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Logging driver should receive same file in start/stop request
Signed-off-by: Peter Bücker <peter.buecker@gmail.com>
This commit is contained in:
		
							parent
							
								
									cd35e4beee
								
							
						
					
					
						commit
						e908e1a357
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -3,6 +3,7 @@ package logger
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
	"sync"
 | 
						"sync"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,6 +19,7 @@ type pluginAdapter struct {
 | 
				
			||||||
	driverName   string
 | 
						driverName   string
 | 
				
			||||||
	id           string
 | 
						id           string
 | 
				
			||||||
	plugin       logPlugin
 | 
						plugin       logPlugin
 | 
				
			||||||
 | 
						basePath     string
 | 
				
			||||||
	fifoPath     string
 | 
						fifoPath     string
 | 
				
			||||||
	capabilities Capability
 | 
						capabilities Capability
 | 
				
			||||||
	logInfo      Info
 | 
						logInfo      Info
 | 
				
			||||||
| 
						 | 
					@ -56,7 +58,7 @@ func (a *pluginAdapter) Close() error {
 | 
				
			||||||
	a.mu.Lock()
 | 
						a.mu.Lock()
 | 
				
			||||||
	defer a.mu.Unlock()
 | 
						defer a.mu.Unlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := a.plugin.StopLogging(a.fifoPath); err != nil {
 | 
						if err := a.plugin.StopLogging(strings.TrimPrefix(a.fifoPath, a.basePath)); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -59,6 +59,7 @@ func makePluginCreator(name string, l *logPluginProxy, basePath string) Creator
 | 
				
			||||||
			driverName: name,
 | 
								driverName: name,
 | 
				
			||||||
			id:         id,
 | 
								id:         id,
 | 
				
			||||||
			plugin:     l,
 | 
								plugin:     l,
 | 
				
			||||||
 | 
								basePath:   basePath,
 | 
				
			||||||
			fifoPath:   filepath.Join(root, id),
 | 
								fifoPath:   filepath.Join(root, id),
 | 
				
			||||||
			logInfo:    logCtx,
 | 
								logInfo:    logCtx,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue