Fix lint issues
This commit is contained in:
parent
ff45a2a6af
commit
872d64b05c
3 changed files with 10 additions and 7 deletions
|
@ -23,7 +23,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"k8s.io/ingress-nginx/internal/ingress/metric/collectors"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue