hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.6k stars 975 forks source link

Allow inputting b64 encoded data with kubernetes_config_map_v1_data via binary_data #2467

Open fullykubed opened 7 months ago

fullykubed commented 7 months ago

Description

I propose adding the binary_data field to kubernetes_config_map_v1_data to match the behavior of kubernetes_config_map.

Unlike kubernetes_config_map, the kubernetes_config_map_v1_data does not have a way to the b64 encoded binary_data directly. This is an issue when trying to add certain types of files such as PNGs to confgmaps as terraform file cannot be used without producing the following error:

│ Call to function "file" failed: contents of "./vault.png" are not valid
│ UTF-8; use the filebase64 function to obtain the Base64 encoded contents or
│ the other file functions (e.g. filemd5, filesha256) to obtain file hashing
│ results instead.

Reading the file via filebase64 and then attempting to decode does not work either.

Community Note

JaylonmcShan03 commented 2 weeks ago

@fullykubed Hi, I will be implementing the binary_data field in a few weeks!