mirror of https://github.com/grpc/grpc.git
[PSM Interop] Extend clean-up script to 2 other GKE clusters (#28983)
* [PSM Interop] Extend clean-up script to 2 other GKE clusters * Use a safer apprach to invoke the cleanup script * Handle the readonly issue * Make sanity test happypull/28119/head
parent
089bab32c2
commit
0966536dc1
4 changed files with 96 additions and 21 deletions
@ -0,0 +1,38 @@ |
|||||||
|
# Copyright 2022 gRPC authors. |
||||||
|
# |
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||||
|
# you may not use this file except in compliance with the License. |
||||||
|
# You may obtain a copy of the License at |
||||||
|
# |
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0 |
||||||
|
# |
||||||
|
# Unless required by applicable law or agreed to in writing, software |
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
# See the License for the specific language governing permissions and |
||||||
|
# limitations under the License. |
||||||
|
"""Clean up GKE namespaces leaked by the tests.""" |
||||||
|
|
||||||
|
from absl import app |
||||||
|
|
||||||
|
from bin.cleanup import cleanup |
||||||
|
from framework import xds_flags |
||||||
|
from framework import xds_k8s_flags |
||||||
|
|
||||||
|
|
||||||
|
def main(argv): |
||||||
|
if len(argv) > 1: |
||||||
|
raise app.UsageError('Too many command-line arguments.') |
||||||
|
cleanup.load_keep_config() |
||||||
|
|
||||||
|
project: str = xds_flags.PROJECT.value |
||||||
|
network: str = xds_flags.NETWORK.value |
||||||
|
gcp_service_account: str = xds_k8s_flags.GCP_SERVICE_ACCOUNT.value |
||||||
|
dry_run: bool = cleanup.DRY_RUN.value |
||||||
|
|
||||||
|
cleanup.find_and_remove_leaked_k8s_resources(dry_run, project, network, |
||||||
|
gcp_service_account) |
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
app.run(main) |
Loading…
Reference in new issue