Skip to content

Commit

Permalink
🐛 fix image sha256
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed Sep 22, 2024
1 parent 76990af commit ea27ca7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package server

import (
"strings"

"github.com/labring/sreg/pkg/registry/crane"

"github.com/docker/docker/api/types"
Expand Down Expand Up @@ -83,6 +85,9 @@ func replaceImage(image, action string, authConfig map[string]types.AuthConfig)
//for image id] this is mistake, we should replace the image name, not the image id.
newImage, _, cfg, err := crane.GetImageManifestFromAuth(image, authConfig)
if err != nil {
if strings.Contains(image, "@") {
return replaceImage(strings.Split(image, "@")[0], action, authConfig)
}
logger.Warn("get image %s manifest error %s", newImage, err.Error())
logger.Debug("image %s not found in registry, skipping", image)
return image, false, nil
Expand Down

0 comments on commit ea27ca7

Please sign in to comment.