Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nfs-subdir-external-provisioner
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rancher商店
nfs-subdir-external-provisioner
Commits
b3eb332a
Commit
b3eb332a
authored
Jul 16, 2018
by
Di Weng
Committed by
kmova
Sep 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip deletion if the corresponding directory is not found
(cherry picked from commit 9debe1e4d362d0d40d448b69d0aa0ee29c690a9c)
parent
a36f0fe1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
provisioner.go
cmd/nfs-client-provisioner/provisioner.go
+4
-0
No files found.
cmd/nfs-client-provisioner/provisioner.go
View file @
b3eb332a
...
@@ -96,6 +96,10 @@ func (p *nfsProvisioner) Delete(volume *v1.PersistentVolume) error {
...
@@ -96,6 +96,10 @@ func (p *nfsProvisioner) Delete(volume *v1.PersistentVolume) error {
path
:=
volume
.
Spec
.
PersistentVolumeSource
.
NFS
.
Path
path
:=
volume
.
Spec
.
PersistentVolumeSource
.
NFS
.
Path
pvName
:=
filepath
.
Base
(
path
)
pvName
:=
filepath
.
Base
(
path
)
oldPath
:=
filepath
.
Join
(
mountPath
,
pvName
)
oldPath
:=
filepath
.
Join
(
mountPath
,
pvName
)
if
_
,
err
:=
os
.
Stat
(
oldPath
);
os
.
IsNotExist
(
err
)
{
glog
.
Warningf
(
"path %s does not exist, deletion skipped"
,
oldPath
)
return
nil
}
archivePath
:=
filepath
.
Join
(
mountPath
,
"archived-"
+
pvName
)
archivePath
:=
filepath
.
Join
(
mountPath
,
"archived-"
+
pvName
)
glog
.
V
(
4
)
.
Infof
(
"archiving path %s to %s"
,
oldPath
,
archivePath
)
glog
.
V
(
4
)
.
Infof
(
"archiving path %s to %s"
,
oldPath
,
archivePath
)
return
os
.
Rename
(
oldPath
,
archivePath
)
return
os
.
Rename
(
oldPath
,
archivePath
)
...
...
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