Skip to content

Conversation

@jhrv
Copy link
Contributor

@jhrv jhrv commented Jan 21, 2026

Problem

The previous fix (PR #312) incorrectly removed ClusterName() from ALL operations. This caused Environment "prod-gcp" does not exist errors when trying to read secret values.

Root cause

There are two different systems with different naming conventions:

  • Watcher cache: Uses environment names (prod-gcp)
  • Kubernetes API: Uses cluster names (prod)

Fix

Add ClusterName() back for Kubernetes API calls:

  • All mutations (Create, Add, Update, Remove, Delete) - use SystemAuthenticatedClient
  • GetSecretValues - uses impersonated Client

Watcher lookups (Get, ListForWorkload) correctly use environment names (from PR #312).

The previous fix incorrectly removed ClusterName() from all operations.
However, Kubernetes API calls need cluster names (prod), while watcher
cache lookups use environment names (prod-gcp).

This adds ClusterName() back for:
- All mutations (Create, Add, Update, Remove, Delete) - use SystemAuthenticatedClient
- GetSecretValues - uses impersonated Client

Watcher lookups (Get, ListForWorkload) correctly use environment names.
@jhrv jhrv requested a review from a team as a code owner January 21, 2026 15:06
@frodesundby frodesundby merged commit 4be6785 into main Jan 21, 2026
10 checks passed
@frodesundby frodesundby deleted the fix-secret-env-mapping-v2 branch January 21, 2026 15:13
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.

3 participants