Skip to content

Commit

Permalink
Add User-Agent with version
Browse files Browse the repository at this point in the history
Signed-off-by: jerome.jutteau <[email protected]>
  • Loading branch information
jerome-jutteau committed Feb 17, 2024
1 parent c5ea52e commit e6892f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::sync::RwLock;

type CloudConfig = outscale_api::apis::configuration::Configuration;

const VERSION: &str = env!("CARGO_PKG_VERSION");
const METADATA_SUBREGION_URL: &str =
"http://169.254.169.254/latest/meta-data/placement/availability-zone";
const METADATA_VMID_URL: &str = "http://169.254.169.254/latest/meta-data/instance-id";
Expand Down Expand Up @@ -84,6 +85,7 @@ pub fn load(path: String) -> Result<Config, Box<dyn Error>> {
region: region()?,
service: "oapi".to_string(),
});
cloud_config.user_agent = Some(format!("bsud/{}", VERSION));
{
*CLOUD_CONFIG.write()? = cloud_config;
}
Expand Down

0 comments on commit e6892f6

Please sign in to comment.