Переглянути джерело

Merge pull request #5474 from crosbymichael/use-proper-scheme

Use proper scheme with static registry
Victor Vieux 11 роки тому
батько
коміт
9d4771760a
1 змінених файлів з 7 додано та 2 видалено
  1. 7 2
      registry/registry.go

+ 7 - 2
registry/registry.go

@@ -6,7 +6,6 @@ import (
 	"encoding/json"
 	"encoding/json"
 	"errors"
 	"errors"
 	"fmt"
 	"fmt"
-	"github.com/dotcloud/docker/utils"
 	"io"
 	"io"
 	"io/ioutil"
 	"io/ioutil"
 	"net"
 	"net"
@@ -17,6 +16,8 @@ import (
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"time"
 	"time"
+
+	"github.com/dotcloud/docker/utils"
 )
 )
 
 
 var (
 var (
@@ -372,7 +373,11 @@ func (r *Registry) GetRepositoryData(remote string) (*RepositoryData, error) {
 		}
 		}
 	} else {
 	} else {
 		// Assume the endpoint is on the same host
 		// Assume the endpoint is on the same host
-		endpoints = append(endpoints, fmt.Sprintf("%s://%s/v1/", urlScheme, req.URL.Host))
+		u, err := url.Parse(indexEp)
+		if err != nil {
+			return nil, err
+		}
+		endpoints = append(endpoints, fmt.Sprintf("%s://%s/v1/", u.Scheme, req.URL.Host))
 	}
 	}
 
 
 	checksumsJSON, err := ioutil.ReadAll(res.Body)
 	checksumsJSON, err := ioutil.ReadAll(res.Body)