Skip to content

implement templated agentHelmValues - #783

Merged
michaeljguarino merged 5 commits into
mainfrom
lukasz/prod-5033-implement-templated-agenthelmvalues-in-terraform-provider
Jul 16, 2026
Merged

implement templated agentHelmValues#783
michaeljguarino merged 5 commits into
mainfrom
lukasz/prod-5033-implement-templated-agenthelmvalues-in-terraform-provider

Conversation

@zreigz

@zreigz zreigz commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Render agentHelmValues with Liquid when agentHelmValuesTemplateable is true, using cluster context (name, handle, id, metadata, tags, etc.).
  • Fetch deployment settings with backwards compatibility: try the full GraphQL query first, fall back to a minimal query (agentHelmValues + agentVsn).

Labels

Test Plan

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • I have added relevant labels to this PR to help with categorization for release notes.

@linear

linear Bot commented Jul 15, 2026

Copy link
Copy Markdown

PROD-5033

@socket-security

socket-security Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​pluralsh/​console/​go/​client@​v0.0.0-20260706120905-5f6ff115eb71 ⏵ v1.76.5100 +110010010070

View full report

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Liquid template rendering for agentHelmValues in deployment settings, using cluster context (name, ID, handle, metadata, tags, etc.) when agentHelmValuesTemplateable is true. It also adds a backwards-compatible fallback for older console servers that do not expose agentHelmValuesTemplateable: the full GraphQL query is attempted first, and if the server returns an "unknown field" error, a minimal query (agentHelmValues + agentVsn only) is used instead.

  • agent_helm_values.go: new ResolveAgentHelmValues function that optionally runs Liquid rendering before YAML unmarshalling, with clusterBindings exposing cluster fields under both PascalCase and lowercase keys.
  • settings.go: GetGlobalSettings now delegates to getGlobalSettings and falls back to GetGlobalSettingsMinimal on an "unknown field" error, detected via the new IsUnknownGraphQLField helper.
  • plural.go / go.mod: wires the new resolution logic into DoInstallOperator and upgrades the console client dependency to v1.76.5.

Confidence Score: 4/5

The new templating path is opt-in and gated by AgentHelmValuesTemplateable, leaving the existing non-templated flow unchanged.

Both findings are non-blocking quality concerns: the map-mutation-during-range in clusterBindings is harmless in practice but is an anti-pattern, and the string-based fallback detection could break silently if the error message format changes.

pkg/console/settings.go (fallback error detection) and pkg/console/agent_helm_values.go (clusterBindings map iteration)

Important Files Changed

Filename Overview
pkg/console/agent_helm_values.go New file implementing Liquid template rendering for agentHelmValues. Logic is correct; minor style issue with map mutation during range iteration in clusterBindings.
pkg/console/agent_helm_values_test.go Solid test coverage for ResolveAgentHelmValues and IsUnknownGraphQLField, covering nil settings, non-templated, templated, and metadata/tags cases.
pkg/console/settings.go Adds backwards-compatible fallback to a minimal GraphQL query when agentHelmValuesTemplateable is unsupported; fallback detection relies on string-matching the error message.
pkg/client/plural.go DoInstallOperator updated to fetch cluster context when templating is enabled and delegate YAML resolution to ResolveAgentHelmValues; logic and error handling are correct.
pkg/console/console.go Adds GetGlobalSettingsMinimal to the ConsoleClient interface to support the backwards-compatible fallback path.
go.mod Bumps console client from a pseudo-version to v1.76.5 and removes the replace directive that was pinning it to a pre-release commit.

Reviews (1): Last reviewed commit: "implement templated agentHelmValues" | Re-trigger Greptile

Comment thread pkg/console/agent_helm_values.go
Comment thread pkg/console/settings.go Outdated
@zreigz zreigz added the enhancement New feature or request label Jul 15, 2026
zreigz and others added 4 commits July 15, 2026 15:03
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Comment thread pkg/console/agent_helm_values.go
@michaeljguarino
michaeljguarino merged commit 3b9b9df into main Jul 16, 2026
14 checks passed
@michaeljguarino
michaeljguarino deleted the lukasz/prod-5033-implement-templated-agenthelmvalues-in-terraform-provider branch July 16, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants