The filename of the image as produced by osbuild for a given export is currently set in each target options type in the `Filename` struct member. However, the value is not really specific to any target type, but to the specific export used for the target. For this reason move the value form target type options to the `Target` struct inside a new struct `OsbuildArtifact` under the name`ExportFilename`. The backward compatibility with older implementations of the composer and workers is kept on the JSON (Un)mashaling level, where the JSON object is always a super-set of the old and new way of providing the export filename in the Target.
29 lines
909 B
Go
29 lines
909 B
Go
package target
|
|
|
|
const TargetNameAzure TargetName = "org.osbuild.azure"
|
|
|
|
type AzureTargetOptions struct {
|
|
StorageAccount string `json:"storageAccount"`
|
|
StorageAccessKey string `json:"storageAccessKey"`
|
|
Container string `json:"container"`
|
|
}
|
|
|
|
func (AzureTargetOptions) isTargetOptions() {}
|
|
|
|
// NewAzureTarget creates org.osbuild.azure target
|
|
//
|
|
// This target uploads a Page Blob to Azure Storage.
|
|
//
|
|
// The target uses Azure Storage keys for authentication, see:
|
|
// https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage
|
|
// The credentials are defined inside the target options.
|
|
//
|
|
// If you need to upload an Azure Image instead, see the
|
|
// org.osbuild.azure.image target.
|
|
func NewAzureTarget(options *AzureTargetOptions) *Target {
|
|
return newTarget(TargetNameAzure, options)
|
|
}
|
|
|
|
func NewAzureTargetResult() *TargetResult {
|
|
return newTargetResult(TargetNameAzure, nil)
|
|
}
|