Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"memo": "c69b3d661a6a19376099d94142598a44f109f155bc519d9b7943ac86e8ebcb8a",
"memo": "1290be673a75036ce5bea81021073dd7041dc3f421446912b6b7ae0ed511fe93",
"projects": [
{
"name": "github.com/BurntSushi/toml",
Expand Down Expand Up @@ -50,7 +50,7 @@
{
"name": "github.com/containers/image",
"branch": "master",
"revision": "1d7e25b91705e4d1cddb5396baf112caeb1119f3",
"revision": "9fcd2ba2c6983f74026db5f2c0f79b529a098dee",
"packages": [
"copy",
"directory",
Expand Down Expand Up @@ -159,10 +159,13 @@
"api/types/versions",
"api/types/volume",
"client",
"pkg/longpath",
"pkg/random",
"pkg/registrar",
"pkg/stringid",
"pkg/stringutils",
"pkg/symlink",
"pkg/system",
"pkg/tlsconfig",
"pkg/truncindex",
"utils/templates"
Expand Down
12 changes: 2 additions & 10 deletions pkg/storage/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,11 @@ func (r *runtimeService) createContainerOrPodSandbox(systemContext *types.System
return ContainerInfo{}, err
}
defer image.Close()
var imageConfig *v1.Image
configBlob, err := image.ConfigBlob()

imageConfig, err := image.OCIConfig()
if err != nil {
return ContainerInfo{}, err
}
if len(configBlob) > 0 {
config := v1.Image{}
err = json.Unmarshal(configBlob, &config)
if err != nil {
return ContainerInfo{}, err
}
imageConfig = &config
}

// Update the image name and ID.
if imageName == "" && len(img.Names) > 0 {
Expand Down
54 changes: 12 additions & 42 deletions server/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,7 @@ func buildOCIProcessArgs(containerKubeConfig *pb.ContainerConfig, imageOCIConfig
kubeArgs := containerKubeConfig.Args

if imageOCIConfig == nil {
// HACK We should error out here, not being able to get an Image config is fatal.
// When https://github.com/kubernetes-incubator/cri-o/issues/395 is fixed
// we'll remove that one and return an error here.
if containerKubeConfig.Metadata != nil {
logrus.Errorf("empty image config for %s", containerKubeConfig.Metadata.Name)

// HACK until https://github.com/kubernetes-incubator/cri-o/issues/395 is fixed.
// If the container is kubeadm's dummy, imageOCIConfig is nil, and both
// kubeCommands and kubeArgs are empty. So we set processArgs to /pause as the
// dummy container is just a pause one.
// (See https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/master/templates.go)
if containerKubeConfig.Metadata.Name == "dummy" {
return []string{podInfraCommand}, nil
}
} else {
logrus.Errorf("empty image config for %s", containerKubeConfig.Image.Image)
}
return nil, fmt.Errorf("empty image config for %s", containerKubeConfig.Image.Image)
}

// We got an OCI Image configuration.
Expand All @@ -98,22 +82,15 @@ func buildOCIProcessArgs(containerKubeConfig *pb.ContainerConfig, imageOCIConfig
// The kubelet command slice is prioritized.
processEntryPoint = kubeCommands
} else {
// Here the kubelet command slice is empty.
if imageOCIConfig != nil {
// If the OCI image config has an ENTRYPOINT we
// use it as our process command.
// Otherwise we use the CMD slice if it's not
// empty.
if imageOCIConfig.Config.Entrypoint != nil {
processEntryPoint = imageOCIConfig.Config.Entrypoint
} else if imageOCIConfig.Config.Cmd != nil {
processEntryPoint = imageOCIConfig.Config.Cmd
}
} else {
// We neither have a kubelet command not an image OCI config.
// Missing an image OCI config will no longer be supported after
// https://github.com/kubernetes-incubator/cri-o/issues/395 is fixed.
processEntryPoint = []string{"/bin/sh", "-c"}
// Here the kubelet command slice is empty but
// we know that our OCI Image configuration is not empty.
// If the OCI image config has an ENTRYPOINT we use it as
// our process command.
// Otherwise we use the CMD slice if it's not empty.
if imageOCIConfig.Config.Entrypoint != nil {
processEntryPoint = imageOCIConfig.Config.Entrypoint
} else if imageOCIConfig.Config.Cmd != nil {
processEntryPoint = imageOCIConfig.Config.Cmd
}
}

Expand All @@ -135,16 +112,9 @@ func buildOCIProcessArgs(containerKubeConfig *pb.ContainerConfig, imageOCIConfig
// we use the CMD slice as the process arguments.
// Otherwise, we already picked CMD as our process
// command and we must not add the CMD slice twice.
if imageOCIConfig != nil {
if imageOCIConfig.Config.Entrypoint != nil {
processCmd = imageOCIConfig.Config.Cmd
} else {
processCmd = []string{}
}
if imageOCIConfig.Config.Entrypoint != nil {
processCmd = imageOCIConfig.Config.Cmd
} else {
// Missing an image OCI config will no longer
// be supported after https://github.com/kubernetes-incubator/cri-o/issues/395
// is fixed.
processCmd = []string{}
}
}
Expand Down
5 changes: 4 additions & 1 deletion vendor/github.com/containers/image/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/containers/image/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/github.com/containers/image/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion vendor/github.com/containers/image/copy/copy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions vendor/github.com/containers/image/docker/daemon/daemon_dest.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading