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

feat: Add envvar for retrying git operations #15

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

SgtCoDFish
Copy link
Member

@SgtCoDFish SgtCoDFish commented Feb 7, 2025

Based loosely on similar code we recently added to cmrel.

Context: Behind the CyberArk corporate proxy, we often see git failures if many clone / pull operations are performed in rapid succession, which with klone is a common pattern.

This PR adds a simple retry mechanism, aiming to do the simplest possible thing to reduce flakes in our environments. This also uses a static delay between retries rather than any fancier solution.

The variable is called KLONE_GIT_RETRY_ATTEMPTS

@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 7, 2025
go.mod Outdated Show resolved Hide resolved
Behind the CyberArk corporate proxy, we often see git failures if many
clone / pull operations are performed in rapid succession.

This commit adds a simple retry mechanism, aiming to do the simplest
possible thing to reduce flakes in our environments.

Signed-off-by: Ashley Davis <[email protected]>
Copy link
Member

@inteon inteon left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this!

/lgtm
/approve

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2025
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 7, 2025
@cert-manager-prow cert-manager-prow bot merged commit f4c792b into cert-manager:main Feb 7, 2025
4 checks passed
@SgtCoDFish SgtCoDFish deleted the retry_and_delay branch February 7, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants