Skip to content

Commit

Permalink
Added clean up useful console out
Browse files Browse the repository at this point in the history
  • Loading branch information
yinkeet committed Mar 4, 2019
1 parent 600fbdd commit 4a3b150
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/gke.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def image_pull_secret(self):
data = check_output(['kubectl', 'create', 'secret', 'docker-registry', name, '--docker-server', server, '--docker-username', username, '--docker-password', password, '--docker-email', email, '--dry-run', '-o', 'yaml']).decode('UTF-8')
run(['kubectl', 'apply', '-f', '-'], input=data, encoding='UTF-8', stdout=PIPE)

@WrapPrint('Cleaning up... ', 'done')
def clean_up(self, containers: List[str]):
untagged_images = []
for container in containers:
Expand All @@ -65,6 +64,8 @@ def clean_up(self, containers: List[str]):
for untagged_image in untagged_images:
command = ['gcloud', 'container', 'images', 'delete', '--quiet', untagged_image]
call(command, stdout=PIPE)
else:
print('Nothing to clean')

def auth(self):
variables = load_environment_variables(['GOOGLE_AUTH_KEY_FILE'])
Expand Down

0 comments on commit 4a3b150

Please sign in to comment.