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

move image digests resolution to backend #10026

Merged
merged 2 commits into from Nov 30, 2022
Merged

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Nov 29, 2022

What I did
introduced ResolveImageDigests in the API and moved image digest resolution to the backend
longer terms goal is to use dockercli.RegistryClient() to replace cnab-to-oci dependency

(not mandatory) A picture of a cute animal, if possible in relation with what you did
image

Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

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

LGTM - small comment re: duplicated code

@@ -141,8 +141,9 @@ func runConvert(ctx context.Context, backend api.Service, opts convertOptions, s
}
Copy link
Member

Choose a reason for hiding this comment

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

Delete lines 130-141 now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yes indeed, my bad

@thaJeztah
Copy link
Member

Not sure if useful, but there's also DistributionInspect, which is (I think) what's used for docker service create to resolve / pin the digest; https://github.com/moby/moby/blob/1907027b7be080b8d5f9239fde26fbbb6aedfc39/client/service_create.go#L102

@ndeloof
Copy link
Contributor Author

ndeloof commented Nov 30, 2022

@thaJeztah thanks, this is exactly what I was looking for! 🥰

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@thaJeztah
Copy link
Member

Make sure to double check in the cli as well as at some point resolution was moved; check for "no-resolve-image" (I think) on the docker cli (I'm just away from my keyboard right now 😬😅)

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

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

switch options.Format {
case "json":
return json.MarshalIndent(project, "", " ")
case "yaml":
return yaml.Marshal(project)
default:
return nil, fmt.Errorf("unsupported format %q", options)
return nil, fmt.Errorf("unsupported format %q", options.Format)
Copy link
Member

Choose a reason for hiding this comment

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

😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

linter suddenly noticed this bug, while it existed before ... weird

@ndeloof ndeloof merged commit 8f2b747 into docker:v2 Nov 30, 2022
@ndeloof ndeloof deleted the cli_registry_client branch November 30, 2022 20:18
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.

None yet

3 participants