Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the same log filename to logging plugins on start/stop requests #33583

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion daemon/logger/adapter.go
Expand Up @@ -3,6 +3,7 @@ package logger
import (
"io"
"os"
"strings"
"sync"
"time"

Expand All @@ -18,6 +19,7 @@ type pluginAdapter struct {
driverName string
id string
plugin logPlugin
basePath string
fifoPath string
capabilities Capability
logInfo Info
Expand Down Expand Up @@ -56,7 +58,7 @@ func (a *pluginAdapter) Close() error {
a.mu.Lock()
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
}

Expand Down
1 change: 1 addition & 0 deletions daemon/logger/plugin.go
Expand Up @@ -59,6 +59,7 @@ func makePluginCreator(name string, l *logPluginProxy, basePath string) Creator
driverName: name,
id: id,
plugin: l,
basePath: basePath,
fifoPath: filepath.Join(root, id),
logInfo: logCtx,
}
Expand Down