upload/azure: move UploadImage under a new StorageClient struct
We will soon introduce new methods to the storage client. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
f67ca8b616
commit
478f69e092
4 changed files with 71 additions and 51 deletions
|
|
@ -227,18 +227,20 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
|
|||
if !osbuildOutput.Success {
|
||||
continue
|
||||
}
|
||||
credentials := azure.Credentials{
|
||||
StorageAccount: options.StorageAccount,
|
||||
StorageAccessKey: options.StorageAccessKey,
|
||||
|
||||
azureStorageClient, err := azure.NewStorageClient(options.StorageAccount, options.StorageAccessKey)
|
||||
if err != nil {
|
||||
r = append(r, err)
|
||||
continue
|
||||
}
|
||||
|
||||
metadata := azure.ImageMetadata{
|
||||
ContainerName: options.Container,
|
||||
ImageName: t.ImageName,
|
||||
}
|
||||
|
||||
const azureMaxUploadGoroutines = 4
|
||||
err := azure.UploadImage(
|
||||
credentials,
|
||||
err = azureStorageClient.UploadImage(
|
||||
metadata,
|
||||
path.Join(outputDirectory, options.Filename),
|
||||
azureMaxUploadGoroutines,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue