mirror of
https://github.com/lxc/incus.git
synced 2026-02-05 09:46:19 +01:00
client/oci: Only replace the first match
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
@@ -191,7 +191,7 @@ func (r *ProtocolOCI) GetImageFile(fingerprint string, req ImageFileRequest) (*I
|
||||
"--insecure-policy",
|
||||
"copy",
|
||||
"--remove-signatures",
|
||||
fmt.Sprintf("%s/%s", strings.ReplaceAll(r.httpHost, "https://", "docker://"), info.Alias),
|
||||
fmt.Sprintf("%s/%s", strings.Replace(r.httpHost, "https://", "docker://", 1), info.Alias),
|
||||
fmt.Sprintf("oci:%s:latest", filepath.Join(ociPath, "oci")))
|
||||
if err != nil {
|
||||
logger.Debug("Error copying remote image to local", logger.Ctx{"image": info.Alias, "stdout": stdout, "stderr": err})
|
||||
@@ -367,7 +367,7 @@ func (r *ProtocolOCI) GetImageAlias(name string) (*api.ImageAliasesEntry, string
|
||||
nil,
|
||||
"skopeo",
|
||||
"inspect",
|
||||
fmt.Sprintf("%s/%s", strings.ReplaceAll(r.httpHost, "https://", "docker://"), name))
|
||||
fmt.Sprintf("%s/%s", strings.Replace(r.httpHost, "https://", "docker://", 1), name))
|
||||
if err != nil {
|
||||
logger.Debug("Error getting image alias", logger.Ctx{"name": name, "stdout": stdout, "stderr": err})
|
||||
return nil, "", err
|
||||
@@ -381,7 +381,7 @@ func (r *ProtocolOCI) GetImageAlias(name string) (*api.ImageAliasesEntry, string
|
||||
}
|
||||
|
||||
info.Alias = name
|
||||
info.Digest = strings.ReplaceAll(info.Digest, "sha256:", "")
|
||||
info.Digest = strings.Replace(info.Digest, "sha256:", "", 1)
|
||||
|
||||
archID, err := osarch.ArchitectureID(info.Architecture)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user