Merge pull request #4953 from hashicorp/azure-artifact

builder/azure: set artifact metadata
This commit is contained in:
Matthew Hooker 2017-06-05 11:44:36 -07:00 committed by GitHub
commit 39a2b9c50e
1 changed files with 18 additions and 2 deletions

View File

@ -90,8 +90,13 @@ func (*Artifact) Id() string {
return ""
}
func (*Artifact) State(name string) interface{} {
return nil
func (a *Artifact) State(name string) interface{} {
switch name {
case "atlas.artifact.metadata":
return a.stateAtlasMetadata()
default:
return nil
}
}
func (a *Artifact) String() string {
@ -110,3 +115,14 @@ func (a *Artifact) String() string {
func (*Artifact) Destroy() error {
return nil
}
func (a *Artifact) stateAtlasMetadata() interface{} {
metadata := make(map[string]string)
metadata["StorageAccountLocation"] = a.StorageAccountLocation
metadata["OSDiskUri"] = a.OSDiskUri
metadata["OSDiskUriReadOnlySas"] = a.OSDiskUriReadOnlySas
metadata["TemplateUri"] = a.TemplateUri
metadata["TemplateUriReadOnlySas"] = a.TemplateUriReadOnlySas
return metadata
}