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
d76f1a8f
Commit
d76f1a8f
authored
Apr 24, 2019
by
SataQiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix golint failures of pkg/volume/util/recyclerclient
parent
b3847120
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
9 deletions
+5
-9
.golint_failures
hack/.golint_failures
+0
-1
recycler_client.go
pkg/volume/util/recyclerclient/recycler_client.go
+4
-6
recycler_client_test.go
pkg/volume/util/recyclerclient/recycler_client_test.go
+1
-2
No files found.
hack/.golint_failures
View file @
d76f1a8f
...
@@ -358,7 +358,6 @@ pkg/volume/scaleio
...
@@ -358,7 +358,6 @@ pkg/volume/scaleio
pkg/volume/storageos
pkg/volume/storageos
pkg/volume/testing
pkg/volume/testing
pkg/volume/util/fs
pkg/volume/util/fs
pkg/volume/util/recyclerclient
pkg/volume/util/volumepathhandler
pkg/volume/util/volumepathhandler
pkg/volume/vsphere_volume
pkg/volume/vsphere_volume
plugin/pkg/admission/antiaffinity
plugin/pkg/admission/antiaffinity
...
...
pkg/volume/util/recyclerclient/recycler_client.go
View file @
d76f1a8f
...
@@ -29,6 +29,7 @@ import (
...
@@ -29,6 +29,7 @@ import (
"k8s.io/klog"
"k8s.io/klog"
)
)
// RecycleEventRecorder is a func that defines how to record RecycleEvent.
type
RecycleEventRecorder
func
(
eventtype
,
message
string
)
type
RecycleEventRecorder
func
(
eventtype
,
message
string
)
// RecycleVolumeByWatchingPodUntilCompletion is intended for use with volume
// RecycleVolumeByWatchingPodUntilCompletion is intended for use with volume
...
@@ -127,9 +128,8 @@ func waitForPod(pod *v1.Pod, recyclerClient recyclerClient, podCh <-chan watch.E
...
@@ -127,9 +128,8 @@ func waitForPod(pod *v1.Pod, recyclerClient recyclerClient, podCh <-chan watch.E
if
pod
.
Status
.
Phase
==
v1
.
PodFailed
{
if
pod
.
Status
.
Phase
==
v1
.
PodFailed
{
if
pod
.
Status
.
Message
!=
""
{
if
pod
.
Status
.
Message
!=
""
{
return
fmt
.
Errorf
(
pod
.
Status
.
Message
)
return
fmt
.
Errorf
(
pod
.
Status
.
Message
)
}
else
{
return
fmt
.
Errorf
(
"pod failed, pod.Status.Message unknown."
)
}
}
return
fmt
.
Errorf
(
"pod failed, pod.Status.Message unknown"
)
}
}
case
watch
.
Deleted
:
case
watch
.
Deleted
:
...
@@ -238,9 +238,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
...
@@ -238,9 +238,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
case
eventEvent
,
ok
:=
<-
eventWatch
.
ResultChan
()
:
case
eventEvent
,
ok
:=
<-
eventWatch
.
ResultChan
()
:
if
!
ok
{
if
!
ok
{
return
return
}
else
{
eventCh
<-
eventEvent
}
}
eventCh
<-
eventEvent
}
}
}
}
}()
}()
...
@@ -256,9 +255,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
...
@@ -256,9 +255,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
case
podEvent
,
ok
:=
<-
podWatch
.
ResultChan
()
:
case
podEvent
,
ok
:=
<-
podWatch
.
ResultChan
()
:
if
!
ok
{
if
!
ok
{
return
return
}
else
{
eventCh
<-
podEvent
}
}
eventCh
<-
podEvent
}
}
}
}
}()
}()
...
...
pkg/volume/util/recyclerclient/recycler_client_test.go
View file @
d76f1a8f
...
@@ -210,9 +210,8 @@ func (c *mockRecyclerClient) CreatePod(pod *v1.Pod) (*v1.Pod, error) {
...
@@ -210,9 +210,8 @@ func (c *mockRecyclerClient) CreatePod(pod *v1.Pod) (*v1.Pod, error) {
func
(
c
*
mockRecyclerClient
)
GetPod
(
name
,
namespace
string
)
(
*
v1
.
Pod
,
error
)
{
func
(
c
*
mockRecyclerClient
)
GetPod
(
name
,
namespace
string
)
(
*
v1
.
Pod
,
error
)
{
if
c
.
pod
!=
nil
{
if
c
.
pod
!=
nil
{
return
c
.
pod
,
nil
return
c
.
pod
,
nil
}
else
{
return
nil
,
fmt
.
Errorf
(
"pod does not exist"
)
}
}
return
nil
,
fmt
.
Errorf
(
"pod does not exist"
)
}
}
func
(
c
*
mockRecyclerClient
)
DeletePod
(
name
,
namespace
string
)
error
{
func
(
c
*
mockRecyclerClient
)
DeletePod
(
name
,
namespace
string
)
error
{
...
...
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