Skip to content

fix: use Kubernetes binaryData field for binary config values#392

Open
thokra-nav wants to merge 1 commit intomainfrom
config_binary
Open

fix: use Kubernetes binaryData field for binary config values#392
thokra-nav wants to merge 1 commit intomainfrom
config_binary

Conversation

@thokra-nav
Copy link
Copy Markdown
Contributor

The old approach stored binary values as base64 strings in the ConfigMap data field and tracked them via a nais.io/binary-keys annotation. A heuristic fallback for configs without the annotation tried to detect binary values by base64-decoding and checking utf8.Valid, but this incorrectly flagged common short strings like "true", "test", "json", "info", "8080", etc. as binary.

Replace this with the native Kubernetes separation: plain text values go in data, binary values go in binaryData. This eliminates the annotation and the broken heuristic entirely. Add/update/remove operations now move values between the two fields based on encoding, and reads simply map data to PLAIN_TEXT and binaryData to BASE64.

The old approach stored binary values as base64 strings in the ConfigMap
data field and tracked them via a nais.io/binary-keys annotation. A
heuristic fallback for configs without the annotation tried to detect
binary values by base64-decoding and checking utf8.Valid, but this
incorrectly flagged common short strings like "true", "test", "json",
"info", "8080", etc. as binary.

Replace this with the native Kubernetes separation: plain text values go
in data, binary values go in binaryData. This eliminates the annotation
and the broken heuristic entirely. Add/update/remove operations now
move values between the two fields based on encoding, and reads simply
map data to PLAIN_TEXT and binaryData to BASE64.
@thokra-nav thokra-nav requested a review from a team as a code owner April 13, 2026 10:21
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