mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-03 08:04:45 +00:00
client-go: refactor: Fix styling issues (#107248)
* client-go: Remove unreachable return Due to the way the switch statement is done, the return at the end of the function will neverbe reached. Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com> * client-go: Refactor for clarity Fixed one instance where the error message should be lowercase. Made the fields in the struct literal more explicit Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com> Kubernetes-commit: 75c0987de3cb9a0380873745f68dea2f0835a7a2
This commit is contained in:
committed by
Kubernetes Publisher
parent
3618ec55f4
commit
664b1a6c8c
6
tools/cache/reflector.go
vendored
6
tools/cache/reflector.go
vendored
@@ -231,7 +231,7 @@ var (
|
||||
|
||||
// Used to indicate that watching stopped because of a signal from the stop
|
||||
// channel passed in from a client of the reflector.
|
||||
errorStopRequested = errors.New("Stop requested")
|
||||
errorStopRequested = errors.New("stop requested")
|
||||
)
|
||||
|
||||
// resyncChan returns a channel which will receive something when a resync is
|
||||
@@ -258,7 +258,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
||||
options := metav1.ListOptions{ResourceVersion: r.relistResourceVersion()}
|
||||
|
||||
if err := func() error {
|
||||
initTrace := trace.New("Reflector ListAndWatch", trace.Field{"name", r.name})
|
||||
initTrace := trace.New("Reflector ListAndWatch", trace.Field{Key: "name", Value: r.name})
|
||||
defer initTrace.LogIfLong(10 * time.Second)
|
||||
var list runtime.Object
|
||||
var paginatedResult bool
|
||||
@@ -319,7 +319,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
||||
panic(r)
|
||||
case <-listCh:
|
||||
}
|
||||
initTrace.Step("Objects listed", trace.Field{"error", err})
|
||||
initTrace.Step("Objects listed", trace.Field{Key: "error", Value: err})
|
||||
if err != nil {
|
||||
klog.Warningf("%s: failed to list %v: %v", r.name, r.expectedTypeName, err)
|
||||
return fmt.Errorf("failed to list %v: %v", r.expectedTypeName, err)
|
||||
|
Reference in New Issue
Block a user