Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Nov 28, 2024
1 parent ff45a2a commit 872d64b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions internal/ingress/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"errors"
"fmt"
"io/fs"
"k8s.io/ingress-nginx/internal/ingress/metric/collectors"
"net"
"net/http"
"os"
Expand All @@ -38,6 +37,8 @@ import (
"time"
"unicode"

"k8s.io/ingress-nginx/internal/ingress/metric/collectors"

proxyproto "github.com/armon/go-proxyproto"
"github.com/eapache/channels"
apiv1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -429,7 +430,7 @@ func (n *NGINXController) stopWait() {
}

// Wait at least for the configured duration, if any
delay := waitAtLeastUntil.Sub(time.Now())
delay := time.Until(waitAtLeastUntil)
if delay > 0 {
time.Sleep(delay)
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/util/process/sigterm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ limitations under the License.
package process

import (
klog "k8s.io/klog/v2"
"os"
"os/signal"
"syscall"
"time"

"k8s.io/klog/v2"
)

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

if delay > 0 {
klog.Warning("[DEPRECATED] Delaying controller exit for %d seconds", delay)
klog.Warningf("[DEPRECATED] Delaying controller exit for %d seconds", delay)
klog.Warning("[DEPRECATED] 'post-shutdown-grace-period' does not have any effect for graceful shutdown - use 'shutdown-grace-period' flag instead.")
time.Sleep(time.Duration(delay) * time.Second)
}
Expand Down
7 changes: 4 additions & 3 deletions test/e2e/gracefulshutdown/k8s_async_shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ package gracefulshutdown
import (
"context"
"fmt"
"net/http"
"strings"
"time"

"github.com/onsi/ginkgo/v2"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/ingress-nginx/test/e2e/framework"
"net/http"
"strings"
"time"
)

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

0 comments on commit 872d64b

Please sign in to comment.