Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a gangue subcommand to clean up files in GCS #107

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

margamanterola
Copy link
Contributor

Add a gangue subcommand to clean up files in GCS

By adding developer builds, we've started generating a lot of files in GCS that are actually ephemeral. This change adds a new prune subcommand to the gangue command (until now only get existed). This subcommand can be used to delete files under a specific path if they are older that some amount of days.

How to use / Testing done

go build -o bin/gangue github.com/coreos/mantle/cmd/gangue
bin/gangue prune flatcar-jenkins developer/sdk \
    --json-key /path/to/creds/gce-service-account.json --days=15

This will delete all files older than 15 days under the developer/sdk path. I've run this for sdk and for boards and verified that the files deleted were correct.

This change is part of the clean up needed for building PR branches (kinvolk/PROJECT-flatcar-linux#294)

@margamanterola margamanterola requested a review from a team May 25, 2020 12:19
Copy link
Member

@sayanchowdhury sayanchowdhury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Edit: Missed to check the approve button (should be approve instead of comment)

cmd/gangue/prune.go Outdated Show resolved Hide resolved
@margamanterola margamanterola force-pushed the marga-kinvolk/gangue-gc branch from 69499a9 to 020f091 Compare June 3, 2020 13:27
@margamanterola margamanterola merged commit 3ddd95b into flatcar-master Jun 3, 2020
@margamanterola margamanterola deleted the marga-kinvolk/gangue-gc branch June 3, 2020 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants