cri

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cri contains types and extended functionality for the upstream Kubernetes CRI. Currently this is k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2 upstream.

Index

Constants

This section is empty.

Variables

View Source
var MountPropagationNameToValue = map[string]MountPropagation{
	"None":            MountPropagationNone,
	"HostToContainer": MountPropagationHostToContainer,
	"Bidirectional":   MountPropagationBidirectional,
}

MountPropagationNameToValue is a map of valid MountPropogation names to their values

View Source
var MountPropagationValueToName = map[MountPropagation]string{
	MountPropagationNone:            "None",
	MountPropagationHostToContainer: "HostToContainer",
	MountPropagationBidirectional:   "Bidirectional",
}

MountPropagationValueToName is a map of valid MountPropogation values to their string names

Functions

This section is empty.

Types

type Mount

type Mount struct {
	// Path of the mount within the container.
	ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"containerPath,omitempty"`
	// Path of the mount on the host. If the hostPath doesn't exist, then runtimes
	// should report error. If the hostpath is a symbolic link, runtimes should
	// follow the symlink and mount the real destination to container.
	HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"hostPath,omitempty"`
	// If set, the mount is read-only.
	Readonly bool `protobuf:"varint,3,opt,name=readonly,proto3,json=readOnly,proto3" json:"readOnly,omitempty"`
	// If set, the mount needs SELinux relabeling.
	SelinuxRelabel bool `protobuf:"varint,4,opt,name=selinux_relabel,json=selinuxRelabel,proto3" json:"selinuxRelabel,omitempty"`
	// Requested propagation mode.
	Propagation MountPropagation `protobuf:"varint,5,opt,name=propagation,proto3,enum=runtime.v1alpha2.MountPropagation" json:"propagation,omitempty"`
}

Mount specifies a host volume to mount into a container. This is a close copy of the upstream cri Mount type see: k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2 It additionally serializes the "propagation" field with the string enum names on disk as opposed to the int32 values, and the serlialzed field names have been made closer to core/v1 VolumeMount field names In yaml this looks like:

containerPath: /foo
hostPath: /bar
readOnly: true
selinuxRelabel: false
propagation: None

Propagation may be one of: None, HostToContainer, Bidirectional

func (*Mount) MarshalJSON

func (m *Mount) MarshalJSON() ([]byte, error)

MarshalJSON implements custom encoding for JSON and Yaml https://golang.org/pkg/encoding/json/

func (*Mount) UnmarshalJSON

func (m *Mount) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom decoding for JSON and Yaml https://golang.org/pkg/encoding/json/

type MountPropagation

type MountPropagation int32

MountPropagation represents an "enum" for mount propagation options, see also Mount.

const (
	// MountPropagationNone specifies that no mount propagation
	// ("private" in Linux terminology).
	MountPropagationNone MountPropagation = 0
	// MountPropagationHostToContainer specifies that mounts get propagated
	// from the host to the container ("rslave" in Linux).
	MountPropagationHostToContainer MountPropagation = 1
	// MountPropagationBidirectional specifies that mounts get propagated from
	// the host to the container and from the container to the host
	// ("rshared" in Linux).
	MountPropagationBidirectional MountPropagation = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL