From a12ca0e9f062b9c4cfacf1599642924201d96cdc Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 22 Feb 2026 16:31:32 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Code=20generation=20for=20issue?= =?UTF-8?q?=20#699b2a82332e9c87dc5d4cea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated by simple-forge workflow Job ID: 4d5fd741-a616-44e0-a529-a4e80571e944 Workflow: https://github.com/simple-container-com/api/actions/runs/22280898664 --- pkg/clouds/pulumi/api/tagging.go | 22 +++++++++++++++---- .../pulumi/kubernetes/simple_container.go | 17 +++++++------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/pkg/clouds/pulumi/api/tagging.go b/pkg/clouds/pulumi/api/tagging.go index 968088ce..6e975835 100644 --- a/pkg/clouds/pulumi/api/tagging.go +++ b/pkg/clouds/pulumi/api/tagging.go @@ -8,6 +8,7 @@ import ( // Tag keys for consistent resource identification across clouds const ( + // AWS tags - can contain dots // StackTag identifies the stack name StackTag = "simple-container.com/stack" @@ -19,6 +20,19 @@ const ( // ClientStackTag identifies the client stack for nested stacks ClientStackTag = "simple-container.com/client-stack" + + // GCP labels - cannot contain dots, using hyphens instead + // GCPStackTag identifies the stack name + GCPStackTag = "simple-container-com/stack" + + // GCPEnvironmentTag identifies the environment (e.g., production, staging) + GCPEnvironmentTag = "simple-container-com/env" + + // GCPParentStackTag identifies the parent stack for nested stacks + GCPParentStackTag = "simple-container-com/parent-stack" + + // GCPClientStackTag identifies the client stack for nested stacks + GCPClientStackTag = "simple-container-com/client-stack" ) // Tags represents a set of tags/labels that can be applied to cloud resources @@ -50,16 +64,16 @@ func (t *Tags) ToAWSTags() sdk.StringMap { // ToGCPLabels converts Tags to GCP label format func (t *Tags) ToGCPLabels() map[string]string { labels := map[string]string{ - StackTag: t.StackName, - EnvironmentTag: t.Environment, + GCPStackTag: t.StackName, + GCPEnvironmentTag: t.Environment, } if t.ParentStack != nil && *t.ParentStack != "" { - labels[ParentStackTag] = *t.ParentStack + labels[GCPParentStackTag] = *t.ParentStack } if t.ClientStack != nil && *t.ClientStack != "" { - labels[ClientStackTag] = *t.ClientStack + labels[GCPClientStackTag] = *t.ClientStack } return labels diff --git a/pkg/clouds/pulumi/kubernetes/simple_container.go b/pkg/clouds/pulumi/kubernetes/simple_container.go index ad2057fc..539d48c3 100644 --- a/pkg/clouds/pulumi/kubernetes/simple_container.go +++ b/pkg/clouds/pulumi/kubernetes/simple_container.go @@ -41,14 +41,15 @@ const ( AnnotationPort = "simple-container.com/port" AnnotationEnv = "simple-container.com/env" - // Standard Kubernetes labels following simple-container.com convention - LabelAppType = "simple-container.com/app-type" - LabelAppName = "simple-container.com/app-name" - LabelScEnv = "simple-container.com/env" - LabelParentEnv = "simple-container.com/parent-env" - LabelParentStack = "simple-container.com/parent-stack" - LabelClientStack = "simple-container.com/client-stack" - LabelCustomStack = "simple-container.com/custom-stack" + // Standard Kubernetes labels - using hyphens instead of dots for GCP compatibility + // Kubernetes allows dots in label prefixes, but GCP labels do not + LabelAppType = "simple-container-com/app-type" + LabelAppName = "simple-container-com/app-name" + LabelScEnv = "simple-container-com/env" + LabelParentEnv = "simple-container-com/parent-env" + LabelParentStack = "simple-container-com/parent-stack" + LabelClientStack = "simple-container-com/client-stack" + LabelCustomStack = "simple-container-com/custom-stack" ) // sanitizeK8sResourceName converts a name to be RFC 1123 compliant for Kubernetes resources