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
f40b970b
Commit
f40b970b
authored
Jul 29, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11987 from markturansky/recyc_fix
Fixed newRecycler func for HostPath & NFS
parents
72db883b
649374dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
18 deletions
+11
-18
host_path.go
pkg/volume/host_path/host_path.go
+3
-4
nfs.go
pkg/volume/nfs/nfs.go
+8
-14
No files found.
pkg/volume/host_path/host_path.go
View file @
f40b970b
...
@@ -86,11 +86,10 @@ func (plugin *hostPathPlugin) NewRecycler(spec *volume.Spec) (volume.Recycler, e
...
@@ -86,11 +86,10 @@ func (plugin *hostPathPlugin) NewRecycler(spec *volume.Spec) (volume.Recycler, e
}
}
func
newRecycler
(
spec
*
volume
.
Spec
,
host
volume
.
VolumeHost
)
(
volume
.
Recycler
,
error
)
{
func
newRecycler
(
spec
*
volume
.
Spec
,
host
volume
.
VolumeHost
)
(
volume
.
Recycler
,
error
)
{
if
spec
.
VolumeSource
.
HostPath
!=
nil
{
if
spec
.
PersistentVolumeSource
.
HostPath
==
nil
{
return
&
hostPathRecycler
{
spec
.
Name
,
spec
.
VolumeSource
.
HostPath
.
Path
,
host
},
nil
return
nil
,
fmt
.
Errorf
(
"spec.PersistentVolumeSource.HostPath is nil"
)
}
else
{
return
&
hostPathRecycler
{
spec
.
Name
,
spec
.
PersistentVolumeSource
.
HostPath
.
Path
,
host
},
nil
}
}
return
&
hostPathRecycler
{
spec
.
Name
,
spec
.
PersistentVolumeSource
.
HostPath
.
Path
,
host
},
nil
}
}
// HostPath volumes represent a bare host file or directory mount.
// HostPath volumes represent a bare host file or directory mount.
...
...
pkg/volume/nfs/nfs.go
View file @
f40b970b
...
@@ -223,21 +223,15 @@ func (c *nfsCleaner) TearDownAt(dir string) error {
...
@@ -223,21 +223,15 @@ func (c *nfsCleaner) TearDownAt(dir string) error {
}
}
func
newRecycler
(
spec
*
volume
.
Spec
,
host
volume
.
VolumeHost
)
(
volume
.
Recycler
,
error
)
{
func
newRecycler
(
spec
*
volume
.
Spec
,
host
volume
.
VolumeHost
)
(
volume
.
Recycler
,
error
)
{
if
spec
.
VolumeSource
.
HostPath
!=
nil
{
if
spec
.
PersistentVolumeSource
.
NFS
==
nil
{
return
&
nfsRecycler
{
return
nil
,
fmt
.
Errorf
(
"spec.PersistentVolumeSource.NFS is nil"
)
name
:
spec
.
Name
,
server
:
spec
.
VolumeSource
.
NFS
.
Server
,
path
:
spec
.
VolumeSource
.
NFS
.
Path
,
host
:
host
,
},
nil
}
else
{
return
&
nfsRecycler
{
name
:
spec
.
Name
,
server
:
spec
.
PersistentVolumeSource
.
NFS
.
Server
,
path
:
spec
.
PersistentVolumeSource
.
NFS
.
Path
,
host
:
host
,
},
nil
}
}
return
&
nfsRecycler
{
name
:
spec
.
Name
,
server
:
spec
.
PersistentVolumeSource
.
NFS
.
Server
,
path
:
spec
.
PersistentVolumeSource
.
NFS
.
Path
,
host
:
host
,
},
nil
}
}
// nfsRecycler scrubs an NFS volume by running "rm -rf" on the volume in a pod.
// nfsRecycler scrubs an NFS volume by running "rm -rf" on the volume in a 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