Skip to content

Commit

Permalink
fix skopeo copy can't decrypt to docker-daemon image
Browse files Browse the repository at this point in the history
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
  • Loading branch information
ningmingxiao committed Jul 9, 2022
1 parent b61b339 commit 201432d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions internal/image/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ func (m *manifestOCI1) UpdatedImage(ctx context.Context, options types.ManifestU
m: manifest.OCI1Clone(m.m),
}

// No conversion required, update manifest
if options.LayerInfos != nil {
if err := copy.m.UpdateLayerInfos(options.LayerInfos); err != nil {
return nil, err
}
}
converted, err := convertManifestIfRequiredWithUpdate(ctx, options, map[string]manifestConvertFn{
manifest.DockerV2Schema2MediaType: copy.convertToManifestSchema2Generic,
manifest.DockerV2Schema1MediaType: copy.convertToManifestSchema1,
Expand All @@ -162,13 +168,6 @@ func (m *manifestOCI1) UpdatedImage(ctx context.Context, options types.ManifestU
if converted != nil {
return converted, nil
}

// No conversion required, update manifest
if options.LayerInfos != nil {
if err := copy.m.UpdateLayerInfos(options.LayerInfos); err != nil {
return nil, err
}
}
// Ignore options.EmbeddedDockerReference: it may be set when converting from schema1, but we really don't care.

return memoryImageFromManifest(&copy), nil
Expand Down

0 comments on commit 201432d

Please sign in to comment.