Skip to content

Take runtime.GOARCH into account for list manifests #1237

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

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

connorgorman
Copy link
Contributor

No description provided.

@connorgorman connorgorman requested a review from RTann August 16, 2023 02:44
@ghost
Copy link

ghost commented Aug 16, 2023

Images are ready for the commit at 454c477.

To use the images, use the tag 2.30.x-41-g454c477704.

pkg/scan/scan.go Outdated
if foundAMD {
return handleManifest(reg, amdManifest.MediaType, remote, amdManifest.Digest.String())
}
return "", nil, errors.Errorf("no manifest in list matched linux and amd64 or %s architectures: %q", runtime.GOARCH, ref)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you add remote, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

if len(manifests) == 0 {
return "", nil, errors.Errorf("no valid manifests found for %s:%s", remote, ref)
}
if len(manifests) == 1 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this case needed? should be covered by the loop, right? plus, I think this allows non-linux platforms, too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this actually deviates from what central does today:

	if len(manifestList.Manifests) == 1 {
		return handleManifests(r, manifestList.Manifests[0].MediaType, remote, manifestList.Manifests[0].Digest.String())
	}
	```

@connorgorman connorgorman force-pushed the cgorman-manifest-list branch from 92c2342 to 454c477 Compare August 22, 2023 00:41
@connorgorman connorgorman requested a review from RTann August 22, 2023 00:53
@connorgorman connorgorman merged commit e3edee0 into master Aug 22, 2023
@connorgorman connorgorman deleted the cgorman-manifest-list branch August 22, 2023 17:03
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.

2 participants