Skip to content

Commit

Permalink
Clarified the use of unsafe local mode
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
  • Loading branch information
kommendorkapten committed Dec 22, 2023
1 parent ee821cc commit d489b53
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/tuf/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ func New(opts *Options) (*Client, error) {
// client (only reads content on disk) and then decide if we
// must perform a full TUF update.
var tmpCfg = *c.cfg
// Create a temporary config for the first use where UnsafeLocalMode
// is true. This means that when we first initialize the client,
// we are guaranteed to only read the metadata on disk.
// Based on that metadata we take a decision if a full TUF
// refresh should be done or not. As so, the tmpCfg is only needed
// here and not in future invocations.
tmpCfg.UnsafeLocalMode = true
c.up, err = updater.New(&tmpCfg)
if err != nil {
Expand Down

0 comments on commit d489b53

Please sign in to comment.