Skip to content

Commit faf0949

Browse files
Verify both linux_amd64 and linux_arm64 provider checksums during codegen
Co-authored-by: Isaac
1 parent 54b9d8a commit faf0949

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

bundle/internal/tf/codegen/schema/checksum.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ type ProviderChecksums struct {
2020

2121
// FetchProviderChecksums downloads the SHA256SUMS file from the GitHub release
2222
// for the given provider version and extracts checksums for the linux_amd64 and
23-
// linux_arm64 archives. It also downloads the linux_amd64 zip to verify that
24-
// the parsed checksum is correct.
23+
// linux_arm64 archives. It also downloads both zips to verify that the parsed
24+
// checksums are correct.
2525
// https://github.com/databricks/terraform-provider-databricks/releases
2626
func FetchProviderChecksums(version string) (*ProviderChecksums, error) {
2727
url := fmt.Sprintf(
@@ -68,11 +68,15 @@ func FetchProviderChecksums(version string) (*ProviderChecksums, error) {
6868
return nil, fmt.Errorf("checksum not found for %s in SHA256SUMS", arm64Suffix)
6969
}
7070

71-
// Sanity check: download the linux_amd64 zip and verify the checksum matches.
71+
// Sanity check: download both zips and verify the checksums match.
7272
err = verifyProviderChecksum(version, "linux_amd64", checksums.LinuxAmd64)
7373
if err != nil {
7474
return nil, err
7575
}
76+
err = verifyProviderChecksum(version, "linux_arm64", checksums.LinuxArm64)
77+
if err != nil {
78+
return nil, err
79+
}
7680

7781
return checksums, nil
7882
}

0 commit comments

Comments
 (0)