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
ae147a73
Commit
ae147a73
authored
Jul 14, 2017
by
Slava Semushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comments and typo in the error message.
parent
cb712e41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
kubelet_pods.go
pkg/kubelet/kubelet_pods.go
+2
-2
util.go
pkg/kubelet/util.go
+1
-1
empty_dir.go
pkg/volume/empty_dir/empty_dir.go
+2
-4
No files found.
pkg/kubelet/kubelet_pods.go
View file @
ae147a73
...
@@ -940,7 +940,7 @@ func (kl *Kubelet) podKiller() {
...
@@ -940,7 +940,7 @@ func (kl *Kubelet) podKiller() {
}
}
}
}
//
check
HostPortConflicts detects pods with conflicted host ports.
//
has
HostPortConflicts detects pods with conflicted host ports.
func
hasHostPortConflicts
(
pods
[]
*
v1
.
Pod
)
bool
{
func
hasHostPortConflicts
(
pods
[]
*
v1
.
Pod
)
bool
{
ports
:=
sets
.
String
{}
ports
:=
sets
.
String
{}
for
_
,
pod
:=
range
pods
{
for
_
,
pod
:=
range
pods
{
...
@@ -1653,7 +1653,7 @@ func (kl *Kubelet) hasHostMountPVC(pod *v1.Pod) bool {
...
@@ -1653,7 +1653,7 @@ func (kl *Kubelet) hasHostMountPVC(pod *v1.Pod) bool {
if
pvc
!=
nil
{
if
pvc
!=
nil
{
referencedVolume
,
err
:=
kl
.
kubeClient
.
Core
()
.
PersistentVolumes
()
.
Get
(
pvc
.
Spec
.
VolumeName
,
metav1
.
GetOptions
{})
referencedVolume
,
err
:=
kl
.
kubeClient
.
Core
()
.
PersistentVolumes
()
.
Get
(
pvc
.
Spec
.
VolumeName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"unable to retrieve pv
c
%s - %v"
,
pvc
.
Spec
.
VolumeName
,
err
)
glog
.
Warningf
(
"unable to retrieve pv %s - %v"
,
pvc
.
Spec
.
VolumeName
,
err
)
continue
continue
}
}
if
referencedVolume
!=
nil
&&
referencedVolume
.
Spec
.
HostPath
!=
nil
{
if
referencedVolume
!=
nil
&&
referencedVolume
.
Spec
.
HostPath
!=
nil
{
...
...
pkg/kubelet/util.go
View file @
ae147a73
...
@@ -88,7 +88,7 @@ func allowHostNetwork(pod *v1.Pod) (bool, error) {
...
@@ -88,7 +88,7 @@ func allowHostNetwork(pod *v1.Pod) (bool, error) {
return
false
,
nil
return
false
,
nil
}
}
// Determined whether the specified pod is allowed to use host
networking
// Determined whether the specified pod is allowed to use host
PID
func
allowHostPID
(
pod
*
v1
.
Pod
)
(
bool
,
error
)
{
func
allowHostPID
(
pod
*
v1
.
Pod
)
(
bool
,
error
)
{
podSource
,
err
:=
kubetypes
.
GetPodSource
(
pod
)
podSource
,
err
:=
kubetypes
.
GetPodSource
(
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/volume/empty_dir/empty_dir.go
View file @
ae147a73
...
@@ -234,8 +234,7 @@ func (ed *emptyDir) SetUpAt(dir string, fsGroup *int64) error {
...
@@ -234,8 +234,7 @@ func (ed *emptyDir) SetUpAt(dir string, fsGroup *int64) error {
return
err
return
err
}
}
// setupTmpfs creates a tmpfs mount at the specified directory with the
// setupTmpfs creates a tmpfs mount at the specified directory.
// specified SELinux context.
func
(
ed
*
emptyDir
)
setupTmpfs
(
dir
string
)
error
{
func
(
ed
*
emptyDir
)
setupTmpfs
(
dir
string
)
error
{
if
ed
.
mounter
==
nil
{
if
ed
.
mounter
==
nil
{
return
fmt
.
Errorf
(
"memory storage requested, but mounter is nil"
)
return
fmt
.
Errorf
(
"memory storage requested, but mounter is nil"
)
...
@@ -258,8 +257,7 @@ func (ed *emptyDir) setupTmpfs(dir string) error {
...
@@ -258,8 +257,7 @@ func (ed *emptyDir) setupTmpfs(dir string) error {
return
ed
.
mounter
.
Mount
(
"tmpfs"
,
dir
,
"tmpfs"
,
nil
/* options */
)
return
ed
.
mounter
.
Mount
(
"tmpfs"
,
dir
,
"tmpfs"
,
nil
/* options */
)
}
}
// setupDir creates the directory with the specified SELinux context and
// setupDir creates the directory with the default permissions specified by the perm constant.
// the default permissions specified by the perm constant.
func
(
ed
*
emptyDir
)
setupDir
(
dir
string
)
error
{
func
(
ed
*
emptyDir
)
setupDir
(
dir
string
)
error
{
// Create the directory if it doesn't already exist.
// Create the directory if it doesn't already exist.
if
err
:=
os
.
MkdirAll
(
dir
,
perm
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
dir
,
perm
);
err
!=
nil
{
...
...
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