@@ -5,13 +5,13 @@ use std::{
55} ;
66
77use snafu:: Snafu ;
8- use stackable_operator:: {
8+ use strum:: { EnumDiscriminants , IntoStaticStr } ;
9+
10+ use crate :: {
911 builder:: pod:: container:: { ContainerBuilder , FieldPathEnvVar } ,
1012 k8s_openapi:: api:: core:: v1:: { ConfigMapKeySelector , EnvVar , EnvVarSource , ObjectFieldSelector } ,
13+ v2:: types:: kubernetes:: { ConfigMapKey , ConfigMapName , ContainerName } ,
1114} ;
12- use strum:: { EnumDiscriminants , IntoStaticStr } ;
13-
14- use crate :: framework:: types:: kubernetes:: { ConfigMapKey , ConfigMapName , ContainerName } ;
1515
1616#[ derive( Snafu , Debug , EnumDiscriminants ) ]
1717#[ strum_discriminants( derive( IntoStaticStr ) ) ]
@@ -38,7 +38,7 @@ impl EnvVarName {
3838 ///
3939 /// Use this only with constant names that are also tested in unit tests!
4040 pub fn from_str_unsafe ( s : & str ) -> Self {
41- EnvVarName :: from_str ( s) . expect ( "should be a valid environment variable name" )
41+ Self :: from_str ( s) . expect ( "should be a valid environment variable name" )
4242 }
4343}
4444
@@ -84,7 +84,7 @@ impl EnvVarSet {
8484 /// Moves all [`EnvVar`]s from the given set into this one.
8585 ///
8686 /// [`EnvVar`]s with the same name are overridden.
87- pub fn merge ( mut self , mut env_var_set : EnvVarSet ) -> Self {
87+ pub fn merge ( mut self , mut env_var_set : Self ) -> Self {
8888 self . 0 . append ( & mut env_var_set. 0 ) ;
8989
9090 self
@@ -124,7 +124,7 @@ impl EnvVarSet {
124124 /// Adds an environment variable with the given name and field path to this set
125125 ///
126126 /// An [`EnvVar`] with the same name is overridden.
127- pub fn with_field_path ( mut self , name : & EnvVarName , field_path : FieldPathEnvVar ) -> Self {
127+ pub fn with_field_path ( mut self , name : & EnvVarName , field_path : & FieldPathEnvVar ) -> Self {
128128 self . 0 . insert (
129129 name. clone ( ) ,
130130 EnvVar {
@@ -191,17 +191,16 @@ impl IntoIterator for EnvVarSet {
191191mod tests {
192192 use std:: str:: FromStr ;
193193
194- use stackable_operator:: {
194+ use super :: { EnvVarName , EnvVarSet } ;
195+ use crate :: {
195196 builder:: pod:: container:: FieldPathEnvVar ,
196197 k8s_openapi:: api:: core:: v1:: {
197198 ConfigMapKeySelector , EnvVar , EnvVarSource , ObjectFieldSelector ,
198199 } ,
199- } ;
200-
201- use super :: { EnvVarName , EnvVarSet } ;
202- use crate :: framework:: {
203- builder:: pod:: container:: new_container_builder,
204- types:: kubernetes:: { ConfigMapKey , ConfigMapName , ContainerName } ,
200+ v2:: {
201+ builder:: pod:: container:: new_container_builder,
202+ types:: kubernetes:: { ConfigMapKey , ConfigMapName , ContainerName } ,
203+ } ,
205204 } ;
206205
207206 #[ test]
@@ -253,7 +252,7 @@ mod tests {
253252 & EnvVarName :: from_str_unsafe ( "ENV2" ) ,
254253 "value2 from env_var_set2" ,
255254 )
256- . with_field_path ( & EnvVarName :: from_str_unsafe ( "ENV3" ) , FieldPathEnvVar :: Name )
255+ . with_field_path ( & EnvVarName :: from_str_unsafe ( "ENV3" ) , & FieldPathEnvVar :: Name )
257256 . with_value (
258257 & EnvVarName :: from_str_unsafe ( "ENV4" ) ,
259258 "value4 from env_var_set2" ,
@@ -335,7 +334,7 @@ mod tests {
335334 #[ test]
336335 fn test_envvarset_with_field_path ( ) {
337336 let env_var_set = EnvVarSet :: new ( )
338- . with_field_path ( & EnvVarName :: from_str_unsafe ( "ENV" ) , FieldPathEnvVar :: Name ) ;
337+ . with_field_path ( & EnvVarName :: from_str_unsafe ( "ENV" ) , & FieldPathEnvVar :: Name ) ;
339338
340339 assert_eq ! (
341340 Some ( & EnvVar {
0 commit comments