-
Notifications
You must be signed in to change notification settings - Fork 527
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
create CalculateSize() #719
Conversation
Hey @imjasonh and @jonjohnsonjr ; this is the final follow-up from those other ones, notably #675 and its predecessors. I might start doing some of these progress and other things for the v1layout format as well, once this is in. |
pkg/v1/tarball/write.go
Outdated
// given the input data. Provided by rounding up to nearest whole block (512) | ||
// and adding header 512 | ||
func CalculateTarFileSize(in int64) (out int64) { | ||
func CalculateSingleFileInTarSize(in int64) (out int64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to? Not really, but it is such a nice convenience function that it might be useful.
You kind of wish this were built into core golang archive/tar
package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is useful, but I'd like to avoid exposing anything unless it's really necessary. They might accept a commit to expose some of archive/tar
? https://github.com/golang/go/blob/8f2db14cd35bbd674cb2988a508306de6655e425/src/archive/tar/format.go#L141-L152
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will privatize it and rebase and update. Check soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it. Take another look. It has been a while, I might have made an error on the rebase, so please check carefully. Another pair of eyes is always helpful.
No worries. |
While we are at it, separately, would you take a "download progress updates" on |
This Pull Request is stale because it has been open for 90 days with |
This has been open super long. Can we get it accepted and merged or denied for a reason and closed @imjasonh or @jonjohnsonjr ? Thanks |
/reopen |
/remove-lifecycle stale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through and cleaning up old issues -- I didn't realize we never merged this. If you'd still like to get it merged, it LGTM other than exposing CalculateSingleFileInTarSize
, which feels out of place.
pkg/v1/tarball/write.go
Outdated
// given the input data. Provided by rounding up to nearest whole block (512) | ||
// and adding header 512 | ||
func CalculateTarFileSize(in int64) (out int64) { | ||
func CalculateSingleFileInTarSize(in int64) (out int64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is useful, but I'd like to avoid exposing anything unless it's really necessary. They might accept a commit to expose some of archive/tar
? https://github.com/golang/go/blob/8f2db14cd35bbd674cb2988a508306de6655e425/src/archive/tar/format.go#L141-L152
Signed-off-by: Avi Deitcher <avi@deitcher.net>
Co-authored-by: jonjohnsonjr <jonjohnson@google.com>
Looks like travis doesn't have very many windows machines available :( |
Travis failed but I didn't notice, retried and it works. |
We already pull out the size of the file to use when reporting updates; might as well expose it and simplify our routines.