mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #23904 from pmorie/kubelet-volumes-comments
Automatic merge from submit-queue Add godoc to kubelet/volumes.go Noticed that `mountExternalVolumes`, of all things, was missing Godoc while working w/ @screeley44. Decided to add some tonight since I have been making noise about grokkability of the kubelet lately. @kubernetes/sig-storage
This commit is contained in:
commit
9c5680bac3
@ -111,6 +111,15 @@ func (vh *volumeHost) GetHostName() string {
|
|||||||
return vh.kubelet.hostname
|
return vh.kubelet.hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mountExternalVolumes mounts the volumes declared in a pod, attaching them
|
||||||
|
// to the host if necessary, and returns a map containing information about
|
||||||
|
// the volumes for the pod or an error. This method is run multiple times,
|
||||||
|
// and requires that implementations of Attach() and SetUp() be idempotent.
|
||||||
|
//
|
||||||
|
// Note, in the future, the attach-detach controller will handle attaching and
|
||||||
|
// detaching volumes; this call site will be maintained for backward-
|
||||||
|
// compatibility with current behavior of static pods and pods created via the
|
||||||
|
// Kubelet's http API.
|
||||||
func (kl *Kubelet) mountExternalVolumes(pod *api.Pod) (kubecontainer.VolumeMap, error) {
|
func (kl *Kubelet) mountExternalVolumes(pod *api.Pod) (kubecontainer.VolumeMap, error) {
|
||||||
podVolumes := make(kubecontainer.VolumeMap)
|
podVolumes := make(kubecontainer.VolumeMap)
|
||||||
for i := range pod.Spec.Volumes {
|
for i := range pod.Spec.Volumes {
|
||||||
@ -178,6 +187,9 @@ func (kl *Kubelet) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume
|
|||||||
return result, true
|
return result, true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// getPodVolumes examines the directory structure for a pod and returns
|
||||||
|
// information about the name and kind of each presently mounted volume, or an
|
||||||
|
// error.
|
||||||
func (kl *Kubelet) getPodVolumes(podUID types.UID) ([]*volumeTuple, error) {
|
func (kl *Kubelet) getPodVolumes(podUID types.UID) ([]*volumeTuple, error) {
|
||||||
var volumes []*volumeTuple
|
var volumes []*volumeTuple
|
||||||
podVolDir := kl.getPodVolumesDir(podUID)
|
podVolDir := kl.getPodVolumesDir(podUID)
|
||||||
|
Loading…
Reference in New Issue
Block a user