Skip to content

Commit b4126f8

Browse files
timothyb89github-actions
authored and
github-actions
committed
Mute slonglint false positivess
1 parent 168722e commit b4126f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/tbot/output_utils.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func warnOnEarlyExpiration(
412412
// Calculate a rough TTL, assuming this was called shortly after the
413413
// identity was returned. We'll add a minute buffer to compensate and avoid
414414
// superfluous warning messages.
415-
effectiveTTL := ident.TLSIdentity.Expires.Sub(time.Now()) + time.Minute
415+
effectiveTTL := time.Until(ident.TLSIdentity.Expires) + time.Minute
416416

417417
if effectiveTTL < lifetime.TTL {
418418
l := log.With(
@@ -428,12 +428,14 @@ func warnOnEarlyExpiration(
428428
// particular limited the TTL.
429429

430430
if effectiveTTL < lifetime.RenewalInterval {
431+
//nolint:sloglint // multiline string is actually constant
431432
l.WarnContext(ctx, "The server returned an identity shorter than "+
432433
"expected and below the configured renewal interval, probably "+
433434
"due to a `max_session_ttl` configured on a server-side role. "+
434435
"Unless corrected, the credentials will be invalid for some "+
435436
"period until renewal.")
436437
} else {
438+
//nolint:sloglint // multiline string is actually constant
437439
l.WarnContext(ctx, "The server returned an identity shorter than "+
438440
"the requested TTL, probably due to a `max_session_ttl` "+
439441
"configured on a server-side role. It may not remain valid as "+

0 commit comments

Comments
 (0)