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
a4e04bb6
Commit
a4e04bb6
authored
Jul 25, 2017
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change log level for pod manifest
parent
55e045d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
file.go
pkg/kubelet/config/file.go
+5
-5
file_linux.go
pkg/kubelet/config/file_linux.go
+2
-2
No files found.
pkg/kubelet/config/file.go
View file @
a4e04bb6
...
@@ -73,7 +73,7 @@ func new(path string, nodeName types.NodeName, period time.Duration, updates cha
...
@@ -73,7 +73,7 @@ func new(path string, nodeName types.NodeName, period time.Duration, updates cha
func
(
s
*
sourceFile
)
run
()
{
func
(
s
*
sourceFile
)
run
()
{
if
err
:=
s
.
watch
();
err
!=
nil
{
if
err
:=
s
.
watch
();
err
!=
nil
{
glog
.
Errorf
(
"
u
nable to read manifest path %q: %v"
,
s
.
path
,
err
)
glog
.
Errorf
(
"
U
nable to read manifest path %q: %v"
,
s
.
path
,
err
)
}
}
}
}
...
@@ -136,22 +136,22 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) {
...
@@ -136,22 +136,22 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) {
for
_
,
path
:=
range
dirents
{
for
_
,
path
:=
range
dirents
{
statInfo
,
err
:=
os
.
Stat
(
path
)
statInfo
,
err
:=
os
.
Stat
(
path
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
1
)
.
Info
f
(
"Can't get metadata for %q: %v"
,
path
,
err
)
glog
.
Error
f
(
"Can't get metadata for %q: %v"
,
path
,
err
)
continue
continue
}
}
switch
{
switch
{
case
statInfo
.
Mode
()
.
IsDir
()
:
case
statInfo
.
Mode
()
.
IsDir
()
:
glog
.
V
(
1
)
.
Info
f
(
"Not recursing into manifest path %q"
,
path
)
glog
.
Error
f
(
"Not recursing into manifest path %q"
,
path
)
case
statInfo
.
Mode
()
.
IsRegular
()
:
case
statInfo
.
Mode
()
.
IsRegular
()
:
pod
,
err
:=
s
.
extractFromFile
(
path
)
pod
,
err
:=
s
.
extractFromFile
(
path
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
1
)
.
Info
f
(
"Can't process manifest file %q: %v"
,
path
,
err
)
glog
.
Error
f
(
"Can't process manifest file %q: %v"
,
path
,
err
)
}
else
{
}
else
{
pods
=
append
(
pods
,
pod
)
pods
=
append
(
pods
,
pod
)
}
}
default
:
default
:
glog
.
V
(
1
)
.
Info
f
(
"Manifest path %q is not a directory or file: %v"
,
path
,
statInfo
.
Mode
())
glog
.
Error
f
(
"Manifest path %q is not a directory or file: %v"
,
path
,
statInfo
.
Mode
())
}
}
}
}
return
pods
,
nil
return
pods
,
nil
...
...
pkg/kubelet/config/file_linux.go
View file @
a4e04bb6
...
@@ -89,7 +89,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
...
@@ -89,7 +89,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
var
eventType
podEventType
var
eventType
podEventType
switch
{
switch
{
case
(
e
.
Mask
&
inotify
.
IN_ISDIR
)
>
0
:
case
(
e
.
Mask
&
inotify
.
IN_ISDIR
)
>
0
:
glog
.
V
(
1
)
.
Info
f
(
"Not recursing into manifest path %q"
,
s
.
path
)
glog
.
Error
f
(
"Not recursing into manifest path %q"
,
s
.
path
)
return
nil
return
nil
case
(
e
.
Mask
&
inotify
.
IN_CREATE
)
>
0
:
case
(
e
.
Mask
&
inotify
.
IN_CREATE
)
>
0
:
eventType
=
podAdd
eventType
=
podAdd
...
@@ -111,7 +111,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
...
@@ -111,7 +111,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
switch
eventType
{
switch
eventType
{
case
podAdd
,
podModify
:
case
podAdd
,
podModify
:
if
pod
,
err
:=
s
.
extractFromFile
(
e
.
Name
);
err
!=
nil
{
if
pod
,
err
:=
s
.
extractFromFile
(
e
.
Name
);
err
!=
nil
{
glog
.
Errorf
(
"
c
an't process manifest file %q: %v"
,
e
.
Name
,
err
)
glog
.
Errorf
(
"
C
an't process manifest file %q: %v"
,
e
.
Name
,
err
)
}
else
{
}
else
{
return
s
.
store
.
Add
(
pod
)
return
s
.
store
.
Add
(
pod
)
}
}
...
...
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