File tree Expand file tree Collapse file tree
crates/stackable-operator/src/v2/macros Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99///
1010/// use stackable_operator::constant;
1111/// use stackable_operator::v2::types::kubernetes::VolumeName;
12+ /// use stackable_operator::v2::builder::pod::container::EnvVarName;
13+ ///
1214/// constant!(DATA_VOLUME_NAME: VolumeName = "data");
1315/// constant!(pub CONFIG_VOLUME_NAME: VolumeName = "config");
16+ ///
17+ /// const CONFIG_OPTION_SECURITY_ENABLED: &str = "SECURITY_ENABLED";
18+ /// constant!(ENV_VAR_NAME_SECURITY_ENABLED: EnvVarName = CONFIG_OPTION_SECURITY_ENABLED);
1419/// ```
1520#[ macro_export( local_inner_macros) ]
1621macro_rules! constant {
17- ( $qualifier: vis $name: ident: $type: ident = $value: literal ) => {
22+ ( $qualifier: vis $name: ident: $type: ident = $value: expr ) => {
1823 $qualifier static $name: std:: sync:: LazyLock <$type> =
1924 std:: sync:: LazyLock :: new( || $type:: from_str( $value) . expect( "should be a valid $name" ) ) ;
2025 } ;
You can’t perform that action at this time.
0 commit comments