From 20a48645d7616fd63ff02d979645abd7420ce799 Mon Sep 17 00:00:00 2001 From: Noah Stride Date: Tue, 17 Dec 2024 15:29:16 +0000 Subject: [PATCH] Fix TTL shadowing --- lib/auth/machineid/workloadidentityv1/issuer_service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/machineid/workloadidentityv1/issuer_service.go b/lib/auth/machineid/workloadidentityv1/issuer_service.go index 399c4574ee220..8dc33028ccb55 100644 --- a/lib/auth/machineid/workloadidentityv1/issuer_service.go +++ b/lib/auth/machineid/workloadidentityv1/issuer_service.go @@ -300,7 +300,7 @@ func (s *IssuanceService) IssueWorkloadIdentity( // TODO(noah): Add more sophisticated control of the TTL. ttl := time.Hour if req.RequestedTtl != nil && req.RequestedTtl.AsDuration() != 0 { - ttl := req.RequestedTtl.AsDuration() + ttl = req.RequestedTtl.AsDuration() if ttl > defaultMaxTTL { ttl = defaultMaxTTL }