[hyper-provider] update hypercli in vendor

This commit is contained in:
Jimmy Xu
2017-12-22 00:30:03 +08:00
parent 1b3d6eae82
commit a6a6267863
200 changed files with 451 additions and 675 deletions

View File

@@ -8,8 +8,8 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
)
// Login tries to register/login to the registry server.

View File

@@ -3,8 +3,8 @@ package registry
import (
"testing"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
)
func buildAuthConfigs() map[string]types.AuthConfig {

View File

@@ -7,10 +7,10 @@ import (
"net/url"
"strings"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/reference"
registrytypes "github.com/docker/engine-api/types/registry"
)
// Options holds command line options.

View File

@@ -13,7 +13,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/client/transport"
registrytypes "github.com/docker/engine-api/types/registry"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
)
// for mocking in unit tests

View File

@@ -38,19 +38,19 @@ func init() {
func newTLSConfig(hostname string, isSecure bool) (*tls.Config, error) {
// PreferredServerCipherSuites should have no effect
tlsConfig := tlsconfig.ServerDefault
tlsConfig := tlsconfig.ServerDefault()
tlsConfig.InsecureSkipVerify = !isSecure
if isSecure && CertsDir != "" {
hostDir := filepath.Join(CertsDir, cleanPath(hostname))
logrus.Debugf("hostDir: %s", hostDir)
if err := ReadCertsDirectory(&tlsConfig, hostDir); err != nil {
if err := ReadCertsDirectory(tlsConfig, hostDir); err != nil {
return nil, err
}
}
return &tlsConfig, nil
return tlsConfig, nil
}
func hasFile(files []os.FileInfo, name string) bool {
@@ -218,8 +218,8 @@ func ContinueOnError(err error) bool {
// default TLS configuration.
func NewTransport(tlsConfig *tls.Config) *http.Transport {
if tlsConfig == nil {
var cfg = tlsconfig.ServerDefault
tlsConfig = &cfg
var cfg = tlsconfig.ServerDefault()
tlsConfig = cfg
}
return &http.Transport{
Proxy: http.ProxyFromEnvironment,

View File

@@ -15,10 +15,10 @@ import (
"testing"
"time"
"github.com/gorilla/mux"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/opts"
"github.com/hyperhq/hypercli/reference"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/gorilla/mux"
"github.com/Sirupsen/logrus"
)

View File

@@ -9,9 +9,9 @@ import (
"testing"
"github.com/docker/distribution/registry/client/transport"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/reference"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
)
var (

View File

@@ -6,9 +6,9 @@ import (
"net/url"
"strings"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/reference"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
)
// Service is a registry service. It tracks configuration data such as a list

View File

@@ -4,13 +4,13 @@ import (
"fmt"
"strings"
"github.com/hyperhq/hypercli/reference"
"github.com/docker/go-connections/tlsconfig"
"github.com/hyperhq/hypercli/reference"
)
func (s *Service) lookupV1Endpoints(repoName reference.Named) (endpoints []APIEndpoint, err error) {
var cfg = tlsconfig.ServerDefault
tlsConfig := &cfg
var cfg = tlsconfig.ServerDefault()
tlsConfig := cfg
nameString := repoName.FullName()
if strings.HasPrefix(nameString, DefaultNamespace+"/") {
endpoints = append(endpoints, APIEndpoint{

View File

@@ -4,13 +4,13 @@ import (
"fmt"
"strings"
"github.com/hyperhq/hypercli/reference"
"github.com/docker/go-connections/tlsconfig"
"github.com/hyperhq/hypercli/reference"
)
func (s *Service) lookupV2Endpoints(repoName reference.Named) (endpoints []APIEndpoint, err error) {
var cfg = tlsconfig.ServerDefault
tlsConfig := &cfg
var cfg = tlsconfig.ServerDefault()
tlsConfig := cfg
nameString := repoName.FullName()
if strings.HasPrefix(nameString, DefaultNamespace+"/") {
// v2 mirrors

View File

@@ -20,13 +20,13 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/registry/api/errcode"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/pkg/httputils"
"github.com/hyperhq/hypercli/pkg/ioutils"
"github.com/hyperhq/hypercli/pkg/stringid"
"github.com/hyperhq/hypercli/pkg/tarsum"
"github.com/hyperhq/hypercli/reference"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
)
var (

View File

@@ -1,8 +1,8 @@
package registry
import (
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/reference"
registrytypes "github.com/docker/engine-api/types/registry"
)
// RepositoryData tracks the image list, list of endpoints, and list of tokens