mirror of
				https://github.com/containers/podman.git
				synced 2025-11-04 08:56:05 +08:00 
			
		
		
		
	In #20538, I was asked to consider refactoring the new OCI pull code from within the generic machine directory. This is something I had tried when originally coding it but it became apparent that a much larger refactor to prevent circular deps was needed. Because I did not want to pollute the initial PR with that refactor, I asked for the PR to merge first. This is the refactor that needed to be done. Signed-off-by: Brent Baude <bbaude@redhat.com>
		
			
				
	
	
		
			35 lines
		
	
	
		
			429 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			429 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package define
 | 
						|
 | 
						|
type ImageFormat int64
 | 
						|
 | 
						|
const (
 | 
						|
	Qcow ImageFormat = iota
 | 
						|
	Vhdx
 | 
						|
	Tar
 | 
						|
	Raw
 | 
						|
)
 | 
						|
 | 
						|
func (imf ImageFormat) Kind() string {
 | 
						|
	switch imf {
 | 
						|
	case Vhdx:
 | 
						|
		return "vhdx"
 | 
						|
	case Tar:
 | 
						|
		return "tar"
 | 
						|
	case Raw:
 | 
						|
		return "raw"
 | 
						|
	}
 | 
						|
	return "qcow2"
 | 
						|
}
 | 
						|
 | 
						|
func (imf ImageFormat) KindWithCompression() string {
 | 
						|
	switch imf {
 | 
						|
	case Vhdx:
 | 
						|
		return "vhdx.zip"
 | 
						|
	case Tar:
 | 
						|
		return "tar.xz"
 | 
						|
	case Raw:
 | 
						|
		return "raw.gz"
 | 
						|
	}
 | 
						|
	return "qcow2.xz"
 | 
						|
}
 |