kubelet/api: extract RuntimeVersioner interface

pull/6/head
Tamer Tas 2016-08-16 00:35:07 +03:00
parent 89b4598ab7
commit cfc08dea34
1 changed files with 8 additions and 2 deletions

View File

@ -22,11 +22,17 @@ import (
runtimeApi "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime" runtimeApi "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
) )
// RuntimeVersioner contains methods for runtime name, version and API version.
type RuntimeVersioner interface {
// Version returns the runtime name, runtime version and runtime API version
Version(apiVersion string) (*runtimeApi.VersionResponse, error)
}
// RuntimeService interface should be implemented by a container runtime. // RuntimeService interface should be implemented by a container runtime.
// The methods should be thread-safe. // The methods should be thread-safe.
type RuntimeService interface { type RuntimeService interface {
// Version returns the runtime name, runtime version and runtime API version RuntimeVersioner
Version(apiVersion string) (*runtimeApi.VersionResponse, error)
// CreatePodSandbox creates a pod-level sandbox. // CreatePodSandbox creates a pod-level sandbox.
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899 // The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
CreatePodSandbox(config *runtimeApi.PodSandboxConfig) (string, error) CreatePodSandbox(config *runtimeApi.PodSandboxConfig) (string, error)