Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.83k stars 1.58k forks source link

helm chart secrets are not correctly reapplied if one of the secret keys contains an empty string #14981

Closed cstruck closed 3 days ago

cstruck commented 3 weeks ago

Checklist

Hosting

Describe the bug When the helm chart is upgraded or synced and there is an existing secret that has an empty string for one or more of the keys, the keys with the empty strings are removed from that secret

but since the empty string is a valid base64 encoded value for the empty string this will cause budibase to crash since the environment variable is now missing

To Reproduce Steps to reproduce the behavior:

  1. create a secret with one of the data keys as the empty string "" e.g apiEncryptionKey
  2. upgrade the chart to a newer version or sync the state from the chart back to the cluster
  3. wait
  4. the budibase app will crash because of a missing env variable like apiEncryptionKey

Expected behavior keys will not be removed from the existing secret

Additional context this happens because inside the charts/budibase/templates/secrets.yaml the secret is read and reapplied from a lookup variable and not quoted before readding

linear[bot] commented 3 weeks ago

BUDI-8824 helm chart secrets are not correctly reapplied if one of the secret keys contains an empty string

Freundschaft commented 1 week ago

any quick fix for this?

cstruck commented 4 days ago

I'd guess not having an empty string key. But can any1 have a look at the pull request and just fix this