Skip to content

Commit

Permalink
fix openstack cleanup (kubernetes-sigs#11299)
Browse files Browse the repository at this point in the history
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
  • Loading branch information
yankay authored Jun 21, 2024
1 parent 921b0c0 commit 647092b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ci-not-authorized:
after_script: []
rules:
# LGTM or ok-to-test labels
- if: $PR_LABELS =~ /.*,(lgtm|ok-to-test).*|^(lgtm|ok-to-test).*/i
- if: $PR_LABELS =~ /.*,(lgtm|approved|ok-to-test).*|^(lgtm|approved|ok-to-test).*/i
variables:
CI_OK_TO_TEST: '0'
when: always
Expand Down
11 changes: 9 additions & 2 deletions scripts/openstack-cleanup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ def main():
conn.compute.servers())

print('Security groups...')
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())
try:
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())
except openstack.exceptions.ConflictException as ex:
# Need to delete port when security groups is in used
map_if_old(conn.network.delete_port,
conn.network.ports())
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())

print('Ports...')
try:
Expand Down

0 comments on commit 647092b

Please sign in to comment.