Skip to content

Conversation

@filmil
Copy link
Contributor

@filmil filmil commented Apr 2, 2019

Adds the flag to allow git-sync to soldier on on first failure. This
is useful if the git-sync lifecycle is managed by a controller that
has its own ways of reporting sync failures.

Fixes #161.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 2, 2019
@k8s-ci-robot k8s-ci-robot requested review from stp-ip and thockin April 2, 2019 01:50
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 2, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: stp-ip

If they are not already assigned, you can assign the PR to them by writing /assign @stp-ip in a comment when ready.

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

Copy link
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.

I thought about this logic the last time I was in here.

What if, instead of a new flag, we just simplified and make this the main-path behavior? I am not sure that being different at first sync is worthwhile. Do you want to take a run at this?

@filmil
Copy link
Contributor Author

filmil commented Apr 2, 2019

What if, instead of a new flag, we just simplified and make this the main-path behavior? I am not sure that being different at first sync is worthwhile. Do you want to take a run at this?

Works for me. I'll make a new PR tomorrow.

I mostly didn't want to touch the code paths since I didn't understand how critical the current behavior is. Obligatory https://xkcd.com/1172

Adds the flag to allow git-sync to soldier on on first failure.  This
is useful if the git-sync lifecycle is managed by a controller that
has its own ways of reporting sync failures.

Fixes kubernetes#161.
@filmil
Copy link
Contributor Author

filmil commented Apr 2, 2019

I thought about this a bit. The benefit of aborting on first sync or after a number of failed retries is that we get a chance to recover from a botched configuration, such as
say a typo in the git repo path. This seems valuable in settings where no controller is managing git-sync. If the user fixes the configuration, the user may then rely on Kubernetes restart mechanism to fix the pod. Updated this PR with a comment to that effect for posterity.

Now, I don't know how much this matters in practice. I'll make another PR which just removes the special code path for the first sync. Feel free to choose either of the approaches.

filmil added a commit to filmil/git-sync that referenced this pull request Apr 2, 2019
Old code used to exit at any error seen on first sync attempt.  This
didn't prove useful in practice, so removing that special case.

This may make git-sync slower to recover after user fixes a
non-retryable error, as now flMaxSyncFailures are needed before the pod
fails.  It may make sense in practice.

Fixes kubernetes#161, in a different way than is proposed in PR kubernetes#162.
@filmil
Copy link
Contributor Author

filmil commented Apr 2, 2019

FYI added #163

@filmil
Copy link
Contributor Author

filmil commented Apr 3, 2019

Since #163 was approved, this is no longer needed. Closing.

@filmil filmil closed this Apr 3, 2019
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants