Skip to content

Instantly share code, notes, and snippets.

View carmark's full-sized avatar

Lei Xue carmark

  • Beijing, China
View GitHub Profile
diff --git a/hypervisor/devicemap.go b/hypervisor/devicemap.go
index fe97932..280c1b4 100644
--- a/hypervisor/devicemap.go
+++ b/hypervisor/devicemap.go
@@ -157,16 +157,25 @@ func (ctx *VmContext) setContainerInfo(index int, container *VmContainer, info *
}
if info.Fstype == "dir" {
- container.Image = info.Image
+ container.Image = info.Image.Source
diff --git a/daemon/pod.go b/daemon/pod.go
index 5dd580e..e2f93b4 100644
--- a/daemon/pod.go
+++ b/daemon/pod.go
@@ -256,7 +256,8 @@ func (p *Pod) InitContainers(daemon *Daemon) error {
if !ok {
return errors.New("fail to get container data, cast failed")
}
- p.status.AddContainer(p.cloudCid, rsp.Name, rsp.Config.Image, []string{}, types.S_POD_CREATED)
+ cmds := append([]string{rsp.Path}, rsp.Args...)
{ "_id" : "4e2f0205e61ff42ef0f07b593e59ee5fc25d19ec94d1a93c3dbc7420ef5b433b", "streamconfig" : { }, "state" : { "mutex" : { }, "running" : false, "paused" : false, "restarting" : false, "oomkilled" : false, "removalinprogress" : false, "dead" : false, "pid" : 0, "exitcode" : 0, "error" : "", "startedat" : ISODate("0001-01-01T00:00:00Z"), "finishedat" : ISODate("0001-01-01T00:00:00Z") }, "created" : ISODate("2016-03-12T10:54:20.991Z"), "path" : "/bin/bash", "args" : [ ], "config" : { "hostname" : "4e2f0205e61f", "domainname" : "", "user" : "", "attachstdin" : true, "attachstdout" : true, "attachstderr" : true, "exposedports" : { }, "publishservice" : "", "tty" : true, "openstdin" : true, "stdinonce" : true, "env" : [ ], "cmd" : { }, "argsescaped" : false, "image" : "ubuntu", "volumes" : { }, "workingdir" : "", "entrypoint" : null, "networkdisabled" : true, "macaddress" : "", "onbuild" : [ ], "labels" : { }, "stopsignal" : "SIGTERM" }, "imageid" : "sha256:07c86167cdc4264926fa5d2894e34a339ad27f730e8cc81a16
I0312 18:54:33.001941 47898 init_comm.go:90] data length is 12
I0312 18:54:33.001945 47898 init_comm.go:76] trying to read 4 bytes
I0312 18:54:33.001951 47898 init_comm.go:86] read 12/12 [length = 12]
I0312 18:54:33.001957 47898 init_comm.go:76] trying to read 8 bytes
I0312 18:54:33.001961 47898 init_comm.go:86] read 8/8 [length = 0]
I0312 18:54:33.001964 47898 init_comm.go:90] data length is 8
I0312 18:54:33.001967 47898 init_comm.go:76] trying to read 8 bytes
I0312 18:54:33.001974 47898 init_comm.go:167] got cmd:14
I0312 18:54:33.001978 47898 init_comm.go:235] get command NEXT
I0312 18:54:33.001982 47898 init_comm.go:238] send 8, receive 8

pull images

# hyperclient pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
5a132a7e7af1: Downloading [===================>                               ] 25.41 MB/65.69 MB
fd2731e4c50c: Download complete
28a2f68d1120: Download complete
package main
import (
"bytes"
"crypto/hmac"
"crypto/sha1"
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go
index de490c8..a3d9a37 100644
--- a/pkg/apiserver/api_installer.go
+++ b/pkg/apiserver/api_installer.go
@@ -673,7 +673,7 @@ func (a *APIInstaller) registerFipsHandlers(ws *restful.WebService) error {
Filter(m).
Doc(doc).
Operation("postfips"+subAction).
- Consumes(restful.MIME_XML, restful.MIME_JSON).
+ Consumes(restful.MIME_XML, restful.MIME_JSON, "text/plain").
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/docker/engine-api/types"
"github.com/hyperhq/hyper-api-router/pkg/container"
package main
import (
"fmt"
"log"
"github.com/hyperhq/hyper-api-router/pkg/auth"
"gopkg.in/mgo.v2"
)
package main
import (
"fmt"
"log"
"github.com/hyperhq/hyper-api-router/pkg/auth"
"github.com/hyperhq/hyper-api-router/pkg/cell"
"github.com/hyperhq/hyper-api-router/pkg/resource"