Skip to content

🤖 Fix for issue #164: kubernetes labels are incorrect#165

Merged
smecsia merged 1 commit intomainfrom
simple-forge/issue-164-kubernetes-labels-are-incorrec-tavblu
Feb 22, 2026
Merged

🤖 Fix for issue #164: kubernetes labels are incorrect#165
smecsia merged 1 commit intomainfrom
simple-forge/issue-164-kubernetes-labels-are-incorrec-tavblu

Conversation

@simple-container-forge
Copy link
Contributor

Summary

This pull request addresses issue #164.

Changes Made

📝 Execution Summary:
I've processed the issue and made the following changes:

I'll analyze the issue based on the conversation history and make the necessary file modifications. The issue is about incorrect Kubernetes labels that contain dots (.) which are invalid for GCP labels.

Let me start by reading the relevant files to understand the current state:

Now I understand the issue. The problem is that GCP labels cannot contain dots (.) in the key name, but the current code uses simple-container.com/ as a prefix in both the Kubernetes labels and GCP labels. The error message confirms this:

key "simple-container.com/env" contains invalid character '.' at index 15

I need to fix this by:

  1. Creating GCP-specific label constants with hyphens instead of dots
  2. Updating the Kubernetes label constants to use hyphens instead of dots

Let me make the necessary modifications:

Now let me verify the changes by reading the modified files:

The changes have been applied. Let me verify that all tests pass:

All tests pass. Let me verify the changes are complete by checking the git diff:

The changes have been applied. Let me also build the project to ensure it compiles:

The build succeeded. The changes I made are:

Summary of Changes

I've successfully fixed issue #164 - "kubernetes labels are incorrect". The problem was that GCP labels and Kubernetes labels were using simple-container.com/ as a prefix, which contains a dot (.) that is invalid for GCP labels.

Root Cause

The error message from the issue clearly states:

googleapi: Error 400: invalid repository labels (&map[goog-pulumi-provisioned:true simple-container.com/env:likeclaw-us simple-container.com/stack:root]): key "simple-container.com/env" contains invalid character '.' at index 15

GCP labels only allow lowercase letters, numbers, hyphens, and underscores in the key name. Dots are not allowed.

Files Modified

  1. pkg/clouds/pulumi/api/tagging.go:
  • Added new GCP-specific label constants with hyphens instead of dots:
  • GCPStackTag = "simple-container-com/stack"
  • GCPEnvironmentTag = "simple-container-com/env"
  • GCPParentStackTag = "simple-container-com/parent-stack"
  • GCPClientStackTag = "simple-container-com/client-stack"
  • Updated ToGCPLabels() method to use the new GCP label constants
  • Kept the original AWS tag constants unchanged since AWS allows dots
  1. pkg/clouds/pulumi/kubernetes/simple_container.go:
  • Updated all Kubernetes label constants to use hyphens instead of dots:
  • 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"
  • Left annotation constants unchanged since Kubernetes annotations allow dots

Why This Works

  • GCP labels require keys to match regex: [a-z]([a-z0-9-]{0,61}[a-z0-9])? (no dots allowed)
  • Kubernetes label keys require the prefix (if present) to be a valid DNS subdomain, which technically allows dots, but for consistency and to avoid similar issues with other cloud providers, we use hyphens
  • AWS tags continue to use the original format with dots since AWS allows them
  • Kubernetes annotations continue to use dots since annotations have no such restrictions

All tests pass and the build succeeds.

Changes have been committed to branch simple-forge/issue-164-kubernetes-labels-are-incorrec-tavblu.

Related Issue

Closes #164


This PR was automatically created by Simple Forge

Generated by simple-forge workflow
Job ID: 4d5fd741-a616-44e0-a529-a4e80571e944
Workflow: https://github.com/simple-container-com/api/actions/runs/22280898664
@smecsia smecsia merged commit c26eb30 into main Feb 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kubernetes labels are incorrect

2 participants