This repository was archived by the owner on Sep 18, 2020. It is now read-only.
Commit 7d6ce4d
committed
config/types: allow compression on all file srcs
This patch adds support for local, inline content as compressed, base64
encoded values. For example, the string "Hello, world." can be
compressed with gzip and base64 encoded with the following command:
$ echo Hello, world. | gzip | base64
H4sIAG/kFlsAA/NIzcnJ11Eozy/KSdHjAgDXu838DgAAAA==
A Container Linux Config could use the above contents and write them to
the file "/etc/helloworld.txt":
storage:
files:
- path: /etc/helloworld.txt
filesystem: root
mode: 0644
contents:
compression: gzip
inline: !binary |
H4sIAB/jFlsAA/NIzcnJ11Eozy/KSdHjAgDXu838DgAAAA==
The CT transpiler would transform the above configuration snippet into
the JSON below:
{
"filesystem": "root",
"path": "/etc/helloworld.txt",
"contents": {
"compression": "gzip",
"source": "data:,H4sIAB%2FjFlsAA%2FNIzcnJ11Eozy%2FKSdHjAgDXu838DgAAAA%3D%3D",
"verification": {}
},
"mode": 420
},
The following command may be used to verify the URL encoded data matches the
original "Hello, world." string:
$ echo H4sIAB%2FjFlsAA%2FNIzcnJ11Eozy%2FKSdHjAgDXu838DgAAAA%3D%3D | \
perl -pe 's/\%(\w\w)/chr hex $1/ge' | \
base64 -D | \
gzip -d
Hello, world.1 parent 5b24575 commit 7d6ce4d
3 files changed
+20
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
298 | 299 | | |
299 | 300 | | |
300 | | - | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
314 | 315 | | |
315 | 316 | | |
316 | | - | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
506 | 507 | | |
507 | | - | |
508 | | - | |
| 508 | + | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
526 | 527 | | |
527 | | - | |
528 | | - | |
| 528 | + | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| |||
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
| 1200 | + | |
1200 | 1201 | | |
1201 | | - | |
1202 | | - | |
| 1202 | + | |
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
| |||
1217 | 1217 | | |
1218 | 1218 | | |
1219 | 1219 | | |
| 1220 | + | |
1220 | 1221 | | |
1221 | | - | |
1222 | | - | |
| 1222 | + | |
1223 | 1223 | | |
1224 | 1224 | | |
1225 | 1225 | | |
| |||
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
| 1427 | + | |
1427 | 1428 | | |
1428 | 1429 | | |
1429 | 1430 | | |
1430 | 1431 | | |
1431 | 1432 | | |
1432 | | - | |
1433 | 1433 | | |
1434 | 1434 | | |
1435 | 1435 | | |
| |||
1930 | 1930 | | |
1931 | 1931 | | |
1932 | 1932 | | |
| 1933 | + | |
1933 | 1934 | | |
1934 | 1935 | | |
1935 | | - | |
1936 | 1936 | | |
1937 | 1937 | | |
1938 | 1938 | | |
| |||
2017 | 2017 | | |
2018 | 2018 | | |
2019 | 2019 | | |
| 2020 | + | |
2020 | 2021 | | |
2021 | 2022 | | |
2022 | | - | |
2023 | 2023 | | |
2024 | 2024 | | |
2025 | 2025 | | |
| |||
2060 | 2060 | | |
2061 | 2061 | | |
2062 | 2062 | | |
| 2063 | + | |
2063 | 2064 | | |
2064 | 2065 | | |
2065 | 2066 | | |
2066 | 2067 | | |
2067 | 2068 | | |
2068 | | - | |
2069 | 2069 | | |
2070 | 2070 | | |
2071 | 2071 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments