Skip to content

Fix unknown environment in Aiven credential creation#360

Merged
rbjornstad merged 1 commit intomainfrom
fix/aivencredentials-environment-mapping
Mar 16, 2026
Merged

Fix unknown environment in Aiven credential creation#360
rbjornstad merged 1 commit intomainfrom
fix/aivencredentials-environment-mapping

Conversation

@rbjornstad
Copy link
Contributor

@rbjornstad rbjornstad commented Mar 16, 2026

What

  • map user-facing environment names (for example dev-gcp) to cluster names before dynamic client lookup in aivencredentials getClient

Why

  • fixes errors like: createOpenSearchCredentials unknown environment: dev-gcp
  • applies to OpenSearch, Valkey and Kafka credential creation since they share the same getClient path

Verification

  • go test ./internal/persistence/aivencredentials/... ./internal/graph/...

Map user-facing environment names to cluster names before dynamic client lookup in aivencredentials getClient().
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Aiven credentials creation to select the correct Kubernetes dynamic client when the API receives a user-facing environment name that must be mapped back to a cluster name.

Changes:

  • Use environmentmapper.ClusterName(environmentName) when looking up the dynamic Kubernetes client.
  • Add the environmentmapper dependency to the Aiven credentials persistence layer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@rbjornstad rbjornstad merged commit a86ea5f into main Mar 16, 2026
16 checks passed
@rbjornstad rbjornstad deleted the fix/aivencredentials-environment-mapping branch March 16, 2026 14:47
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.

2 participants