Skip to content

Commit

Permalink
Fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LFrobeen committed Nov 7, 2022
1 parent fb0678f commit a06b4cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/zstd/zstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var MagicHeader = []byte{'\x28', '\xb5', '\x2f', '\xfd'}

// ReadCloser reads uncompressed input data from the io.ReadCloser and
// returns an io.ReadCloser from which compressed data may be read.
// This uses gzip.BestSpeed for the compression level.
// This uses zstd level 1 for the compression.
func ReadCloser(r io.ReadCloser) io.ReadCloser {
return ReadCloserLevel(r, 1)
}
Expand All @@ -22,7 +22,7 @@ func ReadCloser(r io.ReadCloser) io.ReadCloser {
func ReadCloserLevel(r io.ReadCloser, level int) io.ReadCloser {
pr, pw := io.Pipe()

// For highly compressible layers, gzip.Writer will output a very small
// For highly compressible layers, zstd.Writer will output a very small
// number of bytes per Write(). This is normally fine, but when pushing
// to a registry, we want to ensure that we're taking full advantage of
// the available bandwidth instead of sending tons of tiny writes over
Expand All @@ -45,7 +45,7 @@ func ReadCloserLevel(r io.ReadCloser, level int) io.ReadCloser {
return pw.CloseWithError(err)
}

// Close gzip writer to Flush it and write gzip trailers.
// Close zstd writer to Flush it and write zstd trailers.
if err := gw.Close(); err != nil {
return pw.CloseWithError(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/tarball/layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func TestLayerFromReader(t *testing.T) {
}
}

// LayerCompression settings matter in order for the digest, size,
// Compression settings matter in order for the digest, size,
// compressed assertions to pass
//
// Since our gzip.GzipReadCloser uses gzip.BestSpeed
Expand Down

0 comments on commit a06b4cc

Please sign in to comment.