mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
fix golint failures of pkg/volume/util/recyclerclient
This commit is contained in:
parent
b384712024
commit
d76f1a8fd6
@ -358,7 +358,6 @@ pkg/volume/scaleio
|
||||
pkg/volume/storageos
|
||||
pkg/volume/testing
|
||||
pkg/volume/util/fs
|
||||
pkg/volume/util/recyclerclient
|
||||
pkg/volume/util/volumepathhandler
|
||||
pkg/volume/vsphere_volume
|
||||
plugin/pkg/admission/antiaffinity
|
||||
|
@ -29,6 +29,7 @@ import (
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// RecycleEventRecorder is a func that defines how to record RecycleEvent.
|
||||
type RecycleEventRecorder func(eventtype, message string)
|
||||
|
||||
// RecycleVolumeByWatchingPodUntilCompletion is intended for use with volume
|
||||
@ -127,9 +128,8 @@ func waitForPod(pod *v1.Pod, recyclerClient recyclerClient, podCh <-chan watch.E
|
||||
if pod.Status.Phase == v1.PodFailed {
|
||||
if 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:
|
||||
@ -238,9 +238,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
|
||||
case eventEvent, ok := <-eventWatch.ResultChan():
|
||||
if !ok {
|
||||
return
|
||||
} else {
|
||||
eventCh <- eventEvent
|
||||
}
|
||||
eventCh <- eventEvent
|
||||
}
|
||||
}
|
||||
}()
|
||||
@ -256,9 +255,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
|
||||
case podEvent, ok := <-podWatch.ResultChan():
|
||||
if !ok {
|
||||
return
|
||||
} else {
|
||||
eventCh <- podEvent
|
||||
}
|
||||
eventCh <- podEvent
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
@ -210,9 +210,8 @@ func (c *mockRecyclerClient) CreatePod(pod *v1.Pod) (*v1.Pod, error) {
|
||||
func (c *mockRecyclerClient) GetPod(name, namespace string) (*v1.Pod, error) {
|
||||
if 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user