Skip to content

Commit

Permalink
Generate the TUF repository with consistent_snapshot: true (#1244)
Browse files Browse the repository at this point in the history
* Generate the TUF repository with consistent_snapshot: true

Signed-off-by: Slavek Kabrda <[email protected]>

* Fix linting

Signed-off-by: Slavek Kabrda <[email protected]>

---------

Signed-off-by: Slavek Kabrda <[email protected]>
  • Loading branch information
bkabrda authored Aug 26, 2024
1 parent 21b99c0 commit 8071236
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func CreateRepoWithMetadata(ctx context.Context, targets []TargetWithMetadata) (
return nil, "", fmt.Errorf("failed to NewRepoIndent: %w", err)
}

if err := r.Init(false); err != nil {
if err := r.Init(true); err != nil {
return nil, "", fmt.Errorf("failed to Init repo: %w", err)
}

Expand Down
9 changes: 8 additions & 1 deletion pkg/repo/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ func TestCompressUncompressFS(t *testing.T) {
}

// As well as, say rekor.pub under targets dir
rtRekor, err := os.ReadFile(filepath.Join(dstDir, "repository", "targets", "rekor.pub"))
rtRekor, err := os.ReadFile(
filepath.Join(
dstDir,
"repository",
"targets",
"6a0d8ce486b4aa7a2b30bf0940a879a00d1bb2738c4874543e179781d42b8ea1d12f34698dc95b3beeb9785036f7f2272e2fc92b994a04ac59ae458b5f4a2a7c.rekor.pub",
),
)
if err != nil {
t.Errorf("Failed to read the roundtripped rekor %v", err)
}
Expand Down

0 comments on commit 8071236

Please sign in to comment.