Skip to content

Commit 28b753d

Browse files
authored
[add] resource group to resource list (#163)
1 parent 55326ff commit 28b753d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

internal/az/group.go

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package az
22

33
import (
4+
"fmt"
5+
46
"github.com/Azure/InnovationEngine/internal/logging"
57
"github.com/Azure/InnovationEngine/internal/patterns"
68
"github.com/Azure/InnovationEngine/internal/shells"
@@ -37,3 +39,7 @@ func FindResourceGroupName(commandOutput string) string {
3739
}
3840
return ""
3941
}
42+
43+
func BuildResourceGroupId(subscription string, resourceGroup string) string {
44+
return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s", subscription, resourceGroup)
45+
}

internal/engine/environments/azure.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func AttachResourceURIsToAzureStatus(
126126
if len(resourceURIs) > 0 {
127127
logging.GlobalLogger.WithField("resourceURIs", resourceURIs).
128128
Info("Found deployed resources.")
129-
status.ResourceURIs = resourceURIs
129+
status.ResourceURIs = append(status.ResourceURIs, resourceURIs...)
130130
} else {
131131
logging.GlobalLogger.Warn("No deployed resources found.")
132132
}

internal/engine/execution.go

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func (e *Engine) ExecuteAndRenderSteps(steps []common.Step, env map[string]strin
216216
if tmpResourceGroup != "" {
217217
logging.GlobalLogger.WithField("resourceGroup", tmpResourceGroup).Info("Found resource group")
218218
resourceGroupName = tmpResourceGroup
219+
azureStatus.AddResourceURI(az.BuildResourceGroupId(e.Configuration.Subscription, resourceGroupName))
219220
}
220221
}
221222

0 commit comments

Comments
 (0)