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 21, 2024
1 parent d740e5f commit 668e84e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/ingress/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,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 668e84e

Please sign in to comment.