Skip to content

Commit

Permalink
Fix getting mysql database password
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoDCube committed Jul 8, 2024
1 parent e40caf4 commit ae6dba7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions iam-setup/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,22 @@ async fn create_admin_user(client: Client) -> anyhow::Result<()> {
let database_url = env::var("DATABASE_URL").context("DATABASE_URL is not set")?;

let database_password = {
let secrets = secrets
let secret = secrets
.get_opt(MYSQL_SECRET_NAME)
.await
.context("Failed to query secret")?
.context("No mysql secret")?
.string_data
.data
.unwrap();

secrets
.get(MYSQL_SECRET_KEY)
.context("No mysql password")?
.to_owned()
String::from_utf8(
secret
.get(MYSQL_SECRET_KEY)
.context("No mysql password")?
.0
.clone(),
)
.context("Not utf8 from kube rs")?
};

let database_url = {
Expand Down

0 comments on commit ae6dba7

Please sign in to comment.