From 316e21791f7ca51e598e4178ef21d6cddfd5b2e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 18:13:13 +0800 Subject: [PATCH] fix windows bug (#3357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 楚岳 (cherry picked from commit 7b87a23f5a795e1d9df4577466f48e1677f7c7f9) Co-authored-by: 楚岳 --- pkg/addon/addon.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/addon/addon.go b/pkg/addon/addon.go index fd7cdd75d..b88599ae7 100644 --- a/pkg/addon/addon.go +++ b/pkg/addon/addon.go @@ -89,7 +89,7 @@ const ( ) // ParameterFileName is the addon resources/parameter.cue file name -var ParameterFileName = filepath.Join("resources", "parameter.cue") +var ParameterFileName = strings.Join([]string{"resources", "parameter.cue"}, "/") // ListOptions contains flags mark what files should be read in an addon directory type ListOptions struct { @@ -182,7 +182,7 @@ var Patterns = []Pattern{{Value: ReadmeFileName}, {Value: MetadataFileName}, {Va func GetPatternFromItem(it Item, r AsyncReader, rootPath string) string { relativePath := r.RelativePath(it) for _, p := range Patterns { - if strings.HasPrefix(relativePath, filepath.Join(rootPath, p.Value)) { + if strings.HasPrefix(relativePath, strings.Join([]string{rootPath, p.Value}, "/")) { return p.Value } }