diff --git a/pkg/commands/options/publish.go b/pkg/commands/options/publish.go index 09a74e0923..928f3aabc4 100644 --- a/pkg/commands/options/publish.go +++ b/pkg/commands/options/publish.go @@ -17,7 +17,7 @@ package options import ( "crypto/md5" //nolint: gosec // No strong cryptography needed. "encoding/hex" - "path/filepath" + "path" "github.com/google/ko/pkg/publish" "github.com/spf13/cobra" @@ -71,15 +71,15 @@ func AddPublishArg(cmd *cobra.Command, po *PublishOptions) { func packageWithMD5(base, importpath string) string { hasher := md5.New() //nolint: gosec // No strong cryptography needed. hasher.Write([]byte(importpath)) - return filepath.Join(base, filepath.Base(importpath)+"-"+hex.EncodeToString(hasher.Sum(nil))) + return path.Join(base, path.Base(importpath)+"-"+hex.EncodeToString(hasher.Sum(nil))) } func preserveImportPath(base, importpath string) string { - return filepath.Join(base, importpath) + return path.Join(base, importpath) } func baseImportPaths(base, importpath string) string { - return filepath.Join(base, filepath.Base(importpath)) + return path.Join(base, path.Base(importpath)) } func bareDockerRepo(base, _ string) string { diff --git a/pkg/publish/default.go b/pkg/publish/default.go index a1f64acdc9..cb4fe78c2a 100644 --- a/pkg/publish/default.go +++ b/pkg/publish/default.go @@ -18,7 +18,7 @@ import ( "fmt" "log" "net/http" - "path/filepath" + "path" "strings" "github.com/google/go-containerregistry/pkg/authn" @@ -59,7 +59,7 @@ type Namer func(string, string) string // name for maximum clarity, e.g. // gcr.io/foo/github.com/bar/baz/cmd/blah // ^--base--^ ^-------import path-------^ -func identity(base, in string) string { return filepath.Join(base, in) } +func identity(base, in string) string { return path.Join(base, in) } // As some registries do not support pushing an image by digest, the default tag for pushing // is the 'latest' tag.