File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ lazy_static! {
1818 // `Qm...` optionally follow by `:$shard`
1919 static ref HASH_RE : Regex = Regex :: new( "\\ A(?P<hash>Qm[^:]+)(:(?P<shard>[a-z0-9_]+))?\\ z" ) . unwrap( ) ;
2020 // `sgdNNN`
21- static ref DEPLOYMENT_RE : Regex = Regex :: new( "\\ A(?P<nsp>sgd[0-9]+)\\ z" ) . unwrap( ) ;
21+ static ref DEPLOYMENT_RE : Regex = Regex :: new( "\\ A(?P<nsp>( sgd)? [0-9]+)\\ z" ) . unwrap( ) ;
2222}
2323
2424/// A search for one or multiple deployments to make it possible to search
@@ -58,7 +58,12 @@ impl FromStr for DeploymentSearch {
5858 Ok ( DeploymentSearch :: Hash { hash, shard } )
5959 } else if let Some ( caps) = DEPLOYMENT_RE . captures ( s) {
6060 let namespace = caps. name ( "nsp" ) . unwrap ( ) . as_str ( ) . to_string ( ) ;
61- Ok ( DeploymentSearch :: Deployment { namespace } )
61+ if namespace. starts_with ( "sgd" ) {
62+ Ok ( DeploymentSearch :: Deployment { namespace } )
63+ } else {
64+ let namespace = format ! ( "sgd{namespace}" ) ;
65+ Ok ( DeploymentSearch :: Deployment { namespace } )
66+ }
6267 } else {
6368 Ok ( DeploymentSearch :: Name {
6469 name : s. to_string ( ) ,
You can’t perform that action at this time.
0 commit comments