Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import error caused by invalid file name #431

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

phillebaba
Copy link
Member

Turns out that Go has file naming conventions which are not enforced when working locally, but errors when importing packages. Prefixing all blob test files with sha256: would cause the import to error.

go: github.com/phillebaba/spegel-import imports
	github.com/spegel-org/spegel/pkg/oci: create zip: pkg/oci/testdata/blobs/sha256:0ad7c556c55464fa44d4c41e5236715e015b0266daced62140fb5c6b983c946b: malformed file path "pkg/oci/testdata/blobs/sha256:0ad7c556c55464fa44d4c41e5236715e015b0266daced62140fb5c6b983c946b": invalid char ':'
pkg/oci/testdata/blobs/sha256:3caa2469de2a23cbcc209dd0b9d01cd78ff9a0f88741655991d36baede5b0996: malformed file path "pkg/oci/testdata/blobs/sha256:3caa2469de2a23cbcc209dd0b9d01cd78ff9a0f88741655991d36baede5b0996": invalid char ':'
pkg/oci/testdata/blobs/sha256:44cb2cf712c060f69df7310e99339c1eb51a085446f1bb6d44469acff35b4355: malformed file path "pkg/oci/testdata/blobs/sha256:44cb2cf712c060f69df7310e99339c1eb51a085446f1bb6d44469acff35b4355": invalid char ':'
pkg/oci/testdata/blobs/sha256:68b8a989a3e08ddbdb3a0077d35c0d0e59c9ecf23d0634584def8bdbb7d6824f: malformed file path "pkg/oci/testdata/blobs/sha256:68b8a989a3e08ddbdb3a0077d35c0d0e59c9ecf23d0634584def8bdbb7d6824f": invalid char ':'
pkg/oci/testdata/blobs/sha256:9430beb291fa7b96997711fc486bc46133c719631aefdbeebe58dd3489217bfe: malformed file path "pkg/oci/testdata/blobs/sha256:9430beb291fa7b96997711fc486bc46133c719631aefdbeebe58dd3489217bfe": invalid char ':'
pkg/oci/testdata/blobs/sha256:9506c8e7a2d0a098d43cadfd7ecdc3c91697e8188d3a1245943b669f717747b4: malformed file path "pkg/oci/testdata/blobs/sha256:9506c8e7a2d0a098d43cadfd7ecdc3c91697e8188d3a1245943b669f717747b4": invalid char ':'
pkg/oci/testdata/blobs/sha256:addc990c58744bdf96364fe89bd4aab38b1e824d51c688edb36c75247cd45fa9: malformed file path "pkg/oci/testdata/blobs/sha256:addc990c58744bdf96364fe89bd4aab38b1e824d51c688edb36c75247cd45fa9": invalid char ':'
pkg/oci/testdata/blobs/sha256:aec8273a5e5aca369fcaa8cecef7bf6c7959d482f5c8cfa2236a6a16e46bbdcf: malformed file path "pkg/oci/testdata/blobs/sha256:aec8273a5e5aca369fcaa8cecef7bf6c7959d482f5c8cfa2236a6a16e46bbdcf": invalid char ':'
pkg/oci/testdata/blobs/sha256:d8df04365d06181f037251de953aca85cc16457581a8fc168f4957c978e1008b: malformed file path "pkg/oci/testdata/blobs/sha256:d8df04365d06181f037251de953aca85cc16457581a8fc168f4957c978e1008b": invalid char ':'
pkg/oci/testdata/blobs/sha256:dce623533c59af554b85f859e91fc1cbb7f574e873c82f36b9ea05a09feb0b53: malformed file path "pkg/oci/testdata/blobs/sha256:dce623533c59af554b85f859e91fc1cbb7f574e873c82f36b9ea05a09feb0b53": invalid char ':'

This change removes the prefix and adjusts the OCI tests to work with the new file paths.

@phillebaba
Copy link
Member Author

I have verified that importing now works by importing this commit.

@phillebaba phillebaba merged commit e3fc466 into main Apr 10, 2024
8 checks passed
@phillebaba phillebaba deleted the fix/import-error branch April 10, 2024 10:30
t1mt pushed a commit to t1mt/spegel that referenced this pull request Sep 3, 2024
Fix import error caused by invalid file name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant