commit
b9ffd277b9
28 changed files with 56 additions and 56 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"io/ioutil"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod"
|
||||
"github.com/kubernetes-incubator/cri-o/lib"
|
||||
)
|
||||
|
||||
//CrioConfigPath is the default location for the conf file
|
||||
|
@ -14,7 +14,7 @@ const CrioConfigPath = "/etc/crio/crio.conf"
|
|||
// Config represents the entire set of configuration values that can be set for
|
||||
// the server. This is intended to be loaded from a toml-encoded config file.
|
||||
type Config struct {
|
||||
libkpod.Config
|
||||
lib.Config
|
||||
APIConfig
|
||||
}
|
||||
|
||||
|
@ -37,11 +37,11 @@ type APIConfig struct {
|
|||
// conversions.
|
||||
type tomlConfig struct {
|
||||
Crio struct {
|
||||
libkpod.RootConfig
|
||||
API struct{ APIConfig } `toml:"api"`
|
||||
Runtime struct{ libkpod.RuntimeConfig } `toml:"runtime"`
|
||||
Image struct{ libkpod.ImageConfig } `toml:"image"`
|
||||
Network struct{ libkpod.NetworkConfig } `toml:"network"`
|
||||
lib.RootConfig
|
||||
API struct{ APIConfig } `toml:"api"`
|
||||
Runtime struct{ lib.RuntimeConfig } `toml:"runtime"`
|
||||
Image struct{ lib.ImageConfig } `toml:"image"`
|
||||
Network struct{ lib.NetworkConfig } `toml:"network"`
|
||||
} `toml:"crio"`
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ func (c *Config) ToFile(path string) error {
|
|||
// DefaultConfig returns the default configuration for crio.
|
||||
func DefaultConfig() *Config {
|
||||
return &Config{
|
||||
Config: *libkpod.DefaultConfig(),
|
||||
Config: *lib.DefaultConfig(),
|
||||
APIConfig: APIConfig{
|
||||
Listen: "/var/run/crio/crio.sock",
|
||||
StreamAddress: "",
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod"
|
||||
"github.com/kubernetes-incubator/cri-o/lib"
|
||||
)
|
||||
|
||||
const fixturePath = "fixtures/crio.conf"
|
||||
|
@ -44,7 +44,7 @@ func assertAllFieldsEquality(t *testing.T, c Config) {
|
|||
{c.ImageConfig.PauseImage, "kubernetes/pause"},
|
||||
{c.ImageConfig.PauseCommand, "/pause"},
|
||||
{c.ImageConfig.SignaturePolicyPath, "/tmp"},
|
||||
{c.ImageConfig.ImageVolumes, libkpod.ImageVolumesType("mkdir")},
|
||||
{c.ImageConfig.ImageVolumes, lib.ImageVolumesType("mkdir")},
|
||||
{c.ImageConfig.InsecureRegistries[0], "insecure-registry:1234"},
|
||||
{c.ImageConfig.Registries[0], "registry:4321"},
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ import (
|
|||
dockermounts "github.com/docker/docker/pkg/mount"
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
"github.com/docker/docker/pkg/symlink"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/kubernetes-incubator/cri-o/pkg/annotations"
|
||||
"github.com/kubernetes-incubator/cri-o/pkg/storage"
|
||||
|
@ -234,11 +234,11 @@ func addImageVolumes(rootfs string, s *Server, containerInfo *storage.ContainerI
|
|||
return nil, err
|
||||
}
|
||||
switch s.config.ImageVolumes {
|
||||
case libkpod.ImageVolumesMkdir:
|
||||
case lib.ImageVolumesMkdir:
|
||||
if err1 := os.MkdirAll(fp, 0644); err1 != nil {
|
||||
return nil, err1
|
||||
}
|
||||
case libkpod.ImageVolumesBind:
|
||||
case lib.ImageVolumesBind:
|
||||
volumeDirName := stringid.GenerateNonCryptoID()
|
||||
src := filepath.Join(containerInfo.RunDir, "mounts", volumeDirName)
|
||||
if err1 := os.MkdirAll(src, 0644); err1 != nil {
|
||||
|
@ -258,7 +258,7 @@ func addImageVolumes(rootfs string, s *Server, containerInfo *storage.ContainerI
|
|||
Options: []string{"rw"},
|
||||
})
|
||||
|
||||
case libkpod.ImageVolumesIgnore:
|
||||
case lib.ImageVolumesIgnore:
|
||||
logrus.Debugf("Ignoring volume %v", dest)
|
||||
default:
|
||||
logrus.Fatalf("Unrecognized image volumes setting")
|
||||
|
@ -424,7 +424,7 @@ func buildOCIProcessArgs(containerKubeConfig *pb.ContainerConfig, imageOCIConfig
|
|||
}
|
||||
|
||||
// addOCIHook look for hooks programs installed in hooksDirPath and add them to spec
|
||||
func addOCIHook(specgen *generate.Generator, hook libkpod.HookParams) error {
|
||||
func addOCIHook(specgen *generate.Generator, hook lib.HookParams) error {
|
||||
logrus.Debugf("AddOCIHook", hook)
|
||||
for _, stage := range hook.Stage {
|
||||
switch stage {
|
||||
|
@ -616,7 +616,7 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
|
|||
func (s *Server) setupOCIHooks(specgen *generate.Generator, sb *sandbox.Sandbox, containerConfig *pb.ContainerConfig, command string) error {
|
||||
mounts := containerConfig.GetMounts()
|
||||
addedHooks := map[string]struct{}{}
|
||||
addHook := func(hook libkpod.HookParams) error {
|
||||
addHook := func(hook lib.HookParams) error {
|
||||
// Only add a hook once
|
||||
if _, ok := addedHooks[hook.Hook]; !ok {
|
||||
if err := addOCIHook(specgen, hook); err != nil {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/go-zoo/bone"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/kubernetes-incubator/cri-o/types"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
|
|
@ -7,14 +7,14 @@ import (
|
|||
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||
|
||||
"github.com/containernetworking/plugins/pkg/ns"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
|
||||
func TestGetInfo(t *testing.T) {
|
||||
c := libkpod.DefaultConfig()
|
||||
c := lib.DefaultConfig()
|
||||
c.RootConfig.Storage = "afoobarstorage"
|
||||
c.RootConfig.Root = "afoobarroot"
|
||||
c.RuntimeConfig.CgroupManager = "systemd"
|
||||
|
|
|
@ -3,7 +3,7 @@ package server
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/net/context"
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/kubernetes/pkg/kubelet/network/hostport"
|
||||
)
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/containers/storage"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
pkgstorage "github.com/kubernetes-incubator/cri-o/pkg/storage"
|
||||
"github.com/pkg/errors"
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/containers/storage"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/kubernetes-incubator/cri-o/pkg/annotations"
|
||||
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"github.com/containers/storage"
|
||||
"github.com/docker/docker/pkg/mount"
|
||||
"github.com/docker/docker/pkg/symlink"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/opencontainers/selinux/go-selinux/label"
|
||||
"github.com/pkg/errors"
|
||||
|
|
|
@ -15,8 +15,8 @@ import (
|
|||
|
||||
"github.com/cri-o/ocicni/pkg/ocicni"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/kubernetes-incubator/cri-o/pkg/storage"
|
||||
"github.com/kubernetes-incubator/cri-o/server/apparmor"
|
||||
|
@ -53,7 +53,7 @@ type streamService struct {
|
|||
|
||||
// Server implements the RuntimeService and ImageService
|
||||
type Server struct {
|
||||
*libkpod.ContainerServer
|
||||
*lib.ContainerServer
|
||||
config Config
|
||||
|
||||
updateLock sync.RWMutex
|
||||
|
@ -190,7 +190,7 @@ func New(config *Config) (*Server, error) {
|
|||
if err := os.MkdirAll(config.ContainerExitsDir, 0755); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
containerServer, err := libkpod.New(&config.Config)
|
||||
containerServer, err := lib.New(&config.Config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/cri-o/ocicni/pkg/ocicni"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/server/metrics"
|
||||
"github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/opencontainers/runtime-tools/validate"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue