Skip to content

cloud-providers: Generate provider configs with all options uncommented - #3084

Open
Hru-s wants to merge 2 commits into
confidential-containers:mainfrom
Hru-s:fix/uncomment-provider-configs
Open

cloud-providers: Generate provider configs with all options uncommented#3084
Hru-s wants to merge 2 commits into
confidential-containers:mainfrom
Hru-s:fix/uncomment-provider-configs

Conversation

@Hru-s

@Hru-s Hru-s commented May 21, 2026

Copy link
Copy Markdown

Summary

  • Fixes Generate provider config templates with all options uncommented by default #2856
  • Changed gen-provider-values jq script in src/cloud-providers/Makefile to emit all config keys as real YAML keys instead of comments
  • Removed the empty map {} fallback for providers with no required flags
  • Regenerated all 10 provider YAML files under install/charts/peerpods/providers/
  • Manually updated vsphere.yaml (no manager.go in current source tree)

Problem

Non-required flags were emitted as YAML comments (e.g. # LIBVIRT_MEMORY: "8192") and providers without required flags got providerConfigs.<name>: {}. This caused providerConfigs to be treated as nil in some tooling (notably the Terraform Helm provider), breaking --set-literal overrides on keys under that section.

Solution

Two lines changed in the Makefile's jq script:

  1. Always emit <provider>: (never <provider>: {})
  2. Emit non-required flags as real keys (remove # prefix)

Why this is safe

  • All default values match the Go hardcoded defaults (verified with config-extractor)
  • Empty strings are handled gracefully by the Go code
  • The _helpers.tpl hasTlsCerts check remains safe: CACERT_FILE: "" is falsy in Go templates, so TLS mounts only trigger when the user sets a real certificate path

Test results

Test Result
No {} in any provider YAML PASS
No commented-out config keys PASS
All 10 YAMLs parse with non-empty providerConfigs PASS
All required flags are real YAML keys PASS
No drift after regeneration PASS
helm lint passes for all 10 providers PASS
helm template renders correct ConfigMaps for all 10 providers PASS
--set-literal override works for libvirt (original bug) PASS
--set-literal override works for AWS PASS
TLS mount NOT triggered with empty CACERT_FILE PASS
TLS mount triggered with real CACERT_FILE path PASS
Docker socket mount present for docker provider PASS
SSH mount present for libvirt provider PASS
kata-direct-volumes mount present for ibmcloud provider PASS
Go defaults == YAML defaults for all 9 auto-generated providers PASS

@Hru-s
Hru-s requested a review from a team as a code owner May 21, 2026 12:25

@beraldoleal beraldoleal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hey @Hru-s , thank you.

Please rebase so we can run the tests.

@Hru-s
Hru-s force-pushed the fix/uncomment-provider-configs branch 5 times, most recently from 8a9588d to 3c9c896 Compare June 4, 2026 06:07
Change the gen-provider-values jq script to emit all config keys as
real YAML keys instead of comments, and remove the empty map {}
fallback for providers with no required flags.

Previously, non-required flags were written as YAML comments
(e.g. "# LIBVIRT_MEMORY: "8192"") and providers without required
flags got "providerConfigs.<name>: {}". This caused providerConfigs
to be treated as nil in some tooling (notably the Terraform Helm
provider), breaking --set-literal overrides on keys under that section.

After this change, all config keys are emitted as real YAML entries
with their Go-hardcoded defaults, ensuring providerConfigs is always
a concrete map. Runtime behavior is unchanged since the defaults
match what the Go code already uses, and empty strings are handled
gracefully.

Fixes: confidential-containers#2856
Signed-off-by: Hrushikesh Nakka <hrushikeshnakka@gmail.com>
@Hru-s
Hru-s force-pushed the fix/uncomment-provider-configs branch from 3c9c896 to 30cdebe Compare June 4, 2026 06:08

@ldoktor ldoktor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I remember hitting this issue as well. IIUC you changed only the Makefile and then ran the make sync-chart-values to update the yaml files? Anyway lgtm but needs rebase.

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.

Generate provider config templates with all options uncommented by default

3 participants