diff --git a/control-planes/kubernetes_provider/src/spec_builder/identity.rs b/control-planes/kubernetes_provider/src/spec_builder/identity.rs index 649e8699..97801a48 100644 --- a/control-planes/kubernetes_provider/src/spec_builder/identity.rs +++ b/control-planes/kubernetes_provider/src/spec_builder/identity.rs @@ -16,7 +16,7 @@ use std::collections::BTreeMap; use k8s_openapi::api::core::v1::{EnvVar, ServiceAccount}; use kube::{api::ObjectMeta, ResourceExt}; -use resource_provider_api::models::{ServiceIdentity, ConfigValue}; +use resource_provider_api::models::{ConfigValue, ServiceIdentity}; use crate::models::KubernetesSpec; @@ -94,7 +94,7 @@ pub fn apply_identity(spec: &mut KubernetesSpec, identity: &ServiceIdentity) { ServiceIdentity::AwsIamRole { role_arn } => { env_vars.insert("AWS_ROLE_ARN".to_string(), role_arn.clone()); id_type = "AwsIamRole"; - + let arn = match role_arn { ConfigValue::Inline { value } => value, _ => panic!("role_arn must be an inline value"), @@ -106,17 +106,19 @@ pub fn apply_identity(spec: &mut KubernetesSpec, identity: &ServiceIdentity) { env_vars.insert("AWS_WEB_IDENTITY_TOKEN_FILE".to_string(), token_file); // annotate the label for the service account - service_account.annotations_mut().insert( - "eks.amazonaws.com/role-arn".to_string(), - arn.to_string(), - ); + service_account + .annotations_mut() + .insert("eks.amazonaws.com/role-arn".to_string(), arn.to_string()); } ServiceIdentity::AwsIamAccessKey { access_key_id, secret_access_key, } => { env_vars.insert("AWS_ACCESS_KEY_ID".to_string(), access_key_id.clone()); - env_vars.insert("AWS_SECRET_ACCESS_KEY".to_string(), secret_access_key.clone()); + env_vars.insert( + "AWS_SECRET_ACCESS_KEY".to_string(), + secret_access_key.clone(), + ); id_type = "AwsIamAccessKey"; } diff --git a/control-planes/mgmt_api/src/api/v1/mappings/providers.rs b/control-planes/mgmt_api/src/api/v1/mappings/providers.rs index eac52f2d..3c11a236 100644 --- a/control-planes/mgmt_api/src/api/v1/mappings/providers.rs +++ b/control-planes/mgmt_api/src/api/v1/mappings/providers.rs @@ -102,7 +102,7 @@ impl From for ServiceIdentity { } => ServiceIdentity::AwsIamAccessKey { access_key_id: access_key_id.into(), secret_access_key: secret_access_key.into(), - } + }, } } } @@ -141,7 +141,7 @@ impl From for ServiceIdentityDto { } => ServiceIdentityDto::AwsIamAccessKey { access_key_id: access_key_id.into(), secret_access_key: secret_access_key.into(), - } + }, } } } diff --git a/control-planes/mgmt_api/src/api/v1/models/providers.rs b/control-planes/mgmt_api/src/api/v1/models/providers.rs index e9e14171..d73b7b69 100644 --- a/control-planes/mgmt_api/src/api/v1/models/providers.rs +++ b/control-planes/mgmt_api/src/api/v1/models/providers.rs @@ -85,7 +85,7 @@ pub enum ServiceIdentityDto { access_key_id: ConfigValueDto, #[serde(rename = "secretAccessKey")] secret_access_key: ConfigValueDto, - } + }, } #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/control-planes/mgmt_api/src/domain/models.rs b/control-planes/mgmt_api/src/domain/models.rs index 92608b3c..b511993f 100644 --- a/control-planes/mgmt_api/src/domain/models.rs +++ b/control-planes/mgmt_api/src/domain/models.rs @@ -287,7 +287,7 @@ pub enum ServiceIdentity { access_key_id: ConfigValue, #[serde(rename = "secretAccessKey")] secret_access_key: ConfigValue, - } + }, } #[derive(Serialize, Deserialize, Debug, Clone)]