Skip to content

Commit bf15a87

Browse files
committed
clean up shared resources
1 parent dcade6f commit bf15a87

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

internal/testutil/acc/shared_resource.go

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,12 @@ func cleanupSharedResources() {
5353
deletePrivateLinkEndpoint(projectID, sharedInfo.privateLinkProviderName, sharedInfo.privateLinkEndpointID)
5454
}
5555
if sharedInfo.encryptionAtRestEnabled {
56-
projectID := sharedInfo.encryptionAtRestProjectID
56+
projectID := sharedInfo.projectID
5757
if projectID == "" {
58-
projectID = sharedInfo.projectID
59-
if projectID == "" {
60-
projectID = projectIDLocal()
61-
}
58+
projectID = projectIDLocal()
6259
}
6360
fmt.Printf("Deleting execution encryption at rest: project id: %s\n", projectID)
6461
deleteEncryptionAtRest(projectID)
65-
66-
// If we created a dedicated project, delete it
67-
if sharedInfo.encryptionAtRestProjectID != "" && sharedInfo.encryptionAtRestProjectID != sharedInfo.projectID {
68-
fmt.Printf("Deleting execution encryption at rest project: %s, id: %s\n", sharedInfo.encryptionAtRestProjectName, sharedInfo.encryptionAtRestProjectID)
69-
deleteProject(sharedInfo.encryptionAtRestProjectID)
70-
}
7162
}
7263
if sharedInfo.projectID != "" {
7364
fmt.Printf("Deleting execution project: %s, id: %s\n", sharedInfo.projectName, sharedInfo.projectID)
@@ -225,19 +216,17 @@ type projectInfo struct {
225216
}
226217

227218
var sharedInfo = struct {
228-
encryptionAtRestProjectName string
229-
projectName string
230-
clusterName string
231-
streamInstanceName string
232-
privateLinkEndpointID string
233-
privateLinkProviderName string
234-
projectID string
235-
encryptionAtRestProjectID string
236-
projects []projectInfo
237-
mu sync.Mutex
238-
muSleep sync.Mutex
239-
encryptionAtRestEnabled bool
240-
init bool
219+
projectName string
220+
clusterName string
221+
streamInstanceName string
222+
privateLinkEndpointID string
223+
privateLinkProviderName string
224+
projectID string
225+
projects []projectInfo
226+
mu sync.Mutex
227+
muSleep sync.Mutex
228+
encryptionAtRestEnabled bool
229+
init bool
241230
}{
242231
projects: []projectInfo{},
243232
}

0 commit comments

Comments
 (0)