-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: Prune old resources #251
Conversation
Queries the required data a lot faster, by using kubectl more efficiently (one call vs a call for each kind). Can be possibly improved even further by running in parallel.
Adds a `tk prune` command, that does what it promises. Prune is functionally complete now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(otherwise lgtm, fwiw)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through code (there's a lot of changes!)
In one test environment, set injectLabels
and saw it create labels.
Duplicated a service, and created it. Saw label added.
Removed service from jsonnet. tk apply
said no changes. tk prune
swiftly went through steps, then offered me a diff showing the service that was to be removed.
It then removed it.
Looks good to me.
Implements a mechanism that allows to remove previously created resources that are no longer present in the Jsonnet code, based on internal discussion and tips from @anguslees (thanks!)
Process:
tanka.dev/environment: <env-name>
tk prune
to remove old onesmetadata.uid
of currently present objectsDesign doc: https://docs.google.com/document/d/1R3_dvXRb2d46GJTb3PQT3hfx2q5sy-ixifSGaWwDM8M
Fixes #88
/cc @malcolmholmes @captncraig @mplzik