From e2577b07d69377b699c4939c0c0b617670402970 Mon Sep 17 00:00:00 2001 From: debasishbsws Date: Sun, 1 Oct 2023 16:40:14 +0530 Subject: [PATCH] Remove Trailing / if there any Signed-off-by: debasishbsws --- pkg/build/types/image_configuration.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/build/types/image_configuration.go b/pkg/build/types/image_configuration.go index 40ef8646a..c83a8ef84 100644 --- a/pkg/build/types/image_configuration.go +++ b/pkg/build/types/image_configuration.go @@ -17,6 +17,7 @@ package types import ( "fmt" "os" + "strings" "github.com/jinzhu/copier" "gopkg.in/yaml.v3" @@ -86,6 +87,13 @@ func (ic *ImageConfiguration) parse(configData []byte, logger log.Logger) error ic.Contents.Packages = pkgs } + repos := make([]string, 0, len(ic.Contents.Repositories)) + for _, repo := range ic.Contents.Repositories { + repo = strings.TrimRight(repo, "/") + repos = append(repos, repo) + } + ic.Contents.Repositories = repos + return nil }