new vendoring

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-09-20 10:16:59 +02:00
parent dee7479483
commit e269cb8b7e
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
350 changed files with 128937 additions and 8 deletions

View file

@ -10,7 +10,7 @@ import (
"github.com/kubernetes-incubator/ocid/oci"
"github.com/kubernetes-incubator/ocid/utils"
pb "github.com/kubernetes/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
"github.com/opencontainers/ocitools/generate"
"github.com/opencontainers/runtime-tools/generate"
"golang.org/x/net/context"
)
@ -250,12 +250,12 @@ func (s *Server) createSandboxContainer(name string, sb *sandbox, SandboxConfig
"network": "net",
} {
nsPath := fmt.Sprintf("/proc/%d/ns/%s", podInfraState.Pid, nsFile)
if err := specgen.AddOrReplaceLinuxNamespace(nsType, nsPath); err != nil {
if err = specgen.AddOrReplaceLinuxNamespace(nsType, nsPath); err != nil {
return nil, err
}
}
if err := specgen.SaveToFile(filepath.Join(containerDir, "config.json")); err != nil {
if err = specgen.SaveToFile(filepath.Join(containerDir, "config.json")); err != nil {
return nil, err
}
@ -271,7 +271,7 @@ func (s *Server) createSandboxContainer(name string, sb *sandbox, SandboxConfig
// TODO: copy the rootfs into the bundle.
// Currently, utils.CreateFakeRootfs is used to populate the rootfs.
if err := utils.CreateFakeRootfs(containerDir, image); err != nil {
if err = utils.CreateFakeRootfs(containerDir, image); err != nil {
return nil, err
}

View file

@ -11,7 +11,7 @@ import (
"github.com/kubernetes-incubator/ocid/oci"
"github.com/kubernetes-incubator/ocid/utils"
pb "github.com/kubernetes/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
"github.com/opencontainers/ocitools/generate"
"github.com/opencontainers/runtime-tools/generate"
"golang.org/x/net/context"
)
@ -211,7 +211,9 @@ func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxR
s.addContainer(container)
s.podIDIndex.Add(id)
if err = s.podIDIndex.Add(id); err != nil {
return nil, err
}
if err = s.runtime.UpdateStatus(container); err != nil {
return nil, err

View file

@ -47,6 +47,10 @@ func (s *Server) loadSandbox(id string) error {
return err
}
name := m.Annotations["ocid/name"]
name, err = s.reservePodName(id, name)
if err != nil {
return err
}
s.addSandbox(&sandbox{
id: id,
name: name,
@ -63,8 +67,9 @@ func (s *Server) loadSandbox(id string) error {
if err = s.runtime.UpdateStatus(scontainer); err != nil {
logrus.Warnf("error updating status for container %s: %v", scontainer, err)
}
s.podIDIndex.Add(id)
s.reservePodName(id, name)
if err = s.podIDIndex.Add(id); err != nil {
return err
}
return nil
}