Skip to content

Commit

Permalink
refactor(getLocalMeta): Use IsTopLevelManifest to filter out top metas
Browse files Browse the repository at this point in the history
Signed-off-by: Baptiste Foy <baptiste.foy@datadoghq.com>
  • Loading branch information
BaptisteFoy committed Sep 15, 2022
1 parent d9ef189 commit f05d0a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"

"github.com/theupdateframework/go-tuf/data"
"github.com/theupdateframework/go-tuf/internal/roles"
"github.com/theupdateframework/go-tuf/util"
"github.com/theupdateframework/go-tuf/verify"
)
Expand Down Expand Up @@ -419,10 +420,7 @@ func (c *Client) getLocalMeta() error {
}

for fileName := range meta {
if fileName != "targets.json" &&
fileName != "snapshot.json" &&
fileName != "root.json" &&
fileName != "timestamp.json" {
if roles.IsDelegatedTargetsManifest(fileName) {
c.localMeta[fileName] = meta[fileName]
}
}
Expand Down

0 comments on commit f05d0a6

Please sign in to comment.