azure: normalize the terms for Azure credentials

The account field is actually a storage account and the secret key is actually
a storage secret key. This is clearer to the user.
This commit is contained in:
Ondřej Budai 2020-04-27 13:59:20 +02:00
parent 3ce3a2ad80
commit 771f9bf849
2 changed files with 14 additions and 14 deletions

View file

@ -1,10 +1,10 @@
package target package target
type AzureTargetOptions struct { type AzureTargetOptions struct {
Filename string `json:"filename"` Filename string `json:"filename"`
Account string `json:"account"` StorageAccount string `json:"storageAccount"`
AccessKey string `json:"accessKey"` StorageAccessKey string `json:"storageAccessKey"`
Container string `json:"container"` Container string `json:"container"`
} }
func (AzureTargetOptions) isTargetOptions() {} func (AzureTargetOptions) isTargetOptions() {}

View file

@ -36,9 +36,9 @@ type awsUploadSettings struct {
func (awsUploadSettings) isUploadSettings() {} func (awsUploadSettings) isUploadSettings() {}
type azureUploadSettings struct { type azureUploadSettings struct {
Account string `json:"account"` StorageAccount string `json:"storageAccount"`
AccessKey string `json:"accessKey"` StorageAccessKey string `json:"storageAccessKey"`
Container string `json:"container"` Container string `json:"container"`
} }
func (azureUploadSettings) isUploadSettings() {} func (azureUploadSettings) isUploadSettings() {}
@ -107,9 +107,9 @@ func targetsToUploadResponses(targets []*target.Target) []uploadResponse {
case *target.AzureTargetOptions: case *target.AzureTargetOptions:
upload.ProviderName = "azure" upload.ProviderName = "azure"
upload.Settings = &azureUploadSettings{ upload.Settings = &azureUploadSettings{
Account: options.Account, StorageAccount: options.StorageAccount,
AccessKey: options.AccessKey, StorageAccessKey: options.StorageAccessKey,
Container: options.Container, Container: options.Container,
} }
uploads = append(uploads, upload) uploads = append(uploads, upload)
} }
@ -140,10 +140,10 @@ func uploadRequestToTarget(u uploadRequest, imageType distro.ImageType) *target.
case *azureUploadSettings: case *azureUploadSettings:
t.Name = "org.osbuild.azure" t.Name = "org.osbuild.azure"
t.Options = &target.AzureTargetOptions{ t.Options = &target.AzureTargetOptions{
Filename: imageType.Filename(), Filename: imageType.Filename(),
Account: options.Account, StorageAccount: options.StorageAccount,
AccessKey: options.AccessKey, StorageAccessKey: options.StorageAccessKey,
Container: options.Container, Container: options.Container,
} }
} }