Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
bb4fbc27
Unverified
Commit
bb4fbc27
authored
Nov 09, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70821 from RenaudWasTaken/fix-pluginwatcher-panic
Pluginwatcher: Fix panic on failed startup
parents
413ccb15
11fef8ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
plugin_watcher.go
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
+10
-1
No files found.
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
View file @
bb4fbc27
...
@@ -175,10 +175,17 @@ func (w *Watcher) init() error {
...
@@ -175,10 +175,17 @@ func (w *Watcher) init() error {
}
}
// Walks through the plugin directory discover any existing plugin sockets.
// Walks through the plugin directory discover any existing plugin sockets.
// Goroutines started here will be waited for in Stop() before cleaning up.
// Ignore all errors except root dir not being walkable
func
(
w
*
Watcher
)
traversePluginDir
(
dir
string
)
error
{
func
(
w
*
Watcher
)
traversePluginDir
(
dir
string
)
error
{
return
w
.
fs
.
Walk
(
dir
,
func
(
path
string
,
info
os
.
FileInfo
,
err
error
)
error
{
return
w
.
fs
.
Walk
(
dir
,
func
(
path
string
,
info
os
.
FileInfo
,
err
error
)
error
{
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error accessing path: %s error: %v"
,
path
,
err
)
if
path
==
dir
{
return
fmt
.
Errorf
(
"error accessing path: %s error: %v"
,
path
,
err
)
}
glog
.
Errorf
(
"error accessing path: %s error: %v"
,
path
,
err
)
return
nil
}
}
switch
mode
:=
info
.
Mode
();
{
switch
mode
:=
info
.
Mode
();
{
...
@@ -187,7 +194,9 @@ func (w *Watcher) traversePluginDir(dir string) error {
...
@@ -187,7 +194,9 @@ func (w *Watcher) traversePluginDir(dir string) error {
return
fmt
.
Errorf
(
"failed to watch %s, err: %v"
,
path
,
err
)
return
fmt
.
Errorf
(
"failed to watch %s, err: %v"
,
path
,
err
)
}
}
case
mode
&
os
.
ModeSocket
!=
0
:
case
mode
&
os
.
ModeSocket
!=
0
:
w
.
wg
.
Add
(
1
)
go
func
()
{
go
func
()
{
defer
w
.
wg
.
Done
()
w
.
fsWatcher
.
Events
<-
fsnotify
.
Event
{
w
.
fsWatcher
.
Events
<-
fsnotify
.
Event
{
Name
:
path
,
Name
:
path
,
Op
:
fsnotify
.
Create
,
Op
:
fsnotify
.
Create
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment