Commit 1d6a5b2
Do not reconcile images and builds being deleted
When an image is being deleted, k8s does not delete the object
immediately, instead it sets the deletion timestamp awaiting
finalization. See [k8s
docs](https://github.com/kubernetes/apimachinery/blob/45d29dc4d66fc2ac83e736e79752ad81a9c6195f/pkg/apis/meta/v1/types.go#L190-L209)
for details
If the kpack image (or its builds) has a finalizer being added by an
external component (such as
[Korifi](https://github.com/cloudfoundry/korifi/blob/17557eb68fed830f3f57abd651882a712fc25f5f/kpack-image-builder/controllers/webhooks/finalizer/finalizer_webhook.go#L25)),
then when the client request the object to be deleted, the image/build
reconcilers keep reconciling the image/build causing new build pods to
be created as the image is being deleted. Even though eventually the
image gets deleted, it takes significant amount of time.
Signed-off-by: Danail Branekov <danailster@gmail.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
1 parent 7de12b1 commit 1d6a5b2
File tree
4 files changed
+46
-0
lines changed- pkg/reconciler
- build
- image
4 files changed
+46
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
261 | 278 | | |
262 | 279 | | |
263 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
255 | 276 | | |
256 | 277 | | |
257 | 278 | | |
| |||
0 commit comments