Masterminds / sprig

Useful template functions for Go templates.
http://masterminds.github.io/sprig/
MIT License
4.25k stars 436 forks source link

feat: add gzip and ungzip functions #379

Open Vince-Chenal opened 1 year ago

Vince-Chenal commented 1 year ago

Context

Hey,

It could be useful to be able to compress/decompress payloads using gzip/ungzip functions coupled with base64 encoding (existing b64enc).

Usage example

Store compressed files within kubernetes configmaps from Helm to overcome etcd max object size limitation:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: myconfigmap
data:
  somefile: {{ .Files.Get "somefilepath" | gzip | b64enc  }}

Linked to this issue: https://github.com/Masterminds/sprig/issues/355