Skip to content

feat: context copy retry. If we add a for loop and execute the kubectlcli.Run method for copying context to kaniko pod , this makes more reliable and less prune to network failures#7887

Merged
aaron-prindle merged 5 commits into
GoogleContainerTools:mainfrom
santinoncs:feat/retry-when-copy-context
Nov 3, 2022

Conversation

@santinoncs

Copy link
Copy Markdown
Contributor
  • If we add a for loop and execute the kubectlcli.Run method for copying context to kaniko pod , this makes more reliable and less prune to network failures
@conventional-commit-lint-gcf

conventional-commit-lint-gcf Bot commented Sep 25, 2022

Copy link
Copy Markdown

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@santinoncs santinoncs force-pushed the feat/retry-when-copy-context branch from 3168a89 to 9e4b54d Compare September 25, 2022 14:25
…lcli.Run method for copying context to kaniko pod , this makes more reliable and less prune to network failures
@santinoncs santinoncs force-pushed the feat/retry-when-copy-context branch from 9e4b54d to 4b1af8e Compare September 25, 2022 14:26
Comment thread pkg/skaffold/build/cluster/kaniko.go Outdated
if errTar != nil {
errRun = fmt.Errorf("%v\ntar errors: %w", errRun, errTar)
attempts := 0
attemptMax := 3

@aaron-prindle aaron-prindle Oct 3, 2022

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.

nit: can you make this a const and put it at the top of the file? Thanks!

@aaron-prindle

Copy link
Copy Markdown
Contributor

Thanks for the PR @santinoncs, left one nit comment. Once we resolve that we should be able to merge

@pull-request-size pull-request-size Bot added size/M and removed size/S labels Oct 4, 2022
@santinoncs

Copy link
Copy Markdown
Contributor Author

Thanks for the PR @santinoncs, left one nit comment. Once we resolve that we should be able to merge

thanks!
done

@codecov

codecov Bot commented Oct 5, 2022

Copy link
Copy Markdown

Codecov Report

Merging #7887 (18fba71) into main (290280e) will decrease coverage by 3.62%.
The diff coverage is 53.94%.

@@            Coverage Diff             @@
##             main    #7887      +/-   ##
==========================================
- Coverage   70.48%   66.85%   -3.63%     
==========================================
  Files         515      594      +79     
  Lines       23150    28764    +5614     
==========================================
+ Hits        16317    19230    +2913     
- Misses       5776     8123    +2347     
- Partials     1057     1411     +354     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/test.go 44.44% <0.00%> (ø)
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/render.go 35.48% <18.18%> (-5.90%) ⬇️
cmd/skaffold/app/cmd/lsp.go 28.12% <28.12%> (ø)
cmd/skaffold/app/cmd/run.go 64.28% <33.33%> (-9.63%) ⬇️
cmd/skaffold/app/cmd/fix.go 56.41% <37.50%> (-20.07%) ⬇️
cmd/skaffold/app/cmd/verify.go 41.17% <41.17%> (ø)
... and 369 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@santinoncs santinoncs changed the title Feat: retry copy context in order to avoid possible network failures Oct 6, 2022

@tejal29 tejal29 left a comment

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.

This change looks good to me. However can we change the implementation to wire backoff mechanism like elsewhere in the code?

if waitErr := wait.Poll(backoff.Duration, RetryTimeout, func() (bool, error) {

This will ensure, the code waits before the next attempt.

@pull-request-size pull-request-size Bot added size/S and removed size/M labels Oct 8, 2022
@aaron-prindle

Copy link
Copy Markdown
Contributor

Seems there is linter error preventing merge atm:

kg/skaffold/build/cluster/kaniko.go:147: unnecessary trailing newline (whitespace)

	}
FAILED hack/golangci-lint.sh

I think you you remove that newline we can merge 🎊

@santinoncs

Copy link
Copy Markdown
Contributor Author

can we merge? thanks!

@santinoncs

Copy link
Copy Markdown
Contributor Author

Hi @tejal29

is there any reason we cannot merge this? sorry and thank you!

@aaron-prindle

Copy link
Copy Markdown
Contributor

Sorry for the delay @santinoncs, merging this now. Thanks for the fix!

@aaron-prindle aaron-prindle merged commit 1102785 into GoogleContainerTools:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants