Skip to content

Commit

Permalink
fix(qcloud): support env TKE_IDENTITY_TOKEN_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed May 29, 2023
1 parent eb72ab2 commit 71c1d7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tencent/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pub struct Config {
/// `web_identity_token_file` will be loaded from
///
/// - this field if it's `is_some`
/// - env value: [`TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE`] or [`TKE_WEB_IDENTITY_TOKEN_FILE`]
/// - env value: [`TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE`] or [`TKE_WEB_IDENTITY_TOKEN_FILE`] or
/// [`TKE_IDENTITY_TOKEN_FILE`]
pub web_identity_token_file: Option<String>,
}

Expand Down Expand Up @@ -120,6 +121,7 @@ impl Config {
if let Some(v) = envs
.get(TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE)
.or_else(|| envs.get(TKE_WEB_IDENTITY_TOKEN_FILE))
.or_else(|| envs.get(TKE_IDENTITY_TOKEN_FILE))
{
self.web_identity_token_file = Some(v.to_string());
}
Expand Down
1 change: 1 addition & 0 deletions src/tencent/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub const TENCENTCLOUD_PROVIDER_ID: &str = "TENCENTCLOUD_PROVIDER_ID";
pub const TKE_PROVIDER_ID: &str = "TKE_PROVIDER_ID";
pub const TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE: &str = "TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE";
pub const TKE_WEB_IDENTITY_TOKEN_FILE: &str = "TKE_WEB_IDENTITY_TOKEN_FILE";
pub const TKE_IDENTITY_TOKEN_FILE: &str = "TKE_IDENTITY_TOKEN_FILE";

/// AsciiSet for [Tencent UriEncode](https://cloud.tencent.com/document/product/436/7778)
pub static TENCENT_URI_ENCODE_SET: AsciiSet = NON_ALPHANUMERIC
Expand Down

0 comments on commit 71c1d7a

Please sign in to comment.