summaryrefslogtreecommitdiff
path: root/cmd/podman/sign.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2019-01-10 11:05:56 -0500
committerQi Wang <qiwan@redhat.com>2019-01-10 12:18:37 -0500
commitb208b86dda384b2c44d6330d7ee6b01c345e1f42 (patch)
tree6c1ae8cecea26d2c833f7fb3a9fbb2c3d9c10f1b /cmd/podman/sign.go
parentc338da50ca91a872d156f0ba12fce91231200843 (diff)
downloadpodman-b208b86dda384b2c44d6330d7ee6b01c345e1f42.tar.gz
podman-b208b86dda384b2c44d6330d7ee6b01c345e1f42.tar.bz2
podman-b208b86dda384b2c44d6330d7ee6b01c345e1f42.zip
fix up sigstore path
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd/podman/sign.go')
-rw-r--r--cmd/podman/sign.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/sign.go b/cmd/podman/sign.go
index e7367a311..1d9aecdc9 100644
--- a/cmd/podman/sign.go
+++ b/cmd/podman/sign.go
@@ -141,7 +141,8 @@ func signCmd(c *cli.Context) error {
return errors.Wrapf(err, "error creating new signature")
}
- sigStoreDir = filepath.Join(sigStoreDir, strings.Replace(repos[0][strings.Index(repos[0], "/")+1:len(repos[0])], ":", "=", 1))
+ trimmedDigest := strings.TrimPrefix(repos[0], strings.Split(repos[0], "/")[0])
+ sigStoreDir = filepath.Join(sigStoreDir, strings.Replace(trimmedDigest, ":", "=", 1))
if err := os.MkdirAll(sigStoreDir, 0751); err != nil {
// The directory is allowed to exist
if !os.IsExist(err) {