Skip to content

fix(nexus): tighten config validation and skip empty pod annotations#15

Merged
fank merged 1 commit into
mainfrom
claude/nexus-config-validation-followup
Apr 30, 2026
Merged

fix(nexus): tighten config validation and skip empty pod annotations#15
fank merged 1 commit into
mainfrom
claude/nexus-config-validation-followup

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Apr 30, 2026

Summary

Follow-up on review feedback from #14:

  • Skip empty annotations: block. The deployment template emitted an empty annotations: key whenever the provider wasn't configMap and podAnnotations was empty. The block is now gated on actually having something to write.
  • Checksum the SecretProviderClass too when create: true, so edits to the chart-managed SPC roll the pod the same way ConfigMap edits do.
  • Tighten nexus.validateConfigProvider:
    • config.mountPath is required whenever config.provider is set.
    • secretProviderClass requires driver.
    • secretProviderClass.create: true additionally requires provider and a non-empty secrets list (otherwise the SPC would render incomplete and apply would fail with a less clear error).

Chart version: 0.5.0 → 0.5.1.

Test plan

  • provider: "" (default) — no annotations: block in the deployment
  • provider: secretProviderClass with create: false — no annotations: block
  • provider: configMapchecksum/config annotation present
  • provider: secretProviderClass with create: truechecksum/config annotation present (hashing the SPC)
  • mountPath: "" with provider set — fail "config.mountPath is required when config.provider is set"
  • SPC with empty driverfail with required-field message
  • SPC with create: true but missing providerfail
  • SPC with create: true but empty secretsfail
  • helm lint clean

Address review feedback from #14:

- Drop the unconditional `annotations:` block in the deployment
  template — it rendered an empty key whenever neither the configMap
  checksum nor any user `podAnnotations` were present.
- Emit a `checksum/config` for the SecretProviderClass too when
  `create: true`, so chart-managed SPC edits also roll the pod.
- Extend `nexus.validateConfigProvider` to require `mountPath` whenever
  a provider is set, require `secretProviderClass.driver`, and reject
  `secretProviderClass.create=true` without `provider` and a non-empty
  `secrets` list.

Bumps chart version to 0.5.1.
@fank fank merged commit d383c1d into main Apr 30, 2026
3 checks passed
@fank fank deleted the claude/nexus-config-validation-followup branch April 30, 2026 12:32
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request bumps the Nexus chart version to 0.5.1 and introduces enhanced validation for configuration providers in the helper templates, ensuring that mount paths and SecretProviderClass details are correctly defined. Additionally, it updates the deployment template to include a configuration checksum for SecretProviderClass to trigger pod restarts on changes. A review comment identifies a potential issue where the 'checksum/config' annotation key could collide if users provide the same key in custom pod annotations or if multiple providers are used.

Comment on lines 22 to +25
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }}
{{- if $spcChecksum }}
checksum/config: {{ include (print $.Template.BasePath "/secretproviderclass.yaml") . | sha256sum }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The checksum/config annotation is used for both configMap and secretProviderClass providers. While they are currently mutually exclusive, if the chart were extended to support multiple providers simultaneously, this would lead to duplicate keys in the YAML. Additionally, if a user provides checksum/config in podAnnotations, it will be duplicated or overwritten depending on the YAML parser. Consider using a more unique key or merging the annotations to avoid potential collisions.

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.

1 participant