Merge pull request #45 from Crazykev/update-k8s-vendor
Update kubernetes vendor for new CRI change
This commit is contained in:
commit
751f119cbc
10
Godeps/Godeps.json
generated
10
Godeps/Godeps.json
generated
@ -428,14 +428,14 @@
|
||||
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime",
|
||||
"Comment": "v1.7.0-alpha.1-493-g32e927f",
|
||||
"Rev": "32e927f4d86cfe7d3a7ad3c231fc445fb01463f5"
|
||||
"ImportPath": "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1",
|
||||
"Comment": "v1.7.0-alpha.2-1168-g1369a26",
|
||||
"Rev": "1369a263f576270c85974e69b6ad8e7a80a6f494"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kubernetes/pkg/util/interrupt",
|
||||
"Comment": "v1.7.0-alpha.1-493-g32e927f",
|
||||
"Rev": "32e927f4d86cfe7d3a7ad3c231fc445fb01463f5"
|
||||
"Comment": "v1.7.0-alpha.2-1168-g1369a26",
|
||||
"Rev": "1369a263f576270c85974e69b6ad8e7a80a6f494"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata/store"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// The code is very similar with sandbox.go, but there is no template support
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata/store"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
func TestContainerState(t *testing.T) {
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata/store"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// TODO(random-liu): Handle versioning around all marshal/unmarshal.
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata/store"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
func TestSandboxStore(t *testing.T) {
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// Attach prepares a streaming endpoint to attach to a running container, and returns the address.
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
ostesting "github.com/kubernetes-incubator/cri-containerd/pkg/os/testing"
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// ExecSync executes a command in the container, and returns the stdout output.
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
ostesting "github.com/kubernetes-incubator/cri-containerd/pkg/os/testing"
|
||||
|
@ -33,7 +33,7 @@ import (
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
"github.com/containerd/containerd/api/types/mount"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -30,7 +30,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
ostesting "github.com/kubernetes-incubator/cri-containerd/pkg/os/testing"
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
|
@ -32,7 +32,7 @@ import (
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// ListImages lists existing images.
|
||||
|
@ -28,7 +28,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ package server
|
||||
import (
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// RemoveImage removes the image.
|
||||
|
@ -19,7 +19,7 @@ package server
|
||||
import (
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// ImageStatus returns the status of the image, returns nil if the image isn't present.
|
||||
|
30
pkg/server/imagefs_info.go
Normal file
30
pkg/server/imagefs_info.go
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// ImageFsInfo returns information of the filesystem that is used to store images.
|
||||
func (c *criContainerdService) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (*runtime.ImageFsInfoResponse, error) {
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -29,7 +29,7 @@ import (
|
||||
ostesting "github.com/kubernetes-incubator/cri-containerd/pkg/os/testing"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
func TestRemovePodSandbox(t *testing.T) {
|
||||
|
@ -32,7 +32,7 @@ import (
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
"github.com/containerd/containerd/api/types/mount"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
|
@ -33,7 +33,7 @@ import (
|
||||
ostesting "github.com/kubernetes-incubator/cri-containerd/pkg/os/testing"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
func getRunPodSandboxTestData() (*runtime.PodSandboxConfig, func(*testing.T, string, *runtimespec.Spec)) {
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
)
|
||||
@ -72,15 +72,6 @@ func (c *criContainerdService) PodSandboxStatus(ctx context.Context, r *runtime.
|
||||
// toCRISandboxStatus converts sandbox metadata into CRI pod sandbox status.
|
||||
func toCRISandboxStatus(meta *metadata.SandboxMetadata, state runtime.PodSandboxState, ip string) *runtime.PodSandboxStatus {
|
||||
nsOpts := meta.Config.GetLinux().GetSecurityContext().GetNamespaceOptions()
|
||||
netNS := meta.NetNS
|
||||
if state == runtime.PodSandboxState_SANDBOX_NOTREADY {
|
||||
// Return empty network namespace when sandbox is not ready.
|
||||
// For kubenet, when sandbox is not running, both empty
|
||||
// network namespace and a valid permanent network namespace
|
||||
// work. Go with the first option here because it's the current
|
||||
// behavior in Kubernetes.
|
||||
netNS = ""
|
||||
}
|
||||
return &runtime.PodSandboxStatus{
|
||||
Id: meta.ID,
|
||||
Metadata: meta.Config.GetMetadata(),
|
||||
@ -89,9 +80,6 @@ func toCRISandboxStatus(meta *metadata.SandboxMetadata, state runtime.PodSandbox
|
||||
Network: &runtime.PodSandboxNetworkStatus{Ip: ip},
|
||||
Linux: &runtime.LinuxPodSandboxStatus{
|
||||
Namespaces: &runtime.Namespace{
|
||||
// TODO(random-liu): Revendor new CRI version and get
|
||||
// rid of this field.
|
||||
Network: netNS,
|
||||
Options: &runtime.NamespaceOption{
|
||||
HostNetwork: nsOpts.GetHostNetwork(),
|
||||
HostPid: nsOpts.GetHostPid(),
|
||||
|
@ -27,7 +27,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
@ -79,7 +79,6 @@ func getSandboxStatusTestData() (*metadata.SandboxMetadata, *runtime.PodSandboxS
|
||||
Network: &runtime.PodSandboxNetworkStatus{Ip: ""},
|
||||
Linux: &runtime.LinuxPodSandboxStatus{
|
||||
Namespaces: &runtime.Namespace{
|
||||
Network: sandboxStatusTestNetNS,
|
||||
Options: &runtime.NamespaceOption{
|
||||
HostNetwork: true,
|
||||
HostPid: false,
|
||||
@ -94,29 +93,6 @@ func getSandboxStatusTestData() (*metadata.SandboxMetadata, *runtime.PodSandboxS
|
||||
return metadata, expectedStatus
|
||||
}
|
||||
|
||||
func TestToCRISandboxStatus(t *testing.T) {
|
||||
for desc, test := range map[string]struct {
|
||||
state runtime.PodSandboxState
|
||||
expectNetNS string
|
||||
}{
|
||||
"ready sandbox should have network namespace": {
|
||||
state: runtime.PodSandboxState_SANDBOX_READY,
|
||||
expectNetNS: sandboxStatusTestNetNS,
|
||||
},
|
||||
"not ready sandbox should not have network namespace": {
|
||||
state: runtime.PodSandboxState_SANDBOX_NOTREADY,
|
||||
expectNetNS: "",
|
||||
},
|
||||
} {
|
||||
metadata, expect := getSandboxStatusTestData()
|
||||
status := toCRISandboxStatus(metadata, test.state, sandboxStatusTestIP)
|
||||
expect.Linux.Namespaces.Network = test.expectNetNS
|
||||
expect.State = test.state
|
||||
expect.Network.Ip = sandboxStatusTestIP
|
||||
assert.Equal(t, expect, status, desc)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPodSandboxStatus(t *testing.T) {
|
||||
for desc, test := range map[string]struct {
|
||||
sandboxContainers []container.Container
|
||||
@ -238,9 +214,6 @@ func TestPodSandboxStatus(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
require.NotNil(t, res)
|
||||
expect.State = test.expectState
|
||||
if expect.State == runtime.PodSandboxState_SANDBOX_NOTREADY {
|
||||
expect.Linux.Namespaces.Network = ""
|
||||
}
|
||||
assert.Equal(t, expect, res.GetStatus())
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// StopPodSandbox stops the sandbox. If there are any running containers in the
|
||||
|
@ -29,7 +29,7 @@ import (
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/api/types/container"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
|
||||
ostesting "github.com/kubernetes-incubator/cri-containerd/pkg/os/testing"
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/util/interrupt"
|
||||
)
|
||||
|
||||
|
@ -39,7 +39,7 @@ import (
|
||||
osinterface "github.com/kubernetes-incubator/cri-containerd/pkg/os"
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/registrar"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// TODO remove the underscores from the following imports as the services are
|
||||
|
@ -21,6 +21,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
"github.com/docker/docker/pkg/truncindex"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -32,9 +33,7 @@ import (
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/registrar"
|
||||
servertesting "github.com/kubernetes-incubator/cri-containerd/pkg/server/testing"
|
||||
|
||||
"github.com/containerd/containerd/api/services/execution"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
type nopReadWriteCloser struct{}
|
||||
@ -100,7 +99,6 @@ func TestSandboxOperations(t *testing.T) {
|
||||
Network: &runtime.PodSandboxNetworkStatus{},
|
||||
Linux: &runtime.LinuxPodSandboxStatus{
|
||||
Namespaces: &runtime.Namespace{
|
||||
Network: netns,
|
||||
Options: &runtime.NamespaceOption{
|
||||
HostNetwork: false,
|
||||
HostPid: false,
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// Status returns the status of the runtime.
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// UpdateRuntimeConfig updates the runtime config. Currently only handles podCIDR updates.
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1"
|
||||
)
|
||||
|
||||
// Version returns the runtime name, runtime version and runtime API version.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
// To regenerate api.pb.go run hack/update-generated-runtime.sh
|
||||
syntax = 'proto3';
|
||||
|
||||
package runtime;
|
||||
package v1alpha1;
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
@ -36,7 +36,8 @@ service RuntimeService {
|
||||
// This call is idempotent, and must not return an error if the sandbox has
|
||||
// already been removed.
|
||||
rpc RemovePodSandbox(RemovePodSandboxRequest) returns (RemovePodSandboxResponse) {}
|
||||
// PodSandboxStatus returns the status of the PodSandbox.
|
||||
// PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not
|
||||
// present, returns an error.
|
||||
rpc PodSandboxStatus(PodSandboxStatusRequest) returns (PodSandboxStatusResponse) {}
|
||||
// ListPodSandbox returns a list of PodSandboxes.
|
||||
rpc ListPodSandbox(ListPodSandboxRequest) returns (ListPodSandboxResponse) {}
|
||||
@ -57,7 +58,8 @@ service RuntimeService {
|
||||
rpc RemoveContainer(RemoveContainerRequest) returns (RemoveContainerResponse) {}
|
||||
// ListContainers lists all containers by filters.
|
||||
rpc ListContainers(ListContainersRequest) returns (ListContainersResponse) {}
|
||||
// ContainerStatus returns status of the container.
|
||||
// ContainerStatus returns status of the container. If the container is not
|
||||
// present, returns an error.
|
||||
rpc ContainerStatus(ContainerStatusRequest) returns (ContainerStatusResponse) {}
|
||||
|
||||
// ExecSync runs a command in a container synchronously.
|
||||
@ -90,6 +92,8 @@ service ImageService {
|
||||
// This call is idempotent, and must not return an error if the image has
|
||||
// already been removed.
|
||||
rpc RemoveImage(RemoveImageRequest) returns (RemoveImageResponse) {}
|
||||
// ImageFSInfo returns information of the filesystem that is used to store images.
|
||||
rpc ImageFsInfo(ImageFsInfoRequest) returns (ImageFsInfoResponse) {}
|
||||
}
|
||||
|
||||
message VersionRequest {
|
||||
@ -269,17 +273,7 @@ message PodSandboxConfig {
|
||||
// and the CRI). Whenever possible, however, runtime authors SHOULD
|
||||
// consider proposing new typed fields for any new features instead.
|
||||
//
|
||||
// 1. AppArmor
|
||||
//
|
||||
// key: container.apparmor.security.beta.kubernetes.io/<container_name>
|
||||
// description: apparmor profile for a container in this pod.
|
||||
// value:
|
||||
// * runtime/default: equivalent to not specifying a profile.
|
||||
// * localhost/<profile_name>: profile loaded on the node
|
||||
// (localhost) by name. The possible profile names are detailed at
|
||||
// http://wiki.apparmor.net/index.php/AppArmor_Core_Policy_Reference
|
||||
//
|
||||
// 2. Seccomp
|
||||
// 1. Seccomp
|
||||
//
|
||||
// key: security.alpha.kubernetes.io/seccomp/pod
|
||||
// description: the seccomp profile for the containers of an entire pod.
|
||||
@ -296,7 +290,7 @@ message PodSandboxConfig {
|
||||
// local seccomp profile root. Note that profile root is set in
|
||||
// kubelet, and it is not passed in CRI yet, see https://issues.k8s.io/36997.
|
||||
//
|
||||
// 3. Sysctls
|
||||
// 2. Sysctls
|
||||
//
|
||||
// key: security.alpha.kubernetes.io/sysctls
|
||||
// description: list of safe sysctls which are set for the sandbox.
|
||||
@ -348,8 +342,6 @@ message PodSandboxNetworkStatus {
|
||||
|
||||
// Namespace contains paths to the namespaces.
|
||||
message Namespace {
|
||||
// Path to the network namespace.
|
||||
string network = 1;
|
||||
// Namespace options for Linux namespaces.
|
||||
NamespaceOption options = 2;
|
||||
}
|
||||
@ -526,6 +518,12 @@ message LinuxContainerSecurityContext {
|
||||
// List of groups applied to the first process run in the container, in
|
||||
// addition to the container's primary GID.
|
||||
repeated int64 supplemental_groups = 8;
|
||||
// AppArmor profile for the container, candidate values are:
|
||||
// * runtime/default: equivalent to not specifying a profile.
|
||||
// * localhost/<profile_name>: profile loaded on the node
|
||||
// (localhost) by name. The possible profile names are detailed at
|
||||
// http://wiki.apparmor.net/index.php/AppArmor_Core_Policy_Reference
|
||||
string apparmor_profile = 9;
|
||||
}
|
||||
|
||||
// LinuxContainerConfig contains platform-specific configuration for
|
||||
@ -772,6 +770,8 @@ message ContainerStatus {
|
||||
map<string,string> annotations = 13;
|
||||
// Mounts for the container.
|
||||
repeated Mount mounts = 14;
|
||||
// Log path of container.
|
||||
string log_path = 15;
|
||||
}
|
||||
|
||||
message ContainerStatusResponse {
|
||||
@ -970,3 +970,42 @@ message StatusResponse {
|
||||
// Status of the Runtime.
|
||||
RuntimeStatus status = 1;
|
||||
}
|
||||
|
||||
message ImageFsInfoRequest {}
|
||||
|
||||
// UInt64Value is the wrapper of uint64.
|
||||
message UInt64Value {
|
||||
// The value.
|
||||
uint64 value = 1;
|
||||
}
|
||||
|
||||
// FsInfo contains data about filesystem usage.
|
||||
message FsInfo {
|
||||
// The block device name associated with the filesystem.
|
||||
string device = 1;
|
||||
// The root directory for the images.
|
||||
string path = 2;
|
||||
// CapacityBytes represents the total capacity (bytes) of the filesystems
|
||||
// underlying storage.
|
||||
UInt64Value capacity_bytes = 3;
|
||||
// AvailableBytes represents the storage space available (bytes) for the
|
||||
// filesystem.
|
||||
UInt64Value available_bytes = 4;
|
||||
// UsedBytes represents the bytes used for images on the filesystem.
|
||||
// This may differ from the total bytes used on the filesystem and may not
|
||||
// equal CapacityBytes - AvailableBytes.
|
||||
UInt64Value used_bytes = 5;
|
||||
// InodesCapacity represents the total inodes in the filesystem.
|
||||
UInt64Value inodes_capacity = 6;
|
||||
// InodesAvailable represents the free inodes in the filesystem.
|
||||
UInt64Value inodes_available = 7;
|
||||
// InodesUsed represents the inodes used by the images.
|
||||
// This may not equal InodesCapacity - InodesAvailable because the underlying
|
||||
// filesystem may also be used for purposes other than storing images.
|
||||
UInt64Value inodes_used = 8;
|
||||
}
|
||||
|
||||
message ImageFsInfoResponse {
|
||||
// filesystem information of images.
|
||||
FsInfo fs_info = 1;
|
||||
}
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package runtime
|
||||
package v1alpha1
|
||||
|
||||
// This file contains all constants defined in CRI.
|
||||
|
Loading…
Reference in New Issue
Block a user