1
1
use crate :: {
2
+ Configuration , CrdError ,
2
3
arn:: ARN ,
3
4
iam_policy:: { Action , ConditionMap , Conditions , Effect , PolicyDocument , Principal , Statement } ,
4
- Configuration , CrdError ,
5
5
} ;
6
6
use aws_sdk_iam:: { operation:: get_role:: GetRoleError , types:: Role } ;
7
7
use aws_sdk_sts:: error:: SdkError ;
8
8
use aws_types:: SdkConfig ;
9
9
use futures:: { Future , StreamExt } ;
10
10
use json_patch:: diff;
11
11
use kube:: {
12
- api:: { Patch , PatchParams } ,
13
12
Api , Client , CustomResourceExt , Error , ResourceExt ,
13
+ api:: { Patch , PatchParams } ,
14
14
} ;
15
15
use kube_runtime:: {
16
16
controller:: { Action as RAction , Controller } ,
@@ -23,8 +23,8 @@ use log::{error, info, warn};
23
23
use metrics:: { counter, histogram} ;
24
24
use regex:: Regex ;
25
25
use rustrial_k8s_aws_iam_apis:: {
26
- Authorization , Condition , Provider , RoleUsagePolicy , RoleUsagePolicySpec , TrustPolicyStatement ,
27
- API_GROUP ,
26
+ API_GROUP , Authorization , Condition , Provider , RoleUsagePolicy , RoleUsagePolicySpec ,
27
+ TrustPolicyStatement ,
28
28
} ;
29
29
use std:: { collections:: HashMap , convert:: TryFrom , ops:: DerefMut , sync:: Arc , time:: Instant } ;
30
30
use tokio:: time:: Duration ;
@@ -410,7 +410,7 @@ impl TrustPolicyStatementController {
410
410
) ;
411
411
// Bail out and schedule retry on temporary errors during authorization lookup.
412
412
// This will make sure we don't remove existing authorizations on error, which
413
- // would lead to problems as workloads will temporarily not be able to assume
413
+ // would lead to problems as workloads will temporarily not be able to assume
414
414
// the IAM Role until the time based reconciliation would fix it again.
415
415
return Ok ( RAction :: requeue ( Duration :: from_secs ( 5 ) ) ) ;
416
416
}
@@ -450,7 +450,10 @@ impl TrustPolicyStatementController {
450
450
{
451
451
error ! (
452
452
"Error while removing TrustPolicy Statement of {}/{} from IAM Role {}: {}" ,
453
- namespace, tp. name_any( ) , role. arn, e
453
+ namespace,
454
+ tp. name_any( ) ,
455
+ role. arn,
456
+ e
454
457
) ;
455
458
tp. set_status ( Some ( format ! (
456
459
"Failed to remove TrustPolicy Statement from IAM Role: {}" ,
0 commit comments