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
3fac3658
Commit
3fac3658
authored
Aug 19, 2016
by
Yifan Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rkt: Do not error out when there are unrecognized lines in os-release file.
Also fix the error handling which will cause panic.
parent
ea805efa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
rkt.go
pkg/kubelet/rkt/rkt.go
+10
-9
No files found.
pkg/kubelet/rkt/rkt.go
View file @
3fac3658
...
@@ -974,14 +974,14 @@ func (r *Runtime) generateRunCommand(pod *api.Pod, uuid, netnsName string) (stri
...
@@ -974,14 +974,14 @@ func (r *Runtime) generateRunCommand(pod *api.Pod, uuid, netnsName string) (stri
osInfos
,
err
:=
getOSReleaseInfo
()
osInfos
,
err
:=
getOSReleaseInfo
()
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Error
f
(
"rkt: Failed to read the os release info: %v"
,
err
)
glog
.
Warning
f
(
"rkt: Failed to read the os release info: %v"
,
err
)
}
}
else
{
// Overlay fs is not supported for SELinux yet on many distros.
// Overlay fs is not supported for SELinux yet on many distros
.
// See https://github.com/coreos/rkt/issues/1727#issuecomment-173203129
.
// See https://github.com/coreos/rkt/issues/1727#issuecomment-173203129.
// For now, coreos carries a patch to support it: https://github.com/coreos/coreos-overlay/pull/1703
// For now, coreos carries a patch to support it: https://github.com/coreos/coreos-overlay/pull/1703
if
osInfos
[
"ID"
]
!=
"coreos"
&&
pod
.
Spec
.
SecurityContext
!=
nil
&&
pod
.
Spec
.
SecurityContext
.
SELinuxOptions
!=
nil
{
if
osInfos
[
"ID"
]
!=
"coreos"
&&
pod
.
Spec
.
SecurityContext
!=
nil
&&
pod
.
Spec
.
SecurityContext
.
SELinuxOptions
!=
nil
{
runPrepared
=
append
(
runPrepared
,
"--no-overlay=true"
)
runPrepared
=
append
(
runPrepared
,
"--no-overlay=true"
)
}
}
}
// Apply '--net=host' to pod that is running on host network or inside a network namespace.
// Apply '--net=host' to pod that is running on host network or inside a network namespace.
...
@@ -2338,7 +2338,8 @@ func getOSReleaseInfo() (map[string]string, error) {
...
@@ -2338,7 +2338,8 @@ func getOSReleaseInfo() (map[string]string, error) {
line
:=
scanner
.
Text
()
line
:=
scanner
.
Text
()
info
:=
strings
.
SplitN
(
line
,
"="
,
2
)
info
:=
strings
.
SplitN
(
line
,
"="
,
2
)
if
len
(
info
)
!=
2
{
if
len
(
info
)
!=
2
{
return
nil
,
fmt
.
Errorf
(
"unexpected entry in os-release %q"
,
line
)
glog
.
Warningf
(
"Unexpected entry in os-release %q"
,
line
)
continue
}
}
result
[
info
[
0
]]
=
info
[
1
]
result
[
info
[
0
]]
=
info
[
1
]
}
}
...
...
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