From 5ed3be9a8c4c60f5c66e0bb324a9f67a53ff6764 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Thu, 1 Jun 2017 14:11:40 -0700 Subject: [PATCH] set azure metadata --- builder/azure/arm/artifact.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/builder/azure/arm/artifact.go b/builder/azure/arm/artifact.go index 64d5a6a42..25672c6f2 100644 --- a/builder/azure/arm/artifact.go +++ b/builder/azure/arm/artifact.go @@ -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 +}