-
Notifications
You must be signed in to change notification settings - Fork 699
Add retry_count to container_push #2101
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
Open
itmecho
wants to merge
10
commits into
bazelbuild:master
Choose a base branch
from
itmecho:retry-push-count
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dc9b470
Add retry-count to container_push
itmecho 43f6d3f
Run push-all through buildifier
itmecho ddd6949
Regenerate docs
itmecho 5a1f982
Add missing retry flag during push all
itmecho 5e5bec0
Update retry log to be more useful
itmecho 4e54051
Validate -retry-count is not negative
itmecho 4c2fffe
Merge remote-tracking branch 'upstream/master' into retry-push-count
itmecho f63e72a
Validate that retry_count is a positive int
itmecho 776c2d2
Update docs again
itmecho 8ab320d
Merge branch 'bazelbuild:master' into retry-push-count
itmecho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,12 @@ def _impl(ctx): | |
tag = tag, | ||
)) | ||
|
||
if ctx.attr.retry_count < 0: | ||
fail("retry_count must be a positive integer") | ||
|
||
if ctx.attr.retry_count > 0: | ||
pusher_args.append("-retry-count={}".format(ctx.attr.retry_count)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe there should be some validation here? Might be confusing if a user provides -1 and nothing happens. I think we can merge given this change. |
||
|
||
if ctx.attr.skip_unchanged_digest: | ||
pusher_args.append("-skip-unchanged-digest") | ||
if ctx.attr.insecure_repository: | ||
|
@@ -174,6 +180,9 @@ container_push_ = rule( | |
allow_single_file = True, | ||
doc = "The label of the file with repository value. Overrides 'repository'.", | ||
), | ||
"retry_count": attr.int( | ||
doc = "Number of times to retry pushing the image. Only positive numbers are valid.", | ||
), | ||
"skip_unchanged_digest": attr.bool( | ||
default = False, | ||
doc = "Check if the container registry already contain the image's digest. If yes, skip the push for that image. " + | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.