From ce9351c82436c1853641d388150be55f7f3abe61 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Tue, 8 Oct 2024 11:13:01 +0200 Subject: [PATCH] CRI: clarify mount host_path docs Mention that the `host_path` can be empty if image volumes are being used. Signed-off-by: Sascha Grunert --- staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go | 6 ++++-- staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go b/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go index a95dd6e3aaf..0c5cf9bf618 100644 --- a/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go +++ b/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go @@ -627,8 +627,10 @@ func (m *PortMapping) GetHostIp() string { type Mount struct { // Path of the mount within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,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 + // Path of the mount on the host. Has to be empty if the image field below + // is provided, because those fields are mutually exclusive. If the image + // field below is nil and the host path doesn't exist, then runtimes should + // report an 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:"host_path,omitempty"` // If set, the mount is read-only. diff --git a/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto b/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto index bc1a1ccc58d..6f8d986ea0d 100644 --- a/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto +++ b/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto @@ -221,8 +221,10 @@ enum MountPropagation { message Mount { // Path of the mount within the container. string container_path = 1; - // 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 + // Path of the mount on the host. Has to be empty if the image field below + // is provided, because those fields are mutually exclusive. If the image + // field below is nil and the host path doesn't exist, then runtimes should + // report an error. If the hostpath is a symbolic link, runtimes should // follow the symlink and mount the real destination to container. string host_path = 2; // If set, the mount is read-only.