Skip to content

Commit ac3198b

Browse files
committed
rename actual roles
Signed-off-by: Katyanna Moura <[email protected]>
1 parent ab48cb4 commit ac3198b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

cluster/cluster.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Resources:
273273
AddonName: eks-pod-identity-agent
274274
ClusterName: !Ref EKSCluster
275275
{{ if eq .Cluster.Environment "e2e" }}
276-
E2EEKSIAMTestRoleUnprivileged:
276+
E2EEKSIAMTestRoleReadOnly:
277277
Properties:
278278
AssumeRolePolicyDocument:
279279
Statement:
@@ -285,26 +285,26 @@ Resources:
285285
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
286286
Version: 2012-10-17
287287
Path: /
288-
RoleName: "{{.Cluster.LocalID}}-e2e-eks-iam-test-unprivileged-role"
288+
RoleName: "{{.Cluster.LocalID}/-e2e-eks-iam-test-read-only-role"
289289
Type: 'AWS::IAM::Role'
290-
E2EEKSIAMTestAccessEntryUnprivileged:
290+
E2EEKSIAMTestAccessEntryReadOnly:
291291
Type: "AWS::EKS::AccessEntry"
292292
Properties:
293293
AccessPolicies:
294294
- AccessScope:
295295
Type: "cluster"
296296
PolicyArn: "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy"
297297
ClusterName: !Ref EKSCluster
298-
PrincipalArn: !GetAtt E2EEKSIAMTestRoleUnprivileged.Arn
298+
PrincipalArn: !GetAtt E2EEKSIAMTestRoleReadOnly.Arn
299299
Username: !Join
300300
- ''
301301
- - !Sub 'arn:aws:sts::${AWS::AccountId}:assumed-role/'
302-
- !Ref E2EEKSIAMTestRoleUnprivileged
302+
- !Ref E2EEKSIAMTestRoleReadOnly
303303
- '/{{`{{SessionName}}`}}'
304304
KubernetesGroups:
305305
- zalando:readonly
306306
Type: "STANDARD"
307-
E2EEKSIAMTestRolePrivileged:
307+
E2EEKSIAMTestRoleAdministrator:
308308
Properties:
309309
AssumeRolePolicyDocument:
310310
Statement:
@@ -316,21 +316,21 @@ Resources:
316316
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
317317
Version: 2012-10-17
318318
Path: /
319-
RoleName: "{{.Cluster.LocalID}}-e2e-eks-iam-test-privileged-role"
319+
RoleName: "{{.Cluster.LocalID}}-e2e-eks-iam-test-administrator-role"
320320
Type: 'AWS::IAM::Role'
321-
E2EEKSIAMTestAccessEntryPrivileged:
321+
E2EEKSIAMTestAccessEntryAdministrator:
322322
Type: "AWS::EKS::AccessEntry"
323323
Properties:
324324
AccessPolicies:
325325
- AccessScope:
326326
Type: "cluster"
327327
PolicyArn: "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy"
328328
ClusterName: !Ref EKSCluster
329-
PrincipalArn: !GetAtt E2EEKSIAMTestRolePrivileged.Arn
329+
PrincipalArn: !GetAtt E2EEKSIAMTestRoleAdministrator.Arn
330330
Username: !Join
331331
- ''
332332
- - !Sub 'arn:aws:sts::${AWS::AccountId}:assumed-role/'
333-
- !Ref E2EEKSIAMTestRolePrivileged
333+
- !Ref E2EEKSIAMTestRoleAdministrator
334334
- '/{{`{{SessionName}}`}}'
335335
KubernetesGroups:
336336
- zalando:administrator

test/e2e/authorization.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ var _ = g.Describe("Authorization via admission-controller [RBAC] [Zalando]", fu
964964

965965
// getAdminClient returns a client with the `zalando:administrator` group.
966966
func getAdminClient(cluster *types.Cluster, awsAccountID string) (*kubernetes.Clientset, error) {
967-
return newClientWithRole(cluster, fmt.Sprintf("arn:aws:iam::%s:role/%s-e2e-eks-iam-test-privileged-role", awsAccountID, aws.ToString(cluster.Name)))
967+
return newClientWithRole(cluster, fmt.Sprintf("arn:aws:iam::%s:role/%s-e2e-eks-iam-test-administrator-role", awsAccountID, aws.ToString(cluster.Name)))
968968
}
969969

970970
// getCollaboratorClient returns a client with the `zalando:collaborator` group.
@@ -979,7 +979,7 @@ func getEngineerClient(cluster *types.Cluster, awsAccountID string) (*kubernetes
979979

980980
// getReadOnlyClient returns a client with the `zalando:readonly` group.
981981
func getReadOnlyClient(cluster *types.Cluster, awsAccountID string) (*kubernetes.Clientset, error) {
982-
return newClientWithRole(cluster, fmt.Sprintf("arn:aws:iam::%s:role/%s-e2e-eks-iam-test-unprivileged-role", awsAccountID, aws.ToString(cluster.Name)))
982+
return newClientWithRole(cluster, fmt.Sprintf("arn:aws:iam::%s:role/%s-e2e-eks-iam-test-read-only-role", awsAccountID, aws.ToString(cluster.Name)))
983983
}
984984

985985
// getPostgresAdministratorClient returns a client with the `zalando:postgres-admin` group.

0 commit comments

Comments
 (0)