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

fix(kaniko): delete kaniko pod on graceful shutdown #9270

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

idsulik
Copy link
Contributor

@idsulik idsulik commented Jan 21, 2024

Fixes: #8800

Description
Fixed kaniko pod delete in case of graceful shutdown

User facing changes
Before: skaffold doesn't delete kaniko pod if build is interrupted with ctrl-c after creating the pod

After: skaffold triggers deletion of kaniko pod if build is interrupted with ctrl-c after creating the pod

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 63.56%. Comparing base (290280e) to head (8612ece).
Report is 1133 commits behind head on main.

❗ Current head 8612ece differs from pull request most recent head e8c82e0. Consider uploading reports for the commit e8c82e0 to get more accurate results

Files Patch % Lines
pkg/skaffold/build/cluster/kaniko.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9270      +/-   ##
==========================================
- Coverage   70.48%   63.56%   -6.92%     
==========================================
  Files         515      634     +119     
  Lines       23150    32711    +9561     
==========================================
+ Hits        16317    20793    +4476     
- Misses       5776    10316    +4540     
- Partials     1057     1602     +545     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@idsulik
Copy link
Contributor Author

idsulik commented Apr 14, 2024

@ericzzzzzzz hi! Check please the PR, it's very important because all my colleagues have this issue which leads to 100500 undelete kaniko pods.

image

@ericzzzzzzz ericzzzzzzz added the kokoro:run runs the kokoro jobs on a PR label Apr 15, 2024
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 15, 2024
@ericzzzzzzz
Copy link
Contributor

Thanks for the fix! There's something wrong with integration tests, but it doesn't seems related to the change, I'm still investigating, after the issue resolved, I'll merge this change. Sorry for the delay.

defer func() {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, can you add a comment to explains that if build interrupted the original context is cancelled and pod deletion will not be called, so we need a new ctx?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, yea, good idea. Pushed changes

@ericzzzzzzz ericzzzzzzz added the kokoro:force-run forces a kokoro re-run on a PR label Apr 16, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Apr 16, 2024
@ericzzzzzzz ericzzzzzzz added the kokoro:force-run forces a kokoro re-run on a PR label Apr 16, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Apr 16, 2024
@ericzzzzzzz ericzzzzzzz added the kokoro:force-run forces a kokoro re-run on a PR label Apr 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Apr 17, 2024
@ericzzzzzzz ericzzzzzzz merged commit c1bcc31 into GoogleContainerTools:main Apr 17, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants