From 0d3a5a5c298b13bcd8db2322f9464d777f2cbb79 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 5 Nov 2024 14:56:52 -0500 Subject: [PATCH] update tests --- cmd/serverless-init/cloudservice/containerapp.go | 12 ++++++++++-- .../cloudservice/containerapp_test.go | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/serverless-init/cloudservice/containerapp.go b/cmd/serverless-init/cloudservice/containerapp.go index 2091ebf2b3629..99356a4ccf13f 100644 --- a/cmd/serverless-init/cloudservice/containerapp.go +++ b/cmd/serverless-init/cloudservice/containerapp.go @@ -39,6 +39,9 @@ const ( acaReplicaName = "aca.replica.name" acaResourceID = "aca.resource.id" acaResourceGroup = "aca.resource.group" + acaAppName = "aca.app.name" + acaRegion = "aca.app.region" + acaRevision = "aca.app.revision" acaSubscriptionID = "aca.subscription.id" ) @@ -61,9 +64,14 @@ func (c *ContainerApp) GetTags() map[string]string { "region": region, "revision": revision, "replica_name": replica, + // new tags + acaAppName: appName, + acaRegion: region, + acaRevision: revision, acaReplicaName: replica, - "origin": c.GetOrigin(), - "_dd.origin": c.GetOrigin(), + + "origin": c.GetOrigin(), + "_dd.origin": c.GetOrigin(), } if c.SubscriptionId != "" { diff --git a/cmd/serverless-init/cloudservice/containerapp_test.go b/cmd/serverless-init/cloudservice/containerapp_test.go index be5f1b5251586..61c2ecd6c44a7 100644 --- a/cmd/serverless-init/cloudservice/containerapp_test.go +++ b/cmd/serverless-init/cloudservice/containerapp_test.go @@ -34,6 +34,9 @@ func TestGetContainerAppTags(t *testing.T) { "replica_name": "test--6nyz8z7-b845f7667-m7hlv", "_dd.origin": "containerapp", "aca.replica.name": "test--6nyz8z7-b845f7667-m7hlv", + "aca.app.name": "test_app_name", + "aca.app.region": "eastus", + "aca.app.revision": "test_revision", }, tags) } @@ -63,6 +66,9 @@ func TestGetContainerAppTagsWithOptionalEnvVars(t *testing.T) { "subscription_id": "test_subscription_id", "resource_id": "/subscriptions/test_subscription_id/resourcegroups/test_resource_group/providers/microsoft.app/containerapps/test_app_name", "resource_group": "test_resource_group", + "aca.app.name": "test_app_name", + "aca.app.region": "eastus", + "aca.app.revision": "test_revision", "aca.replica.name": "test--6nyz8z7-b845f7667-m7hlv", "aca.resource.id": "/subscriptions/test_subscription_id/resourcegroups/test_resource_group/providers/microsoft.app/containerapps/test_app_name", "aca.resource.group": "test_resource_group",