mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
cdce2b7e9a
* Add support for compressed images when pre-loading images Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu> * attempting to fix vendor source being dirty Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu> * fixing file extension for .tar.lz4 Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
30 lines
526 B
Go
30 lines
526 B
Go
//+build go1.10
|
|
|
|
package lz4
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func (h Header) String() string {
|
|
var s strings.Builder
|
|
|
|
s.WriteString(fmt.Sprintf("%T{", h))
|
|
if h.BlockChecksum {
|
|
s.WriteString("BlockChecksum: true ")
|
|
}
|
|
if h.NoChecksum {
|
|
s.WriteString("NoChecksum: true ")
|
|
}
|
|
if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 {
|
|
s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs))
|
|
}
|
|
if l := h.CompressionLevel; l != 0 {
|
|
s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l))
|
|
}
|
|
s.WriteByte('}')
|
|
|
|
return s.String()
|
|
}
|