Skip to content

feat: rename configmap to config and add binary value support#377

Open
jhrv wants to merge 1 commit intomainfrom
binary-config-values
Open

feat: rename configmap to config and add binary value support#377
jhrv wants to merge 1 commit intomainfrom
binary-config-values

Conversation

@jhrv
Copy link
Copy Markdown
Contributor

@jhrv jhrv commented Mar 20, 2026

Summary

  • Renames all internal configmap references to config (package, schema, resolvers, watchers) since "configmap" is a Kubernetes implementation detail
  • Adds encoding: ValueEncoding! to ConfigValue and encoding: ValueEncoding = PLAIN_TEXT to ConfigValueInput for binary data support
  • Implements encode/decode helpers, binary-keys annotation tracking, and updated CRUD operations — mirroring the existing secret binary value pattern

Details

Rename scope:

  • internal/workload/configmap/internal/workload/config/
  • internal/graph/schema/configmap.graphqlsconfig.graphqls
  • internal/graph/configmap.resolvers.goconfig.resolvers.go
  • ConfigMapWatcherConfigWatcher in watchers and http.go

Binary value support:

  • Binary config values are stored as base64-encoded strings in the ConfigMap data field (unlike secrets where K8s handles base64 natively)
  • Binary keys tracked via nais.io/binary-keys annotation (comma-separated)
  • Read path: annotation is authoritative, falls back to utf8.Valid() heuristic
  • Write path: encodeValueForStorage() / decodeValueFromStorage() helpers
  • Remove path: cleans up binary-keys annotation

Companion CLI PR: https://github.com/nais/cli/pull/new/binary-config-values

Rename the internal configmap package/schema/resolvers to config, since
configmap is a Kubernetes implementation detail. Add encoding field to
ConfigValue and ConfigValueInput to support binary data (BASE64), mirroring
the existing secret binary value support.

Key changes:
- Rename internal/workload/configmap/ -> internal/workload/config/
- Rename schema/configmap.graphqls -> config.graphqls
- Rename graph/configmap.resolvers.go -> config.resolvers.go
- Add encoding: ValueEncoding! to ConfigValue type
- Add encoding: ValueEncoding = PLAIN_TEXT to ConfigValueInput
- Add encode/decode helpers for binary config values
- Update all CRUD operations to handle binary encoding
- Store binary values as base64 in ConfigMap data field
- Track binary keys via nais.io/binary-keys annotation
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