Skip to content

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

Merged
ericzzzzzzz merged 2 commits into
GoogleContainerTools:mainfrom
idsulik:fix-issue-8800
Apr 17, 2024
Merged

fix(kaniko): delete kaniko pod on graceful shutdown#9270
ericzzzzzzz merged 2 commits into
GoogleContainerTools:mainfrom
idsulik:fix-issue-8800

Conversation

@idsulik

@idsulik idsulik commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jan 31, 2024

Copy link
Copy Markdown

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

idsulik commented Apr 14, 2024

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@menahyouyeah menahyouyeah mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants