From b208b86dda384b2c44d6330d7ee6b01c345e1f42 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Thu, 10 Jan 2019 11:05:56 -0500 Subject: fix up sigstore path Signed-off-by: Qi Wang --- cmd/podman/sign.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd') 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) { -- cgit v1.2.3-54-g00ecf