Skip to content

Commit

Permalink
fixes integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TiberiuGC committed Aug 6, 2024
1 parent 447c4bb commit 2dcd12c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/runtime/adoption_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,14 @@ func (r *adoptionReconciler) getEndpointURL(
return r.cfg.EndpointURL
}

// getRoleARN return the Role ARN that should be assumed for account ID
// getOwnerAccountRoleARN return the Role ARN that should be assumed for account ID
// in order to manage the resources.
func (r *adoptionReconciler) getOwnerAccountRoleARN(
acctID ackv1alpha1.AWSAccountID,
) (ackv1alpha1.AWSResourceName, error) {
globalAccountID := ackrtcache.OwnerAccountIDPrefix + string(acctID)
// v2
if r.cfg.FeatureGates.IsEnabled(featuregate.FeatureCARMv2) {
globalAccountID := ackrtcache.OwnerAccountIDPrefix + string(acctID)
// use service level roleARN if present
serviceAccountID := r.sc.GetMetadata().ServiceAlias + "." + globalAccountID
if roleARN, err := r.cache.CARMMaps.GetValue(serviceAccountID); err == nil {
Expand All @@ -538,7 +538,7 @@ func (r *adoptionReconciler) getOwnerAccountRoleARN(
return ackv1alpha1.AWSResourceName(roleARN), nil
}
// v1
roleARN, err := r.cache.Accounts.GetValue(globalAccountID)
roleARN, err := r.cache.Accounts.GetValue(string(acctID))
if err != nil {
return "", fmt.Errorf("retrieving role ARN for accountID %q from %q configMap: %v", acctID, ackrtcache.ACKRoleAccountMap, err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/runtime/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1140,9 +1140,9 @@ func (r *resourceReconciler) getTeamID(
func (r *resourceReconciler) getOwnerAccountRoleARN(
acctID ackv1alpha1.AWSAccountID,
) (ackv1alpha1.AWSResourceName, error) {
globalAccountID := ackrtcache.OwnerAccountIDPrefix + string(acctID)
// v2
if r.cfg.FeatureGates.IsEnabled(featuregate.FeatureCARMv2) {
globalAccountID := ackrtcache.OwnerAccountIDPrefix + string(acctID)
// use service level roleARN if present
serviceAccountID := r.sc.GetMetadata().ServiceAlias + "." + globalAccountID
if roleARN, err := r.cache.CARMMaps.GetValue(serviceAccountID); err == nil {
Expand All @@ -1156,7 +1156,7 @@ func (r *resourceReconciler) getOwnerAccountRoleARN(
return ackv1alpha1.AWSResourceName(roleARN), nil
}
// v1
roleARN, err := r.cache.Accounts.GetValue(globalAccountID)
roleARN, err := r.cache.Accounts.GetValue(string(acctID))
if err != nil {
return "", fmt.Errorf("retrieving role ARN for accountID %q from %q configMap: %v", acctID, ackrtcache.ACKRoleAccountMap, err)
}
Expand Down

0 comments on commit 2dcd12c

Please sign in to comment.