mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
parsing the entire url and not spliting it (#3775)
Co-authored-by: anilkeshav27 <you@example.com>
This commit is contained in:
parent
7d9f018529
commit
b7cc1eb62f
@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
@ -194,14 +195,15 @@ func (c *Client) GetRemoteImageInfo(imageSource string) (v1.Image, error) {
|
||||
|
||||
func (c *Client) getImageRef(image string) (name.Reference, error) {
|
||||
opts := []name.Option{}
|
||||
registry := ""
|
||||
|
||||
if len(c.registryURL) > 0 {
|
||||
re := regexp.MustCompile(`(?i)^https?://`)
|
||||
registry := re.ReplaceAllString(c.registryURL, "")
|
||||
registry = re.ReplaceAllString(c.registryURL, "")
|
||||
opts = append(opts, name.WithDefaultRegistry(registry))
|
||||
}
|
||||
|
||||
return name.ParseReference(image, opts...)
|
||||
return name.ParseReference(path.Join(registry, image), opts...)
|
||||
}
|
||||
|
||||
// ImageListWithFilePath compiles container image names based on all Dockerfiles found, considering excludes
|
||||
|
Loading…
Reference in New Issue
Block a user