1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

pub trait SecretReferenceExt {
    fn new(name: impl ToString) -> Self;
    fn namespace(self, namespace: impl ToString) -> Self;
}

impl SecretReferenceExt for corev1::SecretReference {
    fn new(name: impl ToString) -> Self {
        let name = Some(name.to_string());
        Self { name, ..default() }
    }

    fn namespace(self, namespace: impl ToString) -> Self {
        let namespace = Some(namespace.to_string());
        Self { namespace, ..self }
    }
}