mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-09 01:14:20 +01:00
utils: update container type handling
Today we assume that if the CRI/upper layer doesn't provide a container type annotation, it should be treated as a sandbox. Up to this point, a sandbox with a pause container in CRI context and a single container (ala ctr run) are treated the same. For VM sizing and container constraining, it'll be useful to know if this is a sandbox or if this is a single container. In updating this, we cleanup the type handling tests and we update the containerd annotations vendoring. Fixes: #2926 Signed-off-by: Eric Ernst <eric_ernst@apple.com>
This commit is contained in:
62
src/runtime/vendor/github.com/containerd/containerd/pkg/cri/annotations/annotations.go
generated
vendored
Normal file
62
src/runtime/vendor/github.com/containerd/containerd/pkg/cri/annotations/annotations.go
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
Copyright The containerd 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 annotations
|
||||
|
||||
// ContainerType values
|
||||
// Following OCI annotations are used by katacontainers now.
|
||||
// We'll switch to standard secure pod API after it is defined in CRI.
|
||||
const (
|
||||
// ContainerTypeSandbox represents a pod sandbox container
|
||||
ContainerTypeSandbox = "sandbox"
|
||||
|
||||
// ContainerTypeContainer represents a container running within a pod
|
||||
ContainerTypeContainer = "container"
|
||||
|
||||
// ContainerType is the container type (sandbox or container) annotation
|
||||
ContainerType = "io.kubernetes.cri.container-type"
|
||||
|
||||
// SandboxID is the sandbox ID annotation
|
||||
SandboxID = "io.kubernetes.cri.sandbox-id"
|
||||
|
||||
// SandboxLogDir is the pod log directory annotation.
|
||||
// If the sandbox needs to generate any log, it will put it into this directory.
|
||||
// Kubelet will be responsible for:
|
||||
// 1) Monitoring the disk usage of the log, and including it as part of the pod
|
||||
// ephemeral storage usage.
|
||||
// 2) Cleaning up the logs when the pod is deleted.
|
||||
// NOTE: Kubelet is not responsible for rotating the logs.
|
||||
SandboxLogDir = "io.kubernetes.cri.sandbox-log-directory"
|
||||
|
||||
// UntrustedWorkload is the sandbox annotation for untrusted workload. Untrusted
|
||||
// workload can only run on dedicated runtime for untrusted workload.
|
||||
UntrustedWorkload = "io.kubernetes.cri.untrusted-workload"
|
||||
|
||||
// SandboxNamespace is the name of the namespace of the sandbox (pod)
|
||||
SandboxNamespace = "io.kubernetes.cri.sandbox-namespace"
|
||||
|
||||
// SandboxName is the name of the sandbox (pod)
|
||||
SandboxName = "io.kubernetes.cri.sandbox-name"
|
||||
|
||||
// ContainerName is the name of the container in the pod
|
||||
ContainerName = "io.kubernetes.cri.container-name"
|
||||
|
||||
// ImageName is the name of the image used to create the container
|
||||
ImageName = "io.kubernetes.cri.image-name"
|
||||
|
||||
// PodAnnotations are the annotations of the pod
|
||||
PodAnnotations = "io.kubernetes.cri.pod-annotations"
|
||||
)
|
||||
38
src/runtime/vendor/github.com/containerd/cri-containerd/pkg/annotations/annotations.go
generated
vendored
38
src/runtime/vendor/github.com/containerd/cri-containerd/pkg/annotations/annotations.go
generated
vendored
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 The Containerd 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 annotations
|
||||
|
||||
// ContainerType values
|
||||
// Following OCI annotations are used by katacontainers now.
|
||||
// We'll switch to standard secure pod API after it is defined in CRI.
|
||||
const (
|
||||
// ContainerTypeSandbox represents a pod sandbox container
|
||||
ContainerTypeSandbox = "sandbox"
|
||||
|
||||
// ContainerTypeContainer represents a container running within a pod
|
||||
ContainerTypeContainer = "container"
|
||||
|
||||
// ContainerType is the container type (sandbox or container) annotation
|
||||
ContainerType = "io.kubernetes.cri.container-type"
|
||||
|
||||
// SandboxID is the sandbox ID annotation
|
||||
SandboxID = "io.kubernetes.cri.sandbox-id"
|
||||
|
||||
// UntrustedWorkload is the sandbox annotation for untrusted workload. Untrusted
|
||||
// workload can only run on dedicated runtime for untrusted workload.
|
||||
UntrustedWorkload = "io.kubernetes.cri.untrusted-workload"
|
||||
)
|
||||
Reference in New Issue
Block a user