@@ -17,6 +17,7 @@ use futures::{
1717} ;
1818use snafu:: { ResultExt , Snafu } ;
1919use stackable_operator:: {
20+ cli:: CommonOptions ,
2021 k8s_openapi:: api:: core:: v1:: ConfigMap ,
2122 kube:: {
2223 api:: ObjectMeta ,
@@ -25,6 +26,7 @@ use stackable_operator::{
2526 watcher,
2627 } ,
2728 } ,
29+ namespace:: WatchNamespace ,
2830 telemetry:: Tracing ,
2931} ;
3032use tokio:: net:: TcpListener ;
@@ -39,7 +41,11 @@ pub const APP_NAME: &str = "opa-bundle-builder";
3941#[ derive( clap:: Parser ) ]
4042pub struct Args {
4143 #[ clap( flatten) ]
42- common : stackable_operator:: cli:: ProductOperatorRun ,
44+ pub common : CommonOptions ,
45+
46+ /// Provides a specific namespace to watch (instead of watching all namespaces)
47+ #[ arg( long, env, default_value = "" ) ]
48+ pub watch_namespace : WatchNamespace ,
4349}
4450
4551type Bundle = Vec < u8 > ;
@@ -121,7 +127,7 @@ async fn main() -> Result<(), StartupError> {
121127 let reflector = std:: pin:: pin!( reflector:: reflector(
122128 store_w,
123129 watcher(
124- args. common . watch_namespace. get_api:: <ConfigMap >( & client) ,
130+ args. watch_namespace. get_api:: <ConfigMap >( & client) ,
125131 watcher:: Config :: default ( ) . labels( & format!( "{OPERATOR_NAME}/bundle" ) ) ,
126132 ) ,
127133 )
0 commit comments