Skip to content

Commit 60f8c04

Browse files
committed
Fix lint issues
1 parent d740e5f commit 60f8c04

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

internal/ingress/controller/nginx.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"errors"
2424
"fmt"
2525
"io/fs"
26-
"k8s.io/ingress-nginx/internal/ingress/metric/collectors"
2726
"net"
2827
"net/http"
2928
"os"
@@ -38,6 +37,8 @@ import (
3837
"time"
3938
"unicode"
4039

40+
"k8s.io/ingress-nginx/internal/ingress/metric/collectors"
41+
4142
proxyproto "github.com/armon/go-proxyproto"
4243
"github.com/eapache/channels"
4344
apiv1 "k8s.io/api/core/v1"
@@ -429,7 +430,7 @@ func (n *NGINXController) stopWait() {
429430
}
430431

431432
// Wait at least for the configured duration, if any
432-
delay := waitAtLeastUntil.Sub(time.Now())
433+
delay := time.Until(waitAtLeastUntil)
433434
if delay > 0 {
434435
time.Sleep(delay)
435436
}

pkg/util/process/sigterm.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ limitations under the License.
1717
package process
1818

1919
import (
20-
klog "k8s.io/klog/v2"
2120
"os"
2221
"os/signal"
2322
"syscall"
2423
"time"
24+
25+
"k8s.io/klog/v2"
2526
)
2627

2728
type exiter func(code int)
@@ -41,7 +42,7 @@ func HandleSigterm(ngx Controller, delay int, exit exiter) {
4142
}
4243

4344
if delay > 0 {
44-
klog.Warning("[DEPRECATED] Delaying controller exit for %d seconds", delay)
45+
klog.Warningf("[DEPRECATED] Delaying controller exit for %d seconds", delay)
4546
klog.Warning("[DEPRECATED] 'post-shutdown-grace-period' does not have any effect for graceful shutdown - use 'shutdown-grace-period' flag instead.")
4647
time.Sleep(time.Duration(delay) * time.Second)
4748
}

test/e2e/gracefulshutdown/k8s_async_shutdown.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ package gracefulshutdown
1919
import (
2020
"context"
2121
"fmt"
22+
"net/http"
23+
"strings"
24+
"time"
25+
2226
"github.com/onsi/ginkgo/v2"
2327
"github.com/stretchr/testify/assert"
2428
appsv1 "k8s.io/api/apps/v1"
2529
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2630
"k8s.io/ingress-nginx/test/e2e/framework"
27-
"net/http"
28-
"strings"
29-
"time"
3031
)
3132

3233
var _ = framework.IngressNginxDescribe("[Shutdown] Asynchronous shutdown", func() {

0 commit comments

Comments
 (0)