1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use super::*;
pub trait VolumeMountExt: Sized {
fn new(mount_path: impl ToString, volume: &corev1::Volume) -> Self;
fn read_only(self) -> Self;
}
impl VolumeMountExt for corev1::VolumeMount {
fn new(mount_path: impl ToString, volume: &corev1::Volume) -> Self {
let mount_path = mount_path.to_string();
let name = volume.name.clone();
Self {
mount_path,
name,
..default()
}
}
fn read_only(mut self) -> Self {
self.read_only = Some(true);
self
}
}