distro: get proper image size from distro
When a user does not define the image size for a compose the default image size of that image type is used. In order to properly store the compose's image size even if the default is used the store calls the distro function GetSizeForOutputType. This function accepts an output format and image size. If the image size is 0 then the default value for the output format will be returned. Also, for vhd images the size must be rounded. This is now handled in the distro function instead of the api.
This commit is contained in:
parent
e30f40873d
commit
abb5469b30
7 changed files with 37 additions and 16 deletions
|
|
@ -42,6 +42,10 @@ func (d *TestDistro) FilenameFromType(outputFormat string) (string, string, erro
|
|||
}
|
||||
}
|
||||
|
||||
func (r *TestDistro) GetSizeForOutputType(outputFormat string, size uint64) uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (d *TestDistro) Pipeline(b *blueprint.Blueprint, additionalRepos []rpmmd.RepoConfig, checksums map[string]string, outputArch, outputFormat string, size uint64) (*pipeline.Pipeline, error) {
|
||||
if outputFormat == "test_output" && outputArch == "test_arch" {
|
||||
return &pipeline.Pipeline{}, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue