@@ -24,7 +24,7 @@ type IamMember struct {
24
24
func BootstrapIamMembers (t * testing.T , members []IamMember ) {
25
25
config := BootstrapConfig (t )
26
26
if config == nil {
27
- t .Fatal ("Could not bootstrap a config for BootstrapAllPSARoles ." )
27
+ t .Fatal ("Could not bootstrap a config for BootstrapIamMembers ." )
28
28
}
29
29
client := config .NewResourceManagerClient (config .UserAgent )
30
30
@@ -72,44 +72,3 @@ func BootstrapIamMembers(t *testing.T, members []IamMember) {
72
72
time .Sleep (3 * time .Minute )
73
73
}
74
74
}
75
-
76
- // BootstrapAllPSARoles ensures that the given project's IAM
77
- // policy grants the given service agents the given roles.
78
- // prefix is usually "service-" and indicates the service agent should have the
79
- // given prefix before the project number.
80
- // This is important to bootstrap because using iam policy resources means that
81
- // deleting them removes permissions for concurrent tests.
82
- // Return whether the bindings changed.
83
- func BootstrapAllPSARoles (t * testing.T , prefix string , agentNames , roles []string ) bool {
84
- var members []IamMember
85
- for _ , agentName := range agentNames {
86
- member := fmt .Sprintf ("serviceAccount:%s{project_number}@%s.iam.gserviceaccount.com" , prefix , agentName )
87
- for _ , role := range roles {
88
- members = append (members , IamMember {
89
- Member : member ,
90
- Role : role ,
91
- })
92
- }
93
- }
94
- BootstrapIamMembers (t , members )
95
- // Always return false because we now wait for IAM propagation.
96
- return false
97
- }
98
-
99
- // BootstrapAllPSARole is a version of BootstrapAllPSARoles for granting a
100
- // single role to multiple service agents.
101
- func BootstrapAllPSARole (t * testing.T , prefix string , agentNames []string , role string ) bool {
102
- return BootstrapAllPSARoles (t , prefix , agentNames , []string {role })
103
- }
104
-
105
- // BootstrapPSARoles is a version of BootstrapAllPSARoles for granting roles to
106
- // a single service agent.
107
- func BootstrapPSARoles (t * testing.T , prefix , agentName string , roles []string ) bool {
108
- return BootstrapAllPSARoles (t , prefix , []string {agentName }, roles )
109
- }
110
-
111
- // BootstrapPSARole is a simplified version of BootstrapPSARoles for granting a
112
- // single role to a single service agent.
113
- func BootstrapPSARole (t * testing.T , prefix , agentName , role string ) bool {
114
- return BootstrapPSARoles (t , prefix , agentName , []string {role })
115
- }
0 commit comments