Fix golang-ci linter errors (#10128)
* Fix golang-ci linter errors Signed-off-by: z1cheng <imchench@gmail.com> * Fix gofmt errors Signed-off-by: z1cheng <imchench@gmail.com> * Add nolint comment to defaults.Backend in Configuration Signed-off-by: z1cheng <imchench@gmail.com> * Add #nosec comment to rand.New func Signed-off-by: z1cheng <imchench@gmail.com> * Fix errcheck warnings Signed-off-by: z1cheng <imchench@gmail.com> * Fix gofmt check Signed-off-by: z1cheng <imchench@gmail.com> * Fix unit tests and comments Signed-off-by: z1cheng <imchench@gmail.com> --------- Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
parent
f50431a9f9
commit
d44a8e0045
37 changed files with 206 additions and 162 deletions
|
|
@ -95,10 +95,13 @@ func (s statusSync) Run(stopCh chan struct{}) {
|
|||
|
||||
// when this instance is the leader we need to enqueue
|
||||
// an item to trigger the update of the Ingress status.
|
||||
wait.PollUntil(time.Duration(UpdateInterval)*time.Second, func() (bool, error) {
|
||||
err := wait.PollUntil(time.Duration(UpdateInterval)*time.Second, func() (bool, error) {
|
||||
s.syncQueue.EnqueueTask(task.GetDummyObject("sync status"))
|
||||
return false, nil
|
||||
}, stopCh)
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "error running poll")
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown stops the sync. In case the instance is the leader it will remove the current IP
|
||||
|
|
|
|||
|
|
@ -325,7 +325,9 @@ func TestStatusActions(t *testing.T) {
|
|||
// wait for the election
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
// execute sync
|
||||
fk.sync("just-test")
|
||||
if err := fk.sync("just-test"); err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
// PublishService is empty, so the running address is: ["11.0.0.2"]
|
||||
// after updated, the ingress's ip should only be "11.0.0.2"
|
||||
newIPs := []networking.IngressLoadBalancerIngress{{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue