Skip to content

Commit 56981a9

Browse files
committed
docs: add gzip and ungzip template functions
Signed-off-by: owan <owan.io1992@gmail.com>
1 parent e235c95 commit 56981a9

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

docs/chart_template_guide/function_list.mdx

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ They are listed here and broken down by the following categories:
1515
* [Date](#date-functions)
1616
* [Dictionaries](#dictionaries-and-dict-functions)
1717
* [Encoding](#encoding-functions)
18+
* [Compression](#compression-functions)
1819
* [File Path](#file-path-functions)
1920
* [Kubernetes and Chart](#kubernetes-and-chart-functions)
2021
* [Logic and Flow Control](#logic-and-flow-control-functions)
@@ -1608,6 +1609,119 @@ Helm has the following encoding and decoding functions:
16081609
- `b64enc`/`b64dec`: Encode or decode with Base64
16091610
- `b32enc`/`b32dec`: Encode or decode with Base32
16101611
1612+
## Compression Functions
1613+
1614+
Helm has the following compression and decompression functions:
1615+
1616+
- `gzip`/`ungzip`: Compress or decompress with Gzip
1617+
- `zstd`/`unzstd`: Compress or decompress with Zstd
1618+
- `lz4`/`unlz4`: Compress or decompress with LZ4
1619+
- `snappy`/`unsnappy`: Compress or decompress with Snappy
1620+
- `brotli`/`unbrotli`: Compress or decompress with Brotli
1621+
1622+
All compression functions return a Base64 encoded string. All decompression functions accept a Base64 encoded string.
1623+
1624+
### gzip
1625+
1626+
The `gzip` function compresses a string using Gzip and returns a Base64 encoded result.
1627+
1628+
```
1629+
gzip "Hello world!"
1630+
```
1631+
1632+
It enforces a size limit of 1MB on the output to prevent creating objects too large for Kubernetes Secrets/ConfigMap.
1633+
1634+
### ungzip
1635+
1636+
The `ungzip` function decodes a Base64 encoded string and then decompresses it using Gzip.
1637+
1638+
```
1639+
"H4sIAAAAAAAA/8pIzcnJVyjPL8pJAQQAAP//hRFKDQsAAAA=" | ungzip
1640+
```
1641+
1642+
It enforces a size limit of 1MB on the input string to prevent creating objects too large for Kubernetes Secrets. It also enforces a size limit of 1MB on the decompressed output and verifies that the content is valid UTF-8 text.
1643+
1644+
### zstd
1645+
1646+
The `zstd` function compresses a string using Zstd and returns a Base64 encoded result.
1647+
1648+
```
1649+
zstd "Hello world!"
1650+
```
1651+
1652+
It enforces a size limit of 1MB on the output to prevent creating objects too large for Kubernetes Secrets/ConfigMap.
1653+
1654+
### unzstd
1655+
1656+
The `unzstd` function decodes a Base64 encoded string and then decompresses it using Zstd.
1657+
1658+
```
1659+
"KLUv/QQAYQAASGVsbG8gd29ybGQhsn39fw==" | unzstd
1660+
```
1661+
1662+
It enforces a size limit of 1MB on the input string to prevent creating objects too large for Kubernetes Secrets. It also enforces a size limit of 1MB on the decompressed output and verifies that the content is valid UTF-8 text.
1663+
1664+
### lz4
1665+
1666+
The `lz4` function compresses a string using LZ4 and returns a Base64 encoded result.
1667+
1668+
```
1669+
lz4 "Hello world!"
1670+
```
1671+
1672+
It enforces a size limit of 1MB on the output to prevent creating objects too large for Kubernetes Secrets/ConfigMap.
1673+
1674+
### unlz4
1675+
1676+
The `unlz4` function decodes a Base64 encoded string and then decompresses it using LZ4.
1677+
1678+
```
1679+
"BCJNGGRwuQwAAIBIZWxsbyB3b3JsZCEAAAAAcXerxA==" | unlz4
1680+
```
1681+
1682+
It enforces a size limit of 1MB on the input string to prevent creating objects too large for Kubernetes Secrets. It also enforces a size limit of 1MB on the decompressed output and verifies that the content is valid UTF-8 text.
1683+
1684+
### snappy
1685+
1686+
The `snappy` function compresses a string using Snappy and returns a Base64 encoded result.
1687+
1688+
```
1689+
snappy "Hello world!"
1690+
```
1691+
1692+
It enforces a size limit of 1MB on the output to prevent creating objects too large for Kubernetes Secrets/ConfigMap.
1693+
1694+
### unsnappy
1695+
1696+
The `unsnappy` function decodes a Base64 encoded string and then decompresses it using Snappy.
1697+
1698+
```
1699+
"DCxIZWxsbyB3b3JsZCE=" | unsnappy
1700+
```
1701+
1702+
It enforces a size limit of 1MB on the input string to prevent creating objects too large for Kubernetes Secrets. It also enforces a size limit of 1MB on the decompressed output and verifies that the content is valid UTF-8 text.
1703+
1704+
### brotli
1705+
1706+
The `brotli` function compresses a string using Brotli and returns a Base64 encoded result.
1707+
1708+
```
1709+
brotli "Hello world!"
1710+
```
1711+
1712+
It enforces a size limit of 1MB on the output to prevent creating objects too large for Kubernetes Secrets/ConfigMap.
1713+
1714+
### unbrotli
1715+
1716+
The `unbrotli` function decodes a Base64 encoded string and then decompresses it using Brotli.
1717+
1718+
```
1719+
"GwsAACRBQpBKkUVq+pw1CQ==" | unbrotli
1720+
```
1721+
1722+
It enforces a size limit of 1MB on the input string to prevent creating objects too large for Kubernetes Secrets. It also enforces a size limit of 1MB on the decompressed output and verifies that the content is valid UTF-8 text.
1723+
1724+
16111725
## Lists and List Functions
16121726
16131727
Helm provides a simple `list` type that can contain arbitrary sequential lists

0 commit comments

Comments
 (0)