client, server: new CIDRs must be hostname-compatible
towards the goal of supporting #82pull/92/head
parent
911a2d8f00
commit
b4fb9f9250
|
@ -39,7 +39,7 @@ pub fn add_cidr(cidrs: &[Cidr], request: &AddCidrOpts) -> Result<Option<CidrCont
|
|||
};
|
||||
|
||||
let cidr_request = CidrContents {
|
||||
name,
|
||||
name: name.to_string(),
|
||||
cidr,
|
||||
parent: Some(parent_cidr.id),
|
||||
};
|
||||
|
|
|
@ -322,7 +322,7 @@ pub struct AddPeerOpts {
|
|||
pub struct AddCidrOpts {
|
||||
/// The CIDR name (eg. "engineers")
|
||||
#[structopt(long)]
|
||||
pub name: Option<String>,
|
||||
pub name: Option<Hostname>,
|
||||
|
||||
/// The CIDR network (eg. "10.42.5.0/24")
|
||||
#[structopt(long)]
|
||||
|
@ -581,7 +581,7 @@ impl FromStr for Hostname {
|
|||
if Self::is_valid(name) {
|
||||
Ok(Self(name.to_string()))
|
||||
} else {
|
||||
Err("invalid hostname")
|
||||
Err("invalid hostname string (only alphanumeric with dashes)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue