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

Cleanup droplets on kpack.Build deletion #2284

Merged
merged 3 commits into from
Mar 16, 2023
Merged

Conversation

kieron-dev
Copy link
Contributor

@kieron-dev kieron-dev commented Mar 15, 2023

Is there a related GitHub Issue?

#2229

What is this change about?

Korifi now reconciles kpack.Build resources with the korifi.cloudfoundry.org/build-workload-name label set, i.e. those managed by korifi.

It adds a finalizer that when triggered deletes the associated droplet image, if any, from the container registry.

As an associated refactor, we have used the same registry client library in the buildworkload reconciler to fetch image process details.

Does this PR introduce a breaking change?

No

Acceptance Steps

Push an app. Delete it. See the droplet images are removed from the container registry.

Tag your pair, your PM, and/or team

@gcapizzi

@kieron-dev kieron-dev changed the title Cleanup droplets on kpack.Build deletion Cleanup droplets on kpack.Build deletion Mar 15, 2023
gcapizzi and others added 3 commits March 16, 2023 13:28
As we need to support specifying secrets in different namespaces, we
cannot instantiate the client with the credentials.

Also extend to allow passing secrets via a service account's image pull
secrets (ready for the kpack-image-builder usage).

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
We are about to use its Delete method to clean up droplets, so this
refactor makes the client available and uses the image config inspection
method to grab process details from the droplet.

Issue: #2229
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
This applies only to those Builds managed by korifi identified by having
the korifi.cloudfoundry.org/build-workload-name label.

Issue: #2229
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
@gcapizzi gcapizzi force-pushed the issues/2229-delete-droplets branch from c160220 to 425ed88 Compare March 16, 2023 13:28
@kieron-dev kieron-dev merged commit f025079 into main Mar 16, 2023
@kieron-dev kieron-dev deleted the issues/2229-delete-droplets branch March 16, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants