Skip to content

Commit c231fa1

Browse files
authored
Fix azure PE cleaner (#766)
1 parent 6aa430b commit c231fa1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/actions/cleanup-pe/cleanall.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"log"
7+
"strings"
78
"time"
89

910
"github.com/Azure/azure-sdk-for-go/profiles/latest/network/mgmt/network"
@@ -91,12 +92,11 @@ func cleanAllAzurePE(ctx context.Context, resourceGroupName, azureSubscriptionID
9192
}
9293
var endpointNames []string
9394
for _, endpoint := range peList.Values() {
94-
if endpoint.Subnet.Name != nil {
95-
if *endpoint.Subnet.Name == subnet {
95+
if endpoint.Subnet.ID != nil {
96+
if strings.HasSuffix(*endpoint.Subnet.ID, subnet) {
9697
endpointNames = append(endpointNames, *endpoint.Name)
9798
}
9899
}
99-
100100
}
101101

102102
for _, peName := range endpointNames {

.github/workflows/cleanup-all.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ jobs:
4444
with:
4545
go-version: '1.19'
4646

47-
- name: Run atlas project cleaner
48-
env:
49-
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
50-
MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
51-
CLEAN_ALL: ${{ github.event.inputs.clean }}
52-
MAX_PROJECT_LIFETIME: ${{ github.event.inputs.timelife }}
53-
run: (cd .github/actions/cleanup && go run .)
54-
5547
- name: Run cleanup VPC
5648
if: always() && github.event.inputs.cleanVPC == 'true'
5749
env:
@@ -76,3 +68,11 @@ jobs:
7668
GCP_SA_CRED: ${{ secrets.GCP_SA_CRED }}
7769
CLEAN_TAGGED_PE: ${{ github.event.inputs.cleanTaggedPE || 'false'}}
7870
run: (cd .github/actions/cleanup-pe && go run .)
71+
72+
- name: Run atlas project cleaner
73+
env:
74+
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
75+
MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
76+
CLEAN_ALL: ${{ github.event.inputs.clean }}
77+
MAX_PROJECT_LIFETIME: ${{ github.event.inputs.timelife }}
78+
run: (cd .github/actions/cleanup && go run .)

0 commit comments

Comments
 (0)