Skip to content

add --init-period and --init-timeout flags#980

Open
knQzx wants to merge 2 commits intokubernetes:masterfrom
knQzx:add-init-period-flag
Open

add --init-period and --init-timeout flags#980
knQzx wants to merge 2 commits intokubernetes:masterfrom
knQzx:add-init-period-flag

Conversation

@knQzx
Copy link
Copy Markdown

@knQzx knQzx commented Apr 4, 2026

summary

  • adds --init-period flag - used for retries until the first successful sync, then switches to normal --period
  • adds --init-timeout flag - max time to keep retrying the initial sync before exiting with failure
  • both flags are optional and backward compatible - behavior is unchanged if not set

test plan

  • unit tests for chooseWaitTime() and isInitTimedOut() helper functions
  • verified all existing tests still pass with go test ./...
  • build tested with go build ./...

fixes #959

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 4, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot requested review from sdowell and stp-ip April 4, 2026 22:56
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 4, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @knQzx!

It looks like this is your first PR to kubernetes/git-sync 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/git-sync has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 4, 2026
Copy link
Copy Markdown
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

Thanks. The code looks good, but I'd really like e2e tests to cover these (test_e2e.sh)

dynamic credentials from an external secrets system).
See also $GITSYNC_PASSWORD.

--init-period <duration>, $GITSYNC_INIT_PERIOD
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please keep this section alphabetical -- these should go earlier

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, please add to README

@thockin thockin self-assigned this Apr 5, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: knQzx
Once this PR has been reviewed and has the lgtm label, please ask for approval from thockin. For more information see the Code Review Process.

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

Details 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

@knQzx
Copy link
Copy Markdown
Author

knQzx commented Apr 5, 2026

thanks for the feedback, fixed - moved flags to alphabetical order, added readme docs, and added e2e tests for both init-period and init-timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Different period setting for the initial sync

3 participants