Recycle Pod Template Check

The kube-controller-manager has two command line arguments (--pv-recycler-pod-template-filepath-hostpath and --pv-recycler-pod-template-filepath-nfs) that specify a recycle pod template. The recycle pod template may not contain the volume that shall be recycled.

A check is added to make sure that the recycle pod template contains at least a volume.
This commit is contained in:
pospispa
2016-11-07 12:02:34 +01:00
parent 89a506a9b5
commit ef43f82de8
3 changed files with 53 additions and 0 deletions

View File

@@ -183,6 +183,9 @@ func AttemptToLoadRecycler(path string, config *volume.VolumeConfig) error {
if err != nil {
return err
}
if err = volume.ValidateRecyclerPodTemplate(recyclerPod); err != nil {
return fmt.Errorf("Pod specification (%v): %v", path, err)
}
config.RecyclerPodTemplate = recyclerPod
}
return nil