未验证 提交 edcec868 编写于 作者: J Jeff

fix merge conflicts

上级 4e8e840d
...@@ -29,6 +29,7 @@ import ( ...@@ -29,6 +29,7 @@ import (
"k8s.io/client-go/informers" "k8s.io/client-go/informers"
"k8s.io/klog" "k8s.io/klog"
"kubesphere.io/kubesphere/pkg/api" "kubesphere.io/kubesphere/pkg/api"
"strings"
) )
const ( const (
...@@ -105,7 +106,7 @@ func (c *registryGetter) GetEntry(namespace, secretName, imageName string) (Imag ...@@ -105,7 +106,7 @@ func (c *registryGetter) GetEntry(namespace, secretName, imageName string) (Imag
return imageDetails, err return imageDetails, err
} }
func (c *registryGetter) getEntryBySecret(namespace, secretName, imageName string) (imageDetails ImageDetails, err error) { func (c *registryGetter) getEntryBySecret(namespace, secretName, imageName string) (ImageDetails, error) {
failedImageDetails := ImageDetails{ failedImageDetails := ImageDetails{
Status: StatusFailed, Status: StatusFailed,
Message: "", Message: "",
...@@ -123,14 +124,33 @@ func (c *registryGetter) getEntryBySecret(namespace, secretName, imageName strin ...@@ -123,14 +124,33 @@ func (c *registryGetter) getEntryBySecret(namespace, secretName, imageName strin
return failedImageDetails, err return failedImageDetails, err
} }
// default use ssl
checkSSl := func(serverAddress string) bool {
if strings.HasPrefix(serverAddress, "http://") {
return false
} else {
return true
}
}
if strings.HasPrefix(imageName, "http") {
dockerurl, err := ParseDockerURL(imageName)
if err != nil {
return failedImageDetails, err
}
imageName = dockerurl.StringWithoutScheme()
}
// parse image // parse image
image, err := ParseImage(imageName) image, err := ParseImage(imageName)
if err != nil { if err != nil {
return failedImageDetails, err return failedImageDetails, err
} }
useSSL := checkSSl(entry.ServerAddress)
// Create the registry client. // Create the registry client.
r, err := CreateRegistryClient(entry.Username, entry.Password, image.Domain) r, err := CreateRegistryClient(entry.Username, entry.Password, image.Domain, useSSL)
if err != nil { if err != nil {
return failedImageDetails, err return failedImageDetails, err
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册