Merge pull request #35 from hyperhq/hyper-provider

Implemented Hyper provider
This commit is contained in:
Harry Zhang
2017-12-24 23:42:21 -06:00
committed by GitHub
206 changed files with 1234 additions and 847 deletions

View File

@@ -257,11 +257,11 @@ func (rm *ResourceManager) watchSecrets() {
func (rm *ResourceManager) incrementRefCounters(p *v1.Pod) {
for _, c := range p.Spec.Containers {
for _, e := range c.Env {
if e.ValueFrom.ConfigMapKeyRef != nil {
if e.ValueFrom != nil && e.ValueFrom.ConfigMapKeyRef != nil {
rm.configMapRef[e.ValueFrom.ConfigMapKeyRef.Name]++
}
if e.ValueFrom.SecretKeyRef != nil {
if e.ValueFrom != nil && e.ValueFrom.SecretKeyRef != nil {
rm.secretRef[e.ValueFrom.SecretKeyRef.Name]++
}
}
@@ -277,11 +277,11 @@ func (rm *ResourceManager) incrementRefCounters(p *v1.Pod) {
func (rm *ResourceManager) decrementRefCounters(p *v1.Pod) {
for _, c := range p.Spec.Containers {
for _, e := range c.Env {
if e.ValueFrom.ConfigMapKeyRef != nil {
if e.ValueFrom != nil && e.ValueFrom.ConfigMapKeyRef != nil {
rm.configMapRef[e.ValueFrom.ConfigMapKeyRef.Name]--
}
if e.ValueFrom.SecretKeyRef != nil {
if e.ValueFrom != nil && e.ValueFrom.SecretKeyRef != nil {
rm.secretRef[e.ValueFrom.SecretKeyRef.Name]--
}
}

124
providers/hypersh/README.md Normal file
View File

@@ -0,0 +1,124 @@
hyper.sh provider for virtual-kubelet
=====================================
# Configure for hyper.sh
## Use environment variable
- necessary
- HYPER_ACCESS_KEY
- HYPER_SECRET_KEY
- optional
- HYPER_INSTANCE_TYPE: default s4
- HYPER_DEFAULT_REGION: default us-west-1
- HYPER_HOST: tcp://${HYPER_DEFAULT_REGION}.hyper.sh:443
> You can use You can use either HYPER_HOST or HYPER_DEFAULT_REGION
## Use config file
> default config file for hyper.sh is ~/.hyper/config.json
```
//example configuration file for Hyper.sh
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "xxxxxx",
"email": "xxxxxx"
},
},
"clouds": {
"tcp://*.hyper.sh:443": {
"accesskey": "xxxxxx",
"secretkey": "xxxxxx",
"region": "us-west-1"
}
}
}
```
# Usage of virtual-kubelet cli
```
// example 1 : use environment variable
export HYPER_ACCESS_KEY=xxxxxx
export HYPER_SECRET_KEY=xxxxxx
export HYPER_DEFAULT_REGION=eu-central-1
export HYPER_INSTANCE_TYPE=s4
./virtual-kubelet --provider=hyper
// example 2 : use default config file(~/.hyper/config.json)
unset HYPER_ACCESS_KEY
unset HYPER_SECRET_KEY
export HYPER_DEFAULT_REGION=eu-central-1
./virtual-kubelet --provider=hyper
// example 3 : use custom config file, eg: ~/.hyper2/config.json
$ ./virtual-kubelet --provider=hyper --provider-config=$HOME/.hyper2
```
# Quick Start
## create pod yaml
```
$ cat pod-nginx
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
nodeName: virtual-kubelet
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
```
## create pod
```
$ kubectl create -f pod-nginx
```
## list container on hyper.sh
```
$ hyper ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES PUBLIC IP
a0ae3d4112d5 nginx:latest "nginx -g 'daemon off" 9 seconds ago Up 4 seconds 0.0.0.0:80->80/tcp pod-nginx-nginx
```
## server log
```
$ export HYPER_DEFAULT_REGION=eu-central-1
$ ./virtual-kubelet --provider=hyper --provider-config=$HOME/.hyper3
/home/demo/.kube/config
2017/12/20 17:30:30 config file under "/home/demo/.hyper3" was loaded
2017/12/20 17:30:30
Host: tcp://eu-central-1.hyper.sh:443
AccessKey: K**********
SecretKey: 4**********
InstanceType: s4
2017/12/20 17:30:31 Node 'virtual-kubelet' with OS type 'Linux' registered
2017/12/20 17:30:31 receive GetPods
2017/12/20 17:30:32 found 0 pods
2017/12/20 17:30:37 receive GetPods
2017/12/20 17:30:37 found 0 pods
2017/12/20 17:30:38 Error retrieving pod 'nginx' from provider: Error: No such container: pod-nginx-nginx
2017/12/20 17:30:38 receive CreatePod "nginx"
2017/12/20 17:30:38 container "a0ae3d4112d53023b5972906f2f15c0d34360c132b3c273b286473afad613b63" for pod "nginx" was created
2017/12/20 17:30:43 container "a0ae3d4112d53023b5972906f2f15c0d34360c132b3c273b286473afad613b63" for pod "nginx" was started
2017/12/20 17:30:43 Pod 'nginx' created.
2017/12/20 17:30:43 receive GetPods
2017/12/20 17:30:43 found 1 pods
2017/12/20 17:30:47 receive GetPods
2017/12/20 17:30:47 found 1 pods
```

View File

@@ -1,58 +0,0 @@
package hypersh
import (
"fmt"
"io"
"github.com/virtual-kubelet/virtual-kubelet/providers"
"github.com/BurntSushi/toml"
)
type providerConfig struct {
Region string
AccessKey string
SecretKey string
OperatingSystem string
CPU string
Memory string
Pods string
}
func (p *HyperProvider) loadConfig(r io.Reader) error {
var config providerConfig
if _, err := toml.DecodeReader(r, &config); err != nil {
return err
}
p.region = config.Region
p.accessKey = config.AccessKey
p.secretKey = config.SecretKey
// Default to 20 mcpu
p.cpu = "20"
if config.CPU != "" {
p.cpu = config.CPU
}
// Default to 100Gi
p.memory = "100Gi"
if config.Memory != "" {
p.memory = config.Memory
}
// Default to 20 pods
p.pods = "20"
if config.Pods != "" {
p.pods = config.Pods
}
// Default to Linux if the operating system was not defined in the config.
if config.OperatingSystem == "" {
config.OperatingSystem = providers.OperatingSystemLinux
}
// Validate operating system from config.
if config.OperatingSystem != providers.OperatingSystemLinux {
return fmt.Errorf("%q is not a valid operating system, only %s is valid", config.OperatingSystem, providers.OperatingSystemLinux)
}
p.operatingSystem = config.OperatingSystem
return nil
}

View File

@@ -1,8 +0,0 @@
# example configuration file for Hyper.sh virtual-kubelet
AccessKey = ""
SecretKey = ""
Region = "us-west-1"
CPU = 100
Memory = 100Gi
Pods = 50

340
providers/hypersh/hypersh.go Normal file → Executable file
View File

@@ -6,120 +6,246 @@ import (
"log"
"net/http"
"os"
"runtime"
"github.com/docker/go-connections/nat"
hyper "github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/network"
"github.com/virtual-kubelet/virtual-kubelet/manager"
"github.com/virtual-kubelet/virtual-kubelet/providers"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
hyper "github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hypercli/cliconfig"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var host = "tcp://*.hyper.sh:443"
const (
host = "https://us-west-1.hyper.sh"
verStr = "v1.23"
containerLabel = "hyper-virtual-kubelet"
nodeLabel = containerLabel + "-node"
verStr = "v1.23"
containerLabel = "hyper-virtual-kubelet"
nodeLabel = containerLabel + "-node"
instanceTypeLabel = "sh_hyper_instancetype"
)
// HyperProvider implements the virtual-kubelet provider interface and communicates with hyper.sh APIs.
type HyperProvider struct {
hyperClient *hyper.Client
configFile *cliconfig.ConfigFile
resourceManager *manager.ResourceManager
nodeName string
operatingSystem string
region string
host string
accessKey string
secretKey string
cpu string
memory string
instanceType string
pods string
}
// NewHyperProvider creates a new HyperProvider
func NewHyperProvider(config string, rm *manager.ResourceManager, nodeName, operatingSystem string) (*HyperProvider, error) {
var p HyperProvider
var err error
var (
p HyperProvider
err error
host string
dft bool
tlsOptions = &tlsconfig.Options{InsecureSkipVerify: false}
)
p.resourceManager = rm
if config != "" {
f, err := os.Open(config)
if err != nil {
return nil, err
}
defer f.Close()
if err := p.loadConfig(f); err != nil {
return nil, err
}
// Get config from environment variable
if h := os.Getenv("HYPER_HOST"); h != "" {
p.host = h
}
if ak := os.Getenv("HYPERSH_ACCESS_KEY"); ak != "" {
if ak := os.Getenv("HYPER_ACCESS_KEY"); ak != "" {
p.accessKey = ak
}
if sk := os.Getenv("HYPERSH_SECRET_KEY"); sk != "" {
if sk := os.Getenv("HYPER_SECRET_KEY"); sk != "" {
p.secretKey = sk
}
if r := os.Getenv("HYPERSH_REGION"); r != "" {
p.region = r
if p.host == "" {
// ignore HYPER_DEFAULT_REGION when HYPER_HOST was specified
if r := os.Getenv("HYPER_DEFAULT_REGION"); r != "" {
p.region = r
}
}
if it := os.Getenv("HYPER_INSTANCE_TYPE"); it != "" {
p.instanceType = it
} else {
p.instanceType = "s4"
}
if p.accessKey != "" || p.secretKey != "" {
//use environment variable
if p.accessKey == "" || p.secretKey == "" {
return nil, fmt.Errorf("WARNING: Need to specify HYPER_ACCESS_KEY and HYPER_SECRET_KEY at the same time.")
}
log.Printf("Use AccessKey and SecretKey from HYPER_ACCESS_KEY and HYPER_SECRET_KEY")
if p.region == "" {
p.region = cliconfig.DefaultHyperRegion
}
if p.host == "" {
host, _, err = p.getServerHost(p.region, tlsOptions)
if err != nil {
return nil, err
}
p.host = host
}
} else {
// use config file, default path is ~/.hyper
if config == "" {
config = cliconfig.ConfigDir()
}
configFile, err := cliconfig.Load(config)
if err != nil {
return nil, fmt.Errorf("WARNING: Error loading config file %q: %v\n", config, err)
}
p.configFile = configFile
log.Printf("config file under %q was loaded\n", config)
if p.host == "" {
host, dft, err = p.getServerHost(p.region, tlsOptions)
if err != nil {
return nil, err
}
p.host = host
}
// Get Region, AccessKey and SecretKey from config file
cc, ok := configFile.CloudConfig[p.host]
if !ok {
cc, ok = configFile.CloudConfig[cliconfig.DefaultHyperFormat]
}
if ok {
p.accessKey = cc.AccessKey
p.secretKey = cc.SecretKey
if p.region == "" && dft {
if p.region = cc.Region; p.region == "" {
p.region = p.getDefaultRegion()
}
}
if !dft {
if p.region = cc.Region; p.region == "" {
p.region = cliconfig.DefaultHyperRegion
}
}
} else {
return nil, fmt.Errorf("WARNING: can not find entrypoint %q in config file", cliconfig.DefaultHyperFormat)
}
if p.accessKey == "" || p.secretKey == "" {
return nil, fmt.Errorf("WARNING: AccessKey or SecretKey is empty in config %q", config)
}
}
log.Printf("\n Host: %s\n AccessKey: %s**********\n SecretKey: %s**********\n InstanceType: %s\n", p.host, p.accessKey[0:1], p.secretKey[0:1], p.instanceType)
httpClient, err := newHTTPClient(p.host, tlsOptions)
customHeaders := map[string]string{}
ver := "0.1"
customHeaders["User-Agent"] = fmt.Sprintf("Virtual-Kubelet-Client/%s (%s)", ver, runtime.GOOS)
p.operatingSystem = operatingSystem
p.nodeName = nodeName
p.hyperClient, err = hyper.NewClient(host, verStr, http.DefaultClient, nil, p.accessKey, p.secretKey, p.region)
p.hyperClient, err = hyper.NewClient(p.host, verStr, httpClient, customHeaders, p.accessKey, p.secretKey, p.region)
if err != nil {
return nil, err
}
//test connect to hyper.sh
_, err = p.hyperClient.Info(context.Background())
if err != nil {
return nil, err
}
return &p, nil
}
func newHTTPClient(host string, tlsOptions *tlsconfig.Options) (*http.Client, error) {
if tlsOptions == nil {
// let the api client configure the default transport.
return nil, nil
}
config, err := tlsconfig.Client(*tlsOptions)
if err != nil {
return nil, err
}
tr := &http.Transport{
TLSClientConfig: config,
}
proto, addr, _, err := hyper.ParseHost(host)
if err != nil {
return nil, err
}
return &p, nil
sockets.ConfigureTransport(tr, proto, addr)
return &http.Client{
Transport: tr,
}, nil
}
// CreatePod accepts a Pod definition and creates
// a hyper.sh deployment
func (p *HyperProvider) CreatePod(pod *v1.Pod) error {
log.Printf("receive CreatePod %q\n", pod.Name)
// get containers
containers, hostConfigs, err := getContainers(pod)
//Ignore daemonSet Pod
if pod != nil && pod.OwnerReferences != nil && len(pod.OwnerReferences) != 0 && pod.OwnerReferences[0].Kind == "DaemonSet" {
log.Printf("Skip to create DaemonSet pod %q\n", pod.Name)
return nil
}
// Get containers
containers, hostConfigs, err := p.getContainers(pod)
if err != nil {
return err
}
// TODO: get registry creds
// TODO: get volumes
// Iterate over the containers to create and start them.
for k, ctr := range containers {
//one container in a Pod in hyper.sh currently
containerName := fmt.Sprintf("pod-%s-%s", pod.Name, pod.Spec.Containers[k].Name)
if err = p.ensureImage(ctr.Image); err != nil {
return err
}
// Add labels to the pod containers.
ctr.Labels = map[string]string{
containerLabel: pod.Name,
nodeLabel: p.nodeName,
containerLabel: pod.Name,
nodeLabel: p.nodeName,
instanceTypeLabel: p.instanceType,
}
hostConfigs[k].NetworkMode = "bridge"
// Create the container.
resp, err := p.hyperClient.ContainerCreate(context.Background(), &ctr, &hostConfigs[k], &network.NetworkingConfig{}, containerName)
if err != nil {
return fmt.Errorf("Creating container %q failed in pod %q: %v", containerName, pod.Name, err)
return err
}
log.Printf("container %q for pod %q was created\n", resp.ID, pod.Name)
// Iterate throught the warnings.
for _, warning := range resp.Warnings {
log.Printf("Warning while creating container %q for pod %q: %s", containerName, pod.Name, warning)
log.Printf("warning while creating container %q for pod %q: %s", containerName, pod.Name, warning)
}
// Start the container.
if err := p.hyperClient.ContainerStart(context.Background(), resp.ID, ""); err != nil {
return fmt.Errorf("Starting container %q failed in pod %q: %v", containerName, pod.Name, err)
return err
}
log.Printf("container %q for pod %q was started\n", resp.ID, pod.Name)
}
return nil
}
@@ -129,40 +255,101 @@ func (p *HyperProvider) UpdatePod(pod *v1.Pod) error {
}
// DeletePod deletes the specified pod out of hyper.sh.
func (p *HyperProvider) DeletePod(pod *v1.Pod) error {
func (p *HyperProvider) DeletePod(pod *v1.Pod) (err error) {
log.Printf("receive DeletePod %q\n", pod.Name)
var (
containerName = fmt.Sprintf("pod-%s-%s", pod.Name, pod.Name)
container types.ContainerJSON
)
// Inspect hyper container
container, err = p.hyperClient.ContainerInspect(context.Background(), containerName)
if err != nil {
return err
}
// Check container label
if v, ok := container.Config.Labels[containerLabel]; ok {
// Check value of label
if v != pod.Name {
return fmt.Errorf("the label %q of hyper container %q should be %q, but it's %q currently", containerLabel, container.Name, pod.Name, v)
}
rmOptions := types.ContainerRemoveOptions{
RemoveVolumes: true,
Force: true,
}
// Delete hyper container
resp, err := p.hyperClient.ContainerRemove(context.Background(), container.ID, rmOptions)
if err != nil {
return err
}
// Iterate throught the warnings.
for _, warning := range resp {
log.Printf("warning while deleting container %q for pod %q: %s", container.ID, pod.Name, warning)
}
log.Printf("container %q for pod %q was deleted\n", container.ID, pod.Name)
} else {
return fmt.Errorf("hyper container %q has no label %q", container.Name, containerLabel)
}
return nil
}
// GetPod returns a pod by name that is running inside hyper.sh
// returns nil if a pod by that name is not found.
func (p *HyperProvider) GetPod(namespace, name string) (*v1.Pod, error) {
return nil, nil
func (p *HyperProvider) GetPod(namespace, name string) (pod *v1.Pod, err error) {
var (
containerName = fmt.Sprintf("pod-%s-%s", name, name)
container types.ContainerJSON
)
// Inspect hyper container
container, err = p.hyperClient.ContainerInspect(context.Background(), containerName)
if err != nil {
return nil, err
}
// Convert hyper container into Pod
pod, err = p.containerJSONToPod(&container)
if err != nil {
return nil, err
} else {
return pod, nil
}
}
// GetPodStatus returns the status of a pod by name that is running inside hyper.sh
// returns nil if a pod by that name is not found.
func (p *HyperProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error) {
return nil, nil
pod, err := p.GetPod(namespace, name)
if err != nil {
return nil, err
}
return &pod.Status, nil
}
// GetPods returns a list of all pods known to be running within hyper.sh.
func (p *HyperProvider) GetPods() ([]*v1.Pod, error) {
filter, err := filters.FromParam(nodeLabel + "=" + p.nodeName)
log.Printf("receive GetPods\n")
filter, err := filters.FromParam(fmt.Sprintf("{\"label\":{\"%s=%s\":true}}", nodeLabel, p.nodeName))
if err != nil {
return nil, fmt.Errorf("Creating filter to get containers by node name failed: %v", err)
return nil, err
}
// Filter by label.
_, err = p.hyperClient.ContainerList(context.Background(), types.ContainerListOptions{
containers, err := p.hyperClient.ContainerList(context.Background(), types.ContainerListOptions{
Filter: filter,
All: true,
})
if err != nil {
return nil, fmt.Errorf("Listing containers failed: %v", err)
return nil, err
}
log.Printf("found %d pods\n", len(containers))
// TODO: convert containers into pods
return nil, nil
var pods = []*v1.Pod{}
for _, container := range containers {
pod, err := p.containerToPod(&container)
if err != nil {
log.Printf("WARNING: convert container %q to pod error: %v\n", container.ID, err)
continue
}
pods = append(pods, pod)
}
return pods, nil
}
// Capacity returns a resource list containing the capacity limits set for hyper.sh.
@@ -229,54 +416,3 @@ func (p *HyperProvider) NodeConditions() []v1.NodeCondition {
func (p *HyperProvider) OperatingSystem() string {
return providers.OperatingSystemLinux
}
func getContainers(pod *v1.Pod) ([]container.Config, []container.HostConfig, error) {
containers := make([]container.Config, len(pod.Spec.Containers))
hostConfigs := make([]container.HostConfig, len(pod.Spec.Containers))
for x, ctr := range pod.Spec.Containers {
// Do container.Config
var c container.Config
c.Image = ctr.Image
c.Cmd = ctr.Command
ports := map[nat.Port]struct{}{}
portBindings := nat.PortMap{}
for _, p := range ctr.Ports {
port, err := nat.NewPort(string(p.Protocol), fmt.Sprintf("%d", p.HostPort))
if err != nil {
return nil, nil, fmt.Errorf("creating new port in container conversion failed: %v", err)
}
ports[port] = struct{}{}
portBindings[port] = []nat.PortBinding{
{
HostPort: fmt.Sprintf("%d", p.HostPort),
},
}
}
c.ExposedPorts = ports
// TODO: do volumes
envs := make([]string, len(ctr.Env))
for z, e := range ctr.Env {
envs[z] = fmt.Sprintf("%s=%s", e.Name, e.Value)
}
c.Env = envs
// Do container.HostConfig
var hc container.HostConfig
cpuLimit := ctr.Resources.Limits.Cpu().Value()
memoryLimit := ctr.Resources.Limits.Memory().Value()
hc.Resources = container.Resources{
CPUShares: cpuLimit,
Memory: memoryLimit,
}
hc.PortBindings = portBindings
containers[x] = c
hostConfigs[x] = hc
}
return containers, hostConfigs, nil
}

417
providers/hypersh/util.go Normal file
View File

@@ -0,0 +1,417 @@
package hypersh
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"log"
"net/url"
"os"
"strings"
"time"
"github.com/docker/go-connections/nat"
"github.com/docker/go-connections/tlsconfig"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/cliconfig"
"github.com/hyperhq/hypercli/opts"
"github.com/hyperhq/hypercli/pkg/jsonmessage"
"github.com/hyperhq/hypercli/pkg/term"
"github.com/hyperhq/hypercli/reference"
"github.com/hyperhq/hypercli/registry"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func (p *HyperProvider) getContainers(pod *v1.Pod) ([]container.Config, []container.HostConfig, error) {
containers := make([]container.Config, len(pod.Spec.Containers))
hostConfigs := make([]container.HostConfig, len(pod.Spec.Containers))
for x, ctr := range pod.Spec.Containers {
// Do container.Config
var c container.Config
c.Image = ctr.Image
c.Cmd = ctr.Command
ports := map[nat.Port]struct{}{}
portBindings := nat.PortMap{}
for _, p := range ctr.Ports {
//TODO: p.HostPort is 0 by default, but it's invalid in hyper.sh
if p.HostPort == 0 {
p.HostPort = p.ContainerPort
}
port, err := nat.NewPort(strings.ToLower(string(p.Protocol)), fmt.Sprintf("%d", p.HostPort))
if err != nil {
return nil, nil, fmt.Errorf("creating new port in container conversion failed: %v", err)
}
ports[port] = struct{}{}
portBindings[port] = []nat.PortBinding{
{
HostIP: "0.0.0.0",
HostPort: fmt.Sprintf("%d", p.HostPort),
},
}
}
c.ExposedPorts = ports
// TODO: do volumes
envs := make([]string, len(ctr.Env))
for z, e := range ctr.Env {
envs[z] = fmt.Sprintf("%s=%s", e.Name, e.Value)
}
c.Env = envs
// Do container.HostConfig
var hc container.HostConfig
cpuLimit := ctr.Resources.Limits.Cpu().Value()
memoryLimit := ctr.Resources.Limits.Memory().Value()
hc.Resources = container.Resources{
CPUShares: cpuLimit,
Memory: memoryLimit,
}
hc.PortBindings = portBindings
containers[x] = c
hostConfigs[x] = hc
}
return containers, hostConfigs, nil
}
func (p *HyperProvider) containerJSONToPod(container *types.ContainerJSON) (*v1.Pod, error) {
podName, found := container.Config.Labels[containerLabel]
if !found {
return nil, fmt.Errorf("can not found podName: key %q not found in container label", containerLabel)
}
nodeName, found := container.Config.Labels[nodeLabel]
if !found {
return nil, fmt.Errorf("can not found nodeName: key %q not found in container label", containerLabel)
}
created, err := time.Parse(time.RFC3339, container.Created)
if err != nil {
return nil, fmt.Errorf("parse Created time failed:%v", container.Created)
}
startedAt, err := time.Parse(time.RFC3339, container.State.StartedAt)
if err != nil {
return nil, fmt.Errorf("parse StartedAt time failed:%v", container.State.StartedAt)
}
finishedAt, err := time.Parse(time.RFC3339, container.State.FinishedAt)
if err != nil {
return nil, fmt.Errorf("parse FinishedAt time failed:%v", container.State.FinishedAt)
}
var (
podCondition v1.PodCondition
containerState v1.ContainerState
)
switch p.hyperStateToPodPhase(container.State.Status) {
case v1.PodPending:
podCondition = v1.PodCondition{
Type: v1.PodInitialized,
Status: v1.ConditionFalse,
}
containerState = v1.ContainerState{
Waiting: &v1.ContainerStateWaiting{},
}
case v1.PodRunning: // running
podCondition = v1.PodCondition{
Type: v1.PodReady,
Status: v1.ConditionTrue,
}
containerState = v1.ContainerState{
Running: &v1.ContainerStateRunning{
StartedAt: metav1.NewTime(startedAt),
},
}
case v1.PodSucceeded: // normal exit
podCondition = v1.PodCondition{
Type: v1.PodReasonUnschedulable,
Status: v1.ConditionFalse,
}
containerState = v1.ContainerState{
Terminated: &v1.ContainerStateTerminated{
ExitCode: int32(container.State.ExitCode),
FinishedAt: metav1.NewTime(finishedAt),
},
}
case v1.PodFailed: // exit with error
podCondition = v1.PodCondition{
Type: v1.PodReasonUnschedulable,
Status: v1.ConditionFalse,
}
containerState = v1.ContainerState{
Terminated: &v1.ContainerStateTerminated{
ExitCode: int32(container.State.ExitCode),
FinishedAt: metav1.NewTime(finishedAt),
Reason: container.State.Error,
},
}
default: //unkown
podCondition = v1.PodCondition{
Type: v1.PodReasonUnschedulable,
Status: v1.ConditionUnknown,
}
containerState = v1.ContainerState{}
}
pod := v1.Pod{
TypeMeta: metav1.TypeMeta{
Kind: "Pod",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Namespace: "default",
CreationTimestamp: metav1.NewTime(created),
},
Spec: v1.PodSpec{
NodeName: nodeName,
Volumes: []v1.Volume{},
Containers: []v1.Container{
{
Name: podName,
Image: container.Config.Image,
Command: container.Config.Cmd,
},
},
},
Status: v1.PodStatus{
Phase: p.hyperStateToPodPhase(container.State.Status),
Conditions: []v1.PodCondition{podCondition},
Message: "",
Reason: "",
HostIP: "",
PodIP: container.NetworkSettings.IPAddress,
ContainerStatuses: []v1.ContainerStatus{
{
Name: podName,
RestartCount: int32(container.RestartCount),
Image: container.Config.Image,
ImageID: container.Image,
ContainerID: container.ID,
Ready: container.State.Running,
State: containerState,
},
},
},
}
return &pod, nil
}
func (p *HyperProvider) containerToPod(container *types.Container) (*v1.Pod, error) {
// TODO: convert containers into pods
podName, found := container.Labels[containerLabel]
if !found {
return nil, fmt.Errorf("can not found podName: key %q not found in container label", containerLabel)
}
nodeName, found := container.Labels[nodeLabel]
if !found {
return nil, fmt.Errorf("can not found nodeName: key %q not found in container label", containerLabel)
}
var (
podCondition v1.PodCondition
isReady bool = true
)
if strings.ToLower(string(container.State)) == strings.ToLower(string(v1.PodRunning)) {
podCondition = v1.PodCondition{
Type: v1.PodReady,
Status: v1.ConditionTrue,
}
} else {
podCondition = v1.PodCondition{
Type: v1.PodReasonUnschedulable,
Status: v1.ConditionFalse,
}
isReady = false
}
pod := v1.Pod{
TypeMeta: metav1.TypeMeta{
Kind: "Pod",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Namespace: "default",
ClusterName: "",
UID: "",
CreationTimestamp: metav1.NewTime(time.Unix(container.Created, 0)),
},
Spec: v1.PodSpec{
NodeName: nodeName,
Volumes: []v1.Volume{},
Containers: []v1.Container{
{
Name: podName,
Image: container.Image,
Command: strings.Split(container.Command, " "),
Resources: v1.ResourceRequirements{},
},
},
},
Status: v1.PodStatus{
//Phase: "",
Conditions: []v1.PodCondition{podCondition},
Message: "",
Reason: "",
HostIP: "",
PodIP: "",
ContainerStatuses: []v1.ContainerStatus{
{
Name: container.Names[0],
Image: container.Image,
ImageID: container.ImageID,
ContainerID: container.ID,
Ready: isReady,
State: v1.ContainerState{},
},
},
},
}
return &pod, nil
}
func (p *HyperProvider) hyperStateToPodPhase(state string) v1.PodPhase {
switch strings.ToLower(state) {
case "created":
return v1.PodPending
case "restarting":
return v1.PodPending
case "running":
return v1.PodRunning
case "exited":
return v1.PodSucceeded
case "paused":
return v1.PodSucceeded
case "dead":
return v1.PodFailed
}
return v1.PodUnknown
}
func (p *HyperProvider) getServerHost(region string, tlsOptions *tlsconfig.Options) (host string, dft bool, err error) {
dft = false
host = region
if host == "" {
host = os.Getenv("HYPER_DEFAULT_REGION")
region = p.getDefaultRegion()
}
if _, err := url.ParseRequestURI(host); err != nil {
host = "tcp://" + region + "." + cliconfig.DefaultHyperEndpoint
dft = true
}
host, err = opts.ParseHost(tlsOptions != nil, host)
return
}
func (p *HyperProvider) getDefaultRegion() string {
cc, ok := p.configFile.CloudConfig[cliconfig.DefaultHyperFormat]
if ok && cc.Region != "" {
return cc.Region
}
return cliconfig.DefaultHyperRegion
}
func (p *HyperProvider) ensureImage(image string) error {
distributionRef, err := reference.ParseNamed(image)
if err != nil {
return err
}
if reference.IsNameOnly(distributionRef) {
distributionRef = reference.WithDefaultTag(distributionRef)
log.Printf("Using default tag: %s", reference.DefaultTag)
}
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(distributionRef)
authConfig := p.resolveAuthConfig(p.configFile.AuthConfigs, repoInfo.Index)
encodedAuth, err := p.encodeAuthToBase64(authConfig)
if err != nil {
return err
}
options := types.ImagePullOptions{
RegistryAuth: encodedAuth,
All: false,
}
responseBody, err := p.hyperClient.ImagePull(context.Background(), distributionRef.String(), options)
if err != nil {
return err
}
defer responseBody.Close()
var (
outFd uintptr
isTerminalOut bool
)
_, stdout, _ := term.StdStreams()
if stdout != nil {
outFd, isTerminalOut = term.GetFdInfo(stdout)
}
jsonmessage.DisplayJSONMessagesStream(responseBody, stdout, outFd, isTerminalOut, nil)
return nil
}
func (p *HyperProvider) resolveAuthConfig(authConfigs map[string]types.AuthConfig, index *registrytypes.IndexInfo) types.AuthConfig {
configKey := index.Name
if index.Official {
configKey = p.electAuthServer()
}
// First try the happy case
if c, found := authConfigs[configKey]; found || index.Official {
return c
}
convertToHostname := func(url string) string {
stripped := url
if strings.HasPrefix(url, "http://") {
stripped = strings.Replace(url, "http://", "", 1)
} else if strings.HasPrefix(url, "https://") {
stripped = strings.Replace(url, "https://", "", 1)
}
nameParts := strings.SplitN(stripped, "/", 2)
return nameParts[0]
}
// Maybe they have a legacy config file, we will iterate the keys converting
// them to the new format and testing
for registry, ac := range authConfigs {
if configKey == convertToHostname(registry) {
return ac
}
}
// When all else fails, return an empty auth config
return types.AuthConfig{}
}
func (p *HyperProvider) electAuthServer() string {
serverAddress := registry.IndexServer
if info, err := p.hyperClient.Info(context.Background()); err != nil {
log.Printf("Warning: failed to get default registry endpoint from daemon (%v). Using system default: %s", err, serverAddress)
} else {
serverAddress = info.IndexServerAddress
}
return serverAddress
}
// encodeAuthToBase64 serializes the auth configuration as JSON base64 payload
func (p *HyperProvider) encodeAuthToBase64(authConfig types.AuthConfig) (string, error) {
buf, err := json.Marshal(authConfig)
if err != nil {
return "", err
}
return base64.URLEncoding.EncodeToString(buf), nil
}

View File

@@ -1,3 +0,0 @@
bundles
.gopath
vendor/pkg

View File

@@ -1,42 +0,0 @@
# Docker project generated files to ignore
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
*.exe
*.exe~
*.orig
*.test
.*.swp
.DS_Store
.bashrc
.dotcloud
.flymake*
.git/
.gopath/
.hg/
.vagrant*
Vagrantfile
a.out
autogen/
bin
build_src
bundles/
docker/docker
hyper/hyper
dockerversion/version_autogen.go
docs/AWS_S3_BUCKET
docs/GITCOMMIT
docs/GIT_BRANCH
docs/VERSION
docs/_build
docs/_static
docs/_templates
docs/changed-files
# generated by man/md2man-all.sh
man/man1
man/man5
man/man8
pyenv
vendor/pkg/
*.yml
.idea
integration-cli/util.conf

View File

@@ -1,171 +0,0 @@
# Generate AUTHORS: hack/generate-authors.sh
# Tip for finding duplicates (besides scanning the output of AUTHORS for name
# duplicates that aren't also email duplicates): scan the output of:
# git log --format='%aE - %aN' | sort -uf
#
# For explanation on this file format: man git-shortlog
Patrick Stapleton <github@gdi2290.com>
Shishir Mahajan <shishir.mahajan@redhat.com> <smahajan@redhat.com>
Erwin van der Koogh <info@erronis.nl>
Ahmed Kamal <email.ahmedkamal@googlemail.com>
Tejesh Mehta <tejesh.mehta@gmail.com> <tj@init.me>
Cristian Staretu <cristian.staretu@gmail.com>
Cristian Staretu <cristian.staretu@gmail.com> <unclejacksons@gmail.com>
Cristian Staretu <cristian.staretu@gmail.com> <unclejack@users.noreply.github.com>
Marcus Linke <marcus.linke@gmx.de>
Aleksandrs Fadins <aleks@s-ko.net>
Christopher Latham <sudosurootdev@gmail.com>
Hu Keping <hukeping@huawei.com>
Wayne Chang <wayne@neverfear.org>
Chen Chao <cc272309126@gmail.com>
Daehyeok Mun <daehyeok@gmail.com>
<daehyeok@gmail.com> <daehyeok@daehyeokui-MacBook-Air.local>
<jt@yadutaf.fr> <admin@jtlebi.fr>
<jeff@docker.com> <jefferya@programmerq.net>
<charles.hooper@dotcloud.com> <chooper@plumata.com>
<daniel.mizyrycki@dotcloud.com> <daniel@dotcloud.com>
<daniel.mizyrycki@dotcloud.com> <mzdaniel@glidelink.net>
Guillaume J. Charmes <guillaume.charmes@docker.com> <charmes.guillaume@gmail.com>
<guillaume.charmes@docker.com> <guillaume@dotcloud.com>
<guillaume.charmes@docker.com> <guillaume@docker.com>
<guillaume.charmes@docker.com> <guillaume.charmes@dotcloud.com>
<guillaume.charmes@docker.com> <guillaume@charmes.net>
<kencochrane@gmail.com> <KenCochrane@gmail.com>
Thatcher Peskens <thatcher@docker.com>
Thatcher Peskens <thatcher@docker.com> <thatcher@dotcloud.com>
Thatcher Peskens <thatcher@docker.com> dhrp <thatcher@gmx.net>
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com> jpetazzo <jerome.petazzoni@dotcloud.com>
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com> <jp@enix.org>
Joffrey F <joffrey@docker.com>
Joffrey F <joffrey@docker.com> <joffrey@dotcloud.com>
Joffrey F <joffrey@docker.com> <f.joffrey@gmail.com>
Tim Terhorst <mynamewastaken+git@gmail.com>
Andy Smith <github@anarkystic.com>
<kalessin@kalessin.fr> <louis@dotcloud.com>
<victor.vieux@docker.com> <victor.vieux@dotcloud.com>
<victor.vieux@docker.com> <victor@dotcloud.com>
<victor.vieux@docker.com> <dev@vvieux.com>
<victor.vieux@docker.com> <victor@docker.com>
<victor.vieux@docker.com> <vieux@docker.com>
<victor.vieux@docker.com> <victorvieux@gmail.com>
<dominik@honnef.co> <dominikh@fork-bomb.org>
<ehanchrow@ine.com> <eric.hanchrow@gmail.com>
Walter Stanish <walter@pratyeka.org>
<daniel@gasienica.ch> <dgasienica@zynga.com>
Roberto Hashioka <roberto_hashioka@hotmail.com>
Konstantin Pelykh <kpelykh@zettaset.com>
David Sissitka <me@dsissitka.com>
Nolan Darilek <nolan@thewordnerd.info>
<mastahyeti@gmail.com> <mastahyeti@users.noreply.github.com>
Benoit Chesneau <bchesneau@gmail.com>
Jordan Arentsen <blissdev@gmail.com>
Daniel Garcia <daniel@danielgarcia.info>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
Victor Lyuboslavsky <victor@victoreda.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
<mosoni@ebay.com> <mohitsoni1989@gmail.com>
Shih-Yuan Lee <fourdollars@gmail.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> root <root@vagrant-ubuntu-12.10.vagrantup.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
<proppy@google.com> <proppy@aminche.com>
<michael@docker.com> <michael@crosbymichael.com>
<michael@docker.com> <crosby.michael@gmail.com>
<michael@docker.com> <crosbymichael@gmail.com>
<github@developersupport.net> <github@metaliveblog.com>
<brandon@ifup.org> <brandon@ifup.co>
<dano@spotify.com> <daniel.norberg@gmail.com>
<danny@codeaholics.org> <Danny.Yates@mailonline.co.uk>
<gurjeet@singh.im> <singh.gurjeet@gmail.com>
<shawn@churchofgit.com> <shawnlandden@gmail.com>
<sjoerd-github@linuxonly.nl> <sjoerd@byte.nl>
<solomon@docker.com> <solomon.hykes@dotcloud.com>
<solomon@docker.com> <solomon@dotcloud.com>
<solomon@docker.com> <s@docker.com>
Sven Dowideit <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@fosiki.com>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@docker.com>
Sven Dowideit <SvenDowideit@home.org.au> <¨SvenDowideit@home.org.au¨>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@users.noreply.github.com>
Sven Dowideit <SvenDowideit@home.org.au> <sven@t440s.home.gateway>
<alexl@redhat.com> <alexander.larsson@gmail.com>
Alexandr Morozov <lk4d4math@gmail.com>
<git.nivoc@neverbox.com> <kuehnle@online.de>
O.S. Tezer <ostezer@gmail.com>
<ostezer@gmail.com> <ostezer@users.noreply.github.com>
Roberto G. Hashioka <roberto.hashioka@docker.com> <roberto_hashioka@hotmail.com>
<justin.p.simonelis@gmail.com> <justin.simonelis@PTS-JSIMON2.toronto.exclamation.com>
<taim@bosboot.org> <maztaim@users.noreply.github.com>
<viktor.vojnovski@amadeus.com> <vojnovski@gmail.com>
<vbatts@redhat.com> <vbatts@hashbangbash.com>
<altsysrq@gmail.com> <iamironbob@gmail.com>
Sridhar Ratnakumar <sridharr@activestate.com>
Sridhar Ratnakumar <sridharr@activestate.com> <github@srid.name>
Liang-Chi Hsieh <viirya@gmail.com>
Aleksa Sarai <cyphar@cyphar.com>
Will Weaver <monkey@buildingbananas.com>
Timothy Hobbs <timothyhobbs@seznam.cz>
Nathan LeClaire <nathan.leclaire@docker.com> <nathan.leclaire@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com> <nathanleclaire@gmail.com>
<github@hollensbe.org> <erik+github@hollensbe.org>
<github@albersweb.de> <albers@users.noreply.github.com>
<lsm5@fedoraproject.org> <lsm5@redhat.com>
<marc@marc-abramowitz.com> <msabramo@gmail.com>
Matthew Heon <mheon@redhat.com> <mheon@mheonlaptop.redhat.com>
<bernat@luffy.cx> <vincent@bernat.im>
<p@pwaller.net> <peter@scraperwiki.com>
<andrew.weiss@outlook.com> <andrew.weiss@microsoft.com>
Francisco Carriedo <fcarriedo@gmail.com>
<julienbordellier@gmail.com> <git@julienbordellier.com>
<ahmetb@microsoft.com> <ahmetalpbalkan@gmail.com>
<lk4d4@docker.com> <lk4d4math@gmail.com>
<arnaud.porterie@docker.com> <icecrime@gmail.com>
<baloo@gandi.net> <superbaloo+registrations.github@superbaloo.net>
Brian Goff <cpuguy83@gmail.com>
<cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.home>
<ewindisch@docker.com> <eric@windisch.us>
<frank.rosquin+github@gmail.com> <frank.rosquin@gmail.com>
Hollie Teal <hollie@docker.com>
<hollie@docker.com> <hollie.teal@docker.com>
<hollie@docker.com> <hollietealok@users.noreply.github.com>
<huu@prismskylabs.com> <whoshuu@gmail.com>
Jessica Frazelle <jess@docker.com> Jessie Frazelle <jfrazelle@users.noreply.github.com>
<jess@docker.com> <jfrazelle@users.noreply.github.com>
<konrad.wilhelm.kleine@gmail.com> <kwk@users.noreply.github.com>
<tintypemolly@gmail.com> <tintypemolly@Ohui-MacBook-Pro.local>
<estesp@linux.vnet.ibm.com> <estesp@gmail.com>
<github@gone.nl> <thaJeztah@users.noreply.github.com>
Thomas LEVEIL <thomasleveil@gmail.com> Thomas LÉVEIL <thomasleveil@users.noreply.github.com>
<oi@truffles.me.uk> <timruffles@googlemail.com>
<Vincent.Bernat@exoscale.ch> <bernat@luffy.cx>
Antonio Murdaca <antonio.murdaca@gmail.com> <me@runcom.ninja>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@linux.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@users.noreply.github.com>
Darren Shepherd <darren.s.shepherd@gmail.com> <darren@rancher.com>
Deshi Xiao <dxiao@redhat.com> <dsxiao@dataman-inc.com>
Deshi Xiao <dxiao@redhat.com> <xiaods@gmail.com>
Doug Davis <dug@us.ibm.com> <duglin@users.noreply.github.com>
Jacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>
Jeff Nickoloff <jeff.nickoloff@gmail.com> <jeff@allingeek.com>
<jess@docker.com> <princess@docker.com>
John Howard (VM) <John.Howard@microsoft.com> John Howard <jhoward@microsoft.com>
Madhu Venugopal <madhu@socketplane.io> <madhu@docker.com>
Mary Anthony <mary.anthony@docker.com> <mary@docker.com>
Mary Anthony <mary.anthony@docker.com> moxiegirl <mary@docker.com>
Mary Anthony <mary.anthony@docker.com> <moxieandmore@gmail.com>
mattyw <mattyw@me.com> <gh@mattyw.net>
resouer <resouer@163.com> <resouer@gmail.com>
AJ Bowen <aj@gandi.net> soulshake <amy@gandi.net>
AJ Bowen <aj@gandi.net> soulshake <aj@gandi.net>
Tibor Vass <teabee89@gmail.com> <tibor@docker.com>
Tibor Vass <teabee89@gmail.com> <tiborvass@users.noreply.github.com>
Vincent Bernat <bernat@luffy.cx> <Vincent.Bernat@exoscale.ch>
Yestin Sun <sunyi0804@gmail.com> <yestin.sun@polyera.com>
bin liu <liubin0329@users.noreply.github.com> <liubin0329@gmail.com>
John Howard (VM) <John.Howard@microsoft.com> jhowardmsft <jhoward@microsoft.com>
Ankush Agarwal <ankushagarwal11@gmail.com> <ankushagarwal@users.noreply.github.com>
Tangi COLIN <tangicolin@gmail.com> tangicolin <tangicolin@gmail.com>

View File

@@ -7,7 +7,7 @@ import (
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/pkg/signal"

View File

@@ -14,8 +14,8 @@ import (
"runtime"
"strings"
"github.com/docker/engine-api/types"
"github.com/docker/go-units"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/api"
"github.com/hyperhq/hypercli/builder/dockerignore"
Cli "github.com/hyperhq/hypercli/cli"

View File

@@ -9,9 +9,9 @@ import (
"os"
"runtime"
"github.com/docker/engine-api/client"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
"github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hypercli/api"
"github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/cliconfig"

View File

@@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -10,9 +10,9 @@ import (
"syscall"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/pkg/jsonmessage"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -9,7 +9,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/pkg/archive"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -9,10 +9,10 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
networktypes "github.com/docker/engine-api/types/network"
"github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
networktypes "github.com/hyperhq/hyper-api/types/network"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/pkg/jsonmessage"
"github.com/hyperhq/hypercli/reference"

View File

@@ -7,12 +7,12 @@ import (
"text/tabwriter"
"time"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/docker/engine-api/types/filters"
"github.com/docker/engine-api/types/network"
"github.com/docker/engine-api/types/strslice"
"github.com/docker/go-connections/nat"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hyper-api/types/strslice"
Cli "github.com/hyperhq/hypercli/cli"
ropts "github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -8,8 +8,8 @@ import (
"net/http"
"net/url"
"github.com/docker/engine-api/types/events"
"github.com/gorilla/websocket"
"github.com/hyperhq/hyper-api/types/events"
signutil "github.com/hyperhq/websocket-client/go/util"
"golang.org/x/net/context"
)

View File

@@ -9,7 +9,7 @@ import (
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/pkg/promise"

View File

@@ -5,8 +5,8 @@ import (
"io/ioutil"
"testing"
"github.com/hyperhq/hyper-api/types"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/docker/engine-api/types"
)
type arguments struct {
@@ -15,12 +15,12 @@ type arguments struct {
func TestParseExec(t *testing.T) {
invalids := map[*arguments]error{
&arguments{[]string{"-unknown"}}: fmt.Errorf("flag provided but not defined: -unknown"),
&arguments{[]string{"-u"}}: fmt.Errorf("flag needs an argument: -u"),
&arguments{[]string{"--user"}}: fmt.Errorf("flag needs an argument: --user"),
{[]string{"-unknown"}}: fmt.Errorf("flag provided but not defined: -unknown"),
{[]string{"-u"}}: fmt.Errorf("flag needs an argument: -u"),
{[]string{"--user"}}: fmt.Errorf("flag needs an argument: --user"),
}
valids := map[*arguments]*types.ExecConfig{
&arguments{
{
[]string{"container", "command"},
}: {
Container: "container",
@@ -28,7 +28,7 @@ func TestParseExec(t *testing.T) {
AttachStdout: true,
AttachStderr: true,
},
&arguments{
{
[]string{"container", "command1", "command2"},
}: {
Container: "container",
@@ -36,7 +36,7 @@ func TestParseExec(t *testing.T) {
AttachStdout: true,
AttachStderr: true,
},
&arguments{
{
[]string{"-i", "-t", "-u", "uid", "container", "command"},
}: {
User: "uid",
@@ -47,7 +47,7 @@ func TestParseExec(t *testing.T) {
Container: "container",
Cmd: []string{"command"},
},
&arguments{
{
[]string{"-d", "container", "command"},
}: {
AttachStdin: false,
@@ -57,7 +57,7 @@ func TestParseExec(t *testing.T) {
Container: "container",
Cmd: []string{"command"},
},
&arguments{
{
[]string{"-t", "-i", "-d", "container", "command"},
}: {
AttachStdin: false,

View File

@@ -10,8 +10,8 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -6,8 +6,8 @@ import (
"strings"
"time"
"github.com/docker/engine-api/types"
"github.com/docker/go-units"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/api"
"github.com/hyperhq/hypercli/pkg/stringid"
"github.com/hyperhq/hypercli/pkg/stringutils"

View File

@@ -6,8 +6,8 @@ import (
"testing"
"time"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/pkg/stringid"
"github.com/docker/engine-api/types"
)
func TestContainerPsContext(t *testing.T) {

View File

@@ -8,7 +8,7 @@ import (
"text/tabwriter"
"text/template"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/reference"
)

View File

@@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
)
func TestContainerContextWrite(t *testing.T) {

View File

@@ -11,13 +11,13 @@ import (
"text/tabwriter"
"time"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/docker/engine-api/types/filters"
"github.com/docker/engine-api/types/network"
"github.com/docker/engine-api/types/strslice"
"github.com/docker/go-connections/nat"
units "github.com/docker/go-units"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hyper-api/types/strslice"
Cli "github.com/hyperhq/hypercli/cli"
ropts "github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -4,8 +4,8 @@ import (
"io"
"github.com/Sirupsen/logrus"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/pkg/stdcopy"
"github.com/docker/engine-api/types"
)
func (cli *DockerCli) holdHijackedConnection(tty bool, inputStream io.ReadCloser, outputStream, errorStream io.Writer, resp types.HijackedResponse) error {

View File

@@ -1,8 +1,8 @@
package client
import (
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hypercli/api/client/formatter"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"

View File

@@ -7,7 +7,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"
"github.com/hyperhq/hypercli/pkg/jsonmessage"

View File

@@ -7,7 +7,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/client"
"github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hypercli/api/client/inspect"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -10,7 +10,7 @@ import (
"path/filepath"
"strings"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/image"
"github.com/hyperhq/hypercli/pkg/archive"

View File

@@ -10,8 +10,8 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/pkg/term"

View File

@@ -6,7 +6,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/pkg/stdcopy"

View File

@@ -8,9 +8,9 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/docker/engine-api/types/network"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/network"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -1,8 +1,8 @@
package client
import (
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hypercli/api/client/formatter"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"

View File

@@ -6,7 +6,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/pkg/jsonmessage"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -3,7 +3,7 @@ package client
import (
"io"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/pkg/jsonmessage"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -6,7 +6,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
)

View File

@@ -7,7 +7,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
)

View File

@@ -8,8 +8,8 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/types"
"github.com/docker/libnetwork/resolvconf/dns"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
derr "github.com/hyperhq/hypercli/errors"
"github.com/hyperhq/hypercli/opts"

View File

@@ -9,8 +9,8 @@ import (
"golang.org/x/net/context"
"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"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/pkg/stringutils"

View File

@@ -7,9 +7,9 @@ import (
"strings"
"text/tabwriter"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/docker/engine-api/types/strslice"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/strslice"
Cli "github.com/hyperhq/hypercli/cli"
ropts "github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -6,8 +6,8 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -9,7 +9,7 @@ import (
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/hyperhq/hypercli/pkg/promise"

View File

@@ -7,8 +7,8 @@ import (
"sync"
"time"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/events"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/events"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/cli/command"
"github.com/hyperhq/hypercli/cli/command/formatter"

View File

@@ -8,8 +8,8 @@ import (
"sync"
"time"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/events"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/events"
"github.com/hyperhq/hypercli/cli/command/formatter"
"golang.org/x/net/context"
)

View File

@@ -3,7 +3,7 @@ package client
import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
flag "github.com/hyperhq/hypercli/pkg/mflag"
)

View File

@@ -21,8 +21,6 @@ import (
"github.com/docker/distribution/digest"
"github.com/docker/distribution/registry/client/auth"
"github.com/docker/distribution/registry/client/transport"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/docker/go-connections/tlsconfig"
"github.com/docker/notary/client"
"github.com/docker/notary/passphrase"
@@ -30,6 +28,8 @@ import (
"github.com/docker/notary/tuf/data"
"github.com/docker/notary/tuf/signed"
"github.com/docker/notary/tuf/store"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/cliconfig"
"github.com/hyperhq/hypercli/distribution"
"github.com/hyperhq/hypercli/dockerversion"

View File

@@ -4,8 +4,8 @@ import (
"os"
"testing"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/registry"
registrytypes "github.com/docker/engine-api/types/registry"
)
func unsetENV() {

View File

@@ -14,10 +14,10 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/dutchcoders/goftp"
"github.com/hyperhq/hyper-api/client"
"github.com/hyperhq/hyper-api/types"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hypercli/pkg/signal"
"github.com/hyperhq/hypercli/pkg/term"
"github.com/hyperhq/hypercli/registry"

View File

@@ -7,7 +7,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/dockerversion"
flag "github.com/hyperhq/hypercli/pkg/mflag"

View File

@@ -16,8 +16,8 @@ import (
flag "github.com/hyperhq/hypercli/pkg/mflag"
"github.com/cheggaaa/pb"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"golang.org/x/net/context"
)

View File

@@ -9,10 +9,10 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/libtrust"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/pkg/system"
"github.com/hyperhq/hypercli/pkg/version"
"github.com/docker/engine-api/types"
"github.com/docker/libtrust"
)
// Common constants for daemon and client.

View File

@@ -7,7 +7,7 @@ import (
"os"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
)
type ports struct {

View File

@@ -1,8 +1,8 @@
package build
import (
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/builder"
"github.com/docker/engine-api/types"
"io"
)

View File

@@ -12,15 +12,15 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/go-units"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/builder"
"github.com/hyperhq/hypercli/pkg/ioutils"
"github.com/hyperhq/hypercli/pkg/progress"
"github.com/hyperhq/hypercli/pkg/streamformatter"
"github.com/hyperhq/hypercli/utils"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/docker/go-units"
"golang.org/x/net/context"
)

View File

@@ -4,12 +4,12 @@ import (
"io"
"time"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/daemon"
"github.com/hyperhq/hypercli/daemon/exec"
"github.com/hyperhq/hypercli/pkg/archive"
"github.com/hyperhq/hypercli/pkg/version"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
)
// execBackend includes functions to implement to provide exec functionality.

View File

@@ -12,9 +12,9 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/registry/api/errcode"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
timetypes "github.com/docker/engine-api/types/time"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
timetypes "github.com/hyperhq/hyper-api/types/time"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/daemon"
derr "github.com/hyperhq/hypercli/errors"

View File

@@ -9,8 +9,8 @@ import (
"os"
"strings"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/docker/engine-api/types"
"golang.org/x/net/context"
)

View File

@@ -8,10 +8,10 @@ import (
"strconv"
"github.com/Sirupsen/logrus"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/pkg/stdcopy"
"github.com/hyperhq/hypercli/utils"
"github.com/docker/engine-api/types"
"golang.org/x/net/context"
)

View File

@@ -12,6 +12,8 @@ import (
"github.com/docker/distribution/digest"
"github.com/docker/distribution/registry/api/errcode"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/builder/dockerfile"
derr "github.com/hyperhq/hypercli/errors"
@@ -19,8 +21,6 @@ import (
"github.com/hyperhq/hypercli/pkg/streamformatter"
"github.com/hyperhq/hypercli/reference"
"github.com/hyperhq/hypercli/runconfig"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"golang.org/x/net/context"
)

View File

@@ -1,8 +1,8 @@
package network
import (
"github.com/docker/engine-api/types/network"
"github.com/docker/libnetwork"
"github.com/hyperhq/hyper-api/types/network"
)
// Backend is all the methods that need to be implemented to provide

View File

@@ -5,9 +5,9 @@ import (
"regexp"
"strings"
"github.com/hyperhq/hypercli/runconfig"
"github.com/docker/engine-api/types/filters"
"github.com/docker/libnetwork"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hypercli/runconfig"
)
type filterHandler func([]libnetwork.Network, string) ([]libnetwork.Network, error)

View File

@@ -7,13 +7,13 @@ import (
"golang.org/x/net/context"
"github.com/docker/libnetwork"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/filters"
"github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/daemon"
"github.com/hyperhq/hypercli/runconfig"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/docker/engine-api/types/network"
"github.com/docker/libnetwork"
)
func (n *networkRouter) getNetworksList(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

View File

@@ -1,9 +1,9 @@
package system
import (
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/events"
"github.com/docker/engine-api/types/filters"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/events"
"github.com/hyperhq/hyper-api/types/filters"
)
// Backend is the methods that need to be implemented to provide

View File

@@ -6,13 +6,13 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/events"
"github.com/hyperhq/hyper-api/types/filters"
timetypes "github.com/hyperhq/hyper-api/types/time"
"github.com/hyperhq/hypercli/api"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/pkg/ioutils"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/events"
"github.com/docker/engine-api/types/filters"
timetypes "github.com/docker/engine-api/types/time"
"golang.org/x/net/context"
)

View File

@@ -2,7 +2,7 @@ package volume
import (
// TODO return types need to be refactored into pkg
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
)
// Backend is the methods that need to be implemented to provide

View File

@@ -4,8 +4,8 @@ import (
"encoding/json"
"net/http"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/docker/engine-api/types"
"golang.org/x/net/context"
)

View File

@@ -7,6 +7,8 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/go-connections/sockets"
"github.com/gorilla/mux"
"github.com/hyperhq/hypercli/api/server/httputils"
"github.com/hyperhq/hypercli/api/server/router"
"github.com/hyperhq/hypercli/api/server/router/build"
@@ -19,8 +21,6 @@ import (
"github.com/hyperhq/hypercli/daemon"
"github.com/hyperhq/hypercli/pkg/authorization"
"github.com/hyperhq/hypercli/utils"
"github.com/docker/go-connections/sockets"
"github.com/gorilla/mux"
"golang.org/x/net/context"
)

View File

@@ -10,8 +10,8 @@ import (
"time"
"github.com/docker/docker/reference"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
)
// Context represents a file system tree.

View File

@@ -15,8 +15,8 @@ import (
"github.com/docker/docker/builder/dockerfile/parser"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/reference"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
)
var validCommitCommands = map[string]bool{

View File

@@ -23,9 +23,9 @@ import (
"github.com/docker/docker/pkg/signal"
"github.com/docker/docker/pkg/system"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types/container"
"github.com/docker/engine-api/types/strslice"
"github.com/docker/go-connections/nat"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hyper-api/types/strslice"
)
// dispatch with no layer / parsing. This is effectively not a command.

View File

@@ -33,9 +33,9 @@ import (
"github.com/docker/docker/pkg/tarsum"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/docker/engine-api/types/strslice"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hyper-api/types/strslice"
)
func (b *Builder) commit(id string, autoCmd *strslice.StrSlice, comment string) error {

View File

@@ -3,7 +3,7 @@ package command
import (
"sync"
eventtypes "github.com/docker/engine-api/types/events"
eventtypes "github.com/hyperhq/hyper-api/types/events"
)
type eventProcessor func(eventtypes.Message, error) error

View File

@@ -10,7 +10,7 @@ import (
"path/filepath"
"strings"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/pkg/homedir"
)

View File

@@ -7,8 +7,8 @@ import (
"strings"
"testing"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/pkg/homedir"
"github.com/docker/engine-api/types"
)
func TestEmptyConfigDir(t *testing.T) {

View File

@@ -5,7 +5,7 @@ import (
"path/filepath"
"github.com/docker/docker/pkg/archive"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api/types"
)
// ResolvePath resolves the given path in the container to a resource on the

View File

@@ -24,8 +24,8 @@ import (
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/volume"
containertypes "github.com/docker/engine-api/types/container"
"github.com/docker/go-connections/nat"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/opencontainers/runc/libcontainer/label"
)

View File

@@ -4,7 +4,7 @@ import (
"testing"
"github.com/docker/docker/pkg/signal"
"github.com/docker/engine-api/types/container"
"github.com/hyperhq/hyper-api/types/container"
)
func TestContainerStopSignal(t *testing.T) {

View File

@@ -21,13 +21,13 @@ import (
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/docker/utils"
"github.com/docker/docker/volume"
containertypes "github.com/docker/engine-api/types/container"
"github.com/docker/engine-api/types/network"
"github.com/docker/go-connections/nat"
"github.com/docker/libnetwork"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/options"
"github.com/docker/libnetwork/types"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hyper-api/types/network"
"github.com/opencontainers/runc/libcontainer/label"
)

View File

@@ -5,7 +5,7 @@ package container
import (
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/volume"
"github.com/docker/engine-api/types/container"
"github.com/hyperhq/hyper-api/types/container"
)
// Container holds fields specific to the Windows implementation. See

View File

@@ -14,7 +14,7 @@ import (
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/utils"
"github.com/docker/engine-api/types/container"
"github.com/hyperhq/hyper-api/types/container"
)
const (

View File

@@ -7,13 +7,13 @@ import (
"path/filepath"
"strings"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/builder"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/pkg/archive"
"github.com/hyperhq/hypercli/pkg/chrootarchive"
"github.com/hyperhq/hypercli/pkg/idtools"
"github.com/hyperhq/hypercli/pkg/ioutils"
"github.com/docker/engine-api/types"
)
// ErrExtractPointNotDirectory is used to convey that the operation to extract

View File

@@ -7,6 +7,9 @@ import (
"strings"
"time"
"github.com/docker/go-connections/nat"
"github.com/hyperhq/hyper-api/types"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/dockerversion"
"github.com/hyperhq/hypercli/image"
@@ -14,9 +17,6 @@ import (
"github.com/hyperhq/hypercli/pkg/archive"
"github.com/hyperhq/hypercli/pkg/ioutils"
"github.com/hyperhq/hypercli/reference"
"github.com/docker/engine-api/types"
containertypes "github.com/docker/engine-api/types/container"
"github.com/docker/go-connections/nat"
)
// merge merges two Config, the image container configuration (defaults values),

View File

@@ -5,10 +5,10 @@ package daemon
import (
"net"
"github.com/docker/go-units"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"
runconfigopts "github.com/hyperhq/hypercli/runconfig/opts"
"github.com/docker/go-units"
)
var (

View File

@@ -13,6 +13,12 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/go-units"
"github.com/docker/libnetwork"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/options"
containertypes "github.com/hyperhq/hyper-api/types/container"
networktypes "github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/daemon/execdriver"
"github.com/hyperhq/hypercli/daemon/links"
@@ -23,12 +29,6 @@ import (
"github.com/hyperhq/hypercli/pkg/mount"
"github.com/hyperhq/hypercli/pkg/stringid"
"github.com/hyperhq/hypercli/runconfig"
containertypes "github.com/docker/engine-api/types/container"
networktypes "github.com/docker/engine-api/types/network"
"github.com/docker/go-units"
"github.com/docker/libnetwork"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/options"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/devices"
"github.com/opencontainers/runc/libcontainer/label"

View File

@@ -5,13 +5,13 @@ package daemon
import (
"strings"
"github.com/docker/libnetwork"
networktypes "github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/daemon/execdriver"
"github.com/hyperhq/hypercli/daemon/execdriver/windows"
derr "github.com/hyperhq/hypercli/errors"
"github.com/hyperhq/hypercli/layer"
networktypes "github.com/docker/engine-api/types/network"
"github.com/docker/libnetwork"
)
func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]string, error) {

View File

@@ -2,6 +2,9 @@ package daemon
import (
"github.com/Sirupsen/logrus"
"github.com/hyperhq/hyper-api/types"
containertypes "github.com/hyperhq/hyper-api/types/container"
networktypes "github.com/hyperhq/hyper-api/types/network"
"github.com/hyperhq/hypercli/container"
derr "github.com/hyperhq/hypercli/errors"
"github.com/hyperhq/hypercli/image"
@@ -9,9 +12,6 @@ import (
"github.com/hyperhq/hypercli/pkg/idtools"
"github.com/hyperhq/hypercli/pkg/stringid"
volumestore "github.com/hyperhq/hypercli/volume/store"
"github.com/docker/engine-api/types"
containertypes "github.com/docker/engine-api/types/container"
networktypes "github.com/docker/engine-api/types/network"
"github.com/opencontainers/runc/libcontainer/label"
)

View File

@@ -7,10 +7,10 @@ import (
"path/filepath"
"github.com/Sirupsen/logrus"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
derr "github.com/hyperhq/hypercli/errors"
"github.com/hyperhq/hypercli/pkg/stringid"
containertypes "github.com/docker/engine-api/types/container"
"github.com/opencontainers/runc/libcontainer/label"
)

View File

@@ -3,10 +3,10 @@ package daemon
import (
"fmt"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/pkg/stringid"
"github.com/hyperhq/hypercli/volume"
containertypes "github.com/docker/engine-api/types/container"
)
// createContainerPlatformSpecificSettings performs platform specific container create functionality

View File

@@ -21,6 +21,13 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/digest"
"github.com/hyperhq/hyper-api/types"
containertypes "github.com/hyperhq/hyper-api/types/container"
eventtypes "github.com/hyperhq/hyper-api/types/events"
"github.com/hyperhq/hyper-api/types/filters"
networktypes "github.com/hyperhq/hyper-api/types/network"
registrytypes "github.com/hyperhq/hyper-api/types/registry"
"github.com/hyperhq/hyper-api/types/strslice"
"github.com/hyperhq/hypercli/api"
"github.com/hyperhq/hypercli/builder"
"github.com/hyperhq/hypercli/container"
@@ -28,14 +35,11 @@ import (
"github.com/hyperhq/hypercli/daemon/exec"
"github.com/hyperhq/hypercli/daemon/execdriver"
"github.com/hyperhq/hypercli/daemon/execdriver/execdrivers"
"github.com/docker/engine-api/types"
containertypes "github.com/docker/engine-api/types/container"
eventtypes "github.com/docker/engine-api/types/events"
"github.com/docker/engine-api/types/filters"
networktypes "github.com/docker/engine-api/types/network"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/docker/engine-api/types/strslice"
// register graph drivers
"github.com/docker/go-connections/nat"
"github.com/docker/libnetwork"
lntypes "github.com/docker/libnetwork/types"
"github.com/docker/libtrust"
_ "github.com/hyperhq/hypercli/daemon/graphdriver/register"
"github.com/hyperhq/hypercli/daemon/logger"
"github.com/hyperhq/hypercli/daemon/network"
@@ -69,10 +73,6 @@ import (
volumedrivers "github.com/hyperhq/hypercli/volume/drivers"
"github.com/hyperhq/hypercli/volume/local"
"github.com/hyperhq/hypercli/volume/store"
"github.com/docker/go-connections/nat"
"github.com/docker/libnetwork"
lntypes "github.com/docker/libnetwork/types"
"github.com/docker/libtrust"
"github.com/opencontainers/runc/libcontainer"
"golang.org/x/net/context"
)

View File

@@ -2,7 +2,7 @@
package daemon
import "github.com/docker/engine-api/types/container"
import "github.com/hyperhq/hyper-api/types/container"
func (daemon *Daemon) verifyExperimentalContainerSettings(hostConfig *container.HostConfig, config *container.Config) ([]string, error) {
return nil, nil

View File

@@ -2,7 +2,7 @@
package daemon
import "github.com/docker/engine-api/types/container"
import "github.com/hyperhq/hyper-api/types/container"
func (daemon *Daemon) verifyExperimentalContainerSettings(hostConfig *container.HostConfig, config *container.Config) ([]string, error) {
return nil, nil

View File

@@ -8,6 +8,8 @@ import (
"testing"
"time"
"github.com/docker/go-connections/nat"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/pkg/discovery"
_ "github.com/hyperhq/hypercli/pkg/discovery/memory"
@@ -17,8 +19,6 @@ import (
volumedrivers "github.com/hyperhq/hypercli/volume/drivers"
"github.com/hyperhq/hypercli/volume/local"
"github.com/hyperhq/hypercli/volume/store"
containertypes "github.com/docker/engine-api/types/container"
"github.com/docker/go-connections/nat"
)
//

View File

@@ -15,6 +15,15 @@ import (
"syscall"
"github.com/Sirupsen/logrus"
"github.com/docker/libnetwork"
nwconfig "github.com/docker/libnetwork/config"
"github.com/docker/libnetwork/drivers/bridge"
"github.com/docker/libnetwork/ipamutils"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/options"
"github.com/docker/libnetwork/types"
pblkiodev "github.com/hyperhq/hyper-api/types/blkiodev"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
derr "github.com/hyperhq/hypercli/errors"
"github.com/hyperhq/hypercli/image"
@@ -26,15 +35,6 @@ import (
"github.com/hyperhq/hypercli/reference"
"github.com/hyperhq/hypercli/runconfig"
runconfigopts "github.com/hyperhq/hypercli/runconfig/opts"
pblkiodev "github.com/docker/engine-api/types/blkiodev"
containertypes "github.com/docker/engine-api/types/container"
"github.com/docker/libnetwork"
nwconfig "github.com/docker/libnetwork/config"
"github.com/docker/libnetwork/drivers/bridge"
"github.com/docker/libnetwork/ipamutils"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/options"
"github.com/docker/libnetwork/types"
blkiodev "github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/label"
"github.com/opencontainers/runc/libcontainer/user"

View File

@@ -7,8 +7,8 @@ import (
"os"
"testing"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
containertypes "github.com/docker/engine-api/types/container"
)
// Unix test as uses settings which are not available on Windows

View File

@@ -10,18 +10,18 @@ import (
"strings"
"github.com/Sirupsen/logrus"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
"github.com/hyperhq/hypercli/daemon/graphdriver"
"github.com/hyperhq/hypercli/dockerversion"
"github.com/hyperhq/hypercli/image"
"github.com/hyperhq/hypercli/layer"
"github.com/hyperhq/hypercli/reference"
containertypes "github.com/docker/engine-api/types/container"
// register the windows graph driver
"github.com/docker/libnetwork"
"github.com/hyperhq/hypercli/daemon/graphdriver/windows"
"github.com/hyperhq/hypercli/pkg/idtools"
"github.com/hyperhq/hypercli/pkg/system"
"github.com/docker/libnetwork"
blkiodev "github.com/opencontainers/runc/libcontainer/configs"
)

View File

@@ -7,11 +7,11 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/hyperhq/hyper-api/types"
"github.com/hyperhq/hypercli/container"
derr "github.com/hyperhq/hypercli/errors"
"github.com/hyperhq/hypercli/layer"
volumestore "github.com/hyperhq/hypercli/volume/store"
"github.com/docker/engine-api/types"
)
// ContainerRm removes the container id from the filesystem. An error

View File

@@ -5,9 +5,9 @@ import (
"os"
"testing"
"github.com/hyperhq/hyper-api/types"
containertypes "github.com/hyperhq/hyper-api/types/container"
"github.com/hyperhq/hypercli/container"
"github.com/docker/engine-api/types"
containertypes "github.com/docker/engine-api/types/container"
)
func TestContainerDoubleDelete(t *testing.T) {

View File

@@ -3,9 +3,9 @@ package daemon
import (
"strings"
"github.com/hyperhq/hypercli/container"
"github.com/docker/engine-api/types/events"
"github.com/docker/libnetwork"
"github.com/hyperhq/hyper-api/types/events"
"github.com/hyperhq/hypercli/container"
)
// LogContainerEvent generates an event related to a container with only the default attributes.

Some files were not shown because too many files have changed in this diff Show More