Skip to content

Commit

Permalink
Uses expiry time to renew JWT svid.
Browse files Browse the repository at this point in the history
Signed-off-by: JU4N98 <[email protected]>
  • Loading branch information
JU4N98 committed Oct 24, 2023
1 parent 8dc1247 commit 1152082
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sidecar/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ func (s *Sidecar) updateJWTSVID(ctx context.Context, options ...workloadapi.Clie
s.config.Log.Infof("Updating JWT SVID")
jwtSVID, err := s.fetchJWTSVID(options...)
if err != nil {
time.Sleep(time.Second)
continue
}

Expand All @@ -278,8 +279,7 @@ func (s *Sidecar) updateJWTSVID(ctx context.Context, options ...workloadapi.Clie
s.writeJSON(certs)

s.config.Log.Infof("JWT SVID updated")

time.Sleep(time.Minute)
time.Sleep(time.Until(jwtSVID.Expiry)/2 + 1*time.Second)
}
}
}
Expand Down

0 comments on commit 1152082

Please sign in to comment.