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
58edea18
Commit
58edea18
authored
Mar 01, 2017
by
Tomas Smetana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused method from operation_generator
parent
83846e3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
+0
-48
operation_generator.go
pkg/volume/util/operationexecutor/operation_generator.go
+0
-48
No files found.
pkg/volume/util/operationexecutor/operation_generator.go
View file @
58edea18
...
...
@@ -304,54 +304,6 @@ func (og *operationGenerator) GenerateDetachVolumeFunc(
},
nil
}
func
(
og
*
operationGenerator
)
GerifyVolumeIsSafeToDetach
(
volumeToDetach
AttachedVolume
)
error
{
// Fetch current node object
node
,
fetchErr
:=
og
.
kubeClient
.
Core
()
.
Nodes
()
.
Get
(
string
(
volumeToDetach
.
NodeName
),
metav1
.
GetOptions
{})
if
fetchErr
!=
nil
{
if
errors
.
IsNotFound
(
fetchErr
)
{
glog
.
Warningf
(
"Node %q not found on API server. DetachVolume will skip safe to detach check."
,
volumeToDetach
.
NodeName
,
volumeToDetach
.
VolumeName
,
volumeToDetach
.
VolumeSpec
.
Name
())
return
nil
}
// On failure, return error. Caller will log and retry.
return
fmt
.
Errorf
(
"DetachVolume failed fetching node from API server for volume %q (spec.Name: %q) from node %q with: %v"
,
volumeToDetach
.
VolumeName
,
volumeToDetach
.
VolumeSpec
.
Name
(),
volumeToDetach
.
NodeName
,
fetchErr
)
}
if
node
==
nil
{
// On failure, return error. Caller will log and retry.
return
fmt
.
Errorf
(
"DetachVolume failed fetching node from API server for volume %q (spec.Name: %q) from node %q. Error: node object retrieved from API server is nil"
,
volumeToDetach
.
VolumeName
,
volumeToDetach
.
VolumeSpec
.
Name
(),
volumeToDetach
.
NodeName
)
}
for
_
,
inUseVolume
:=
range
node
.
Status
.
VolumesInUse
{
if
inUseVolume
==
volumeToDetach
.
VolumeName
{
return
fmt
.
Errorf
(
"DetachVolume failed for volume %q (spec.Name: %q) from node %q. Error: volume is still in use by node, according to Node status"
,
volumeToDetach
.
VolumeName
,
volumeToDetach
.
VolumeSpec
.
Name
(),
volumeToDetach
.
NodeName
)
}
}
// Volume is not marked as in use by node
glog
.
Infof
(
"Verified volume is safe to detach for volume %q (spec.Name: %q) from node %q."
,
volumeToDetach
.
VolumeName
,
volumeToDetach
.
VolumeSpec
.
Name
(),
volumeToDetach
.
NodeName
)
return
nil
}
func
(
og
*
operationGenerator
)
GenerateMountVolumeFunc
(
waitForAttachTimeout
time
.
Duration
,
volumeToMount
VolumeToMount
,
...
...
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