Commit 7a490c0
committed
fix(types): allow ':' and '/' in snapshot names for OCI tag-aware refs
The validName regex added in #61 (`^[a-zA-Z0-9][a-zA-Z0-9._-]{0,62}$`)
rejects vk-cocoon's tag-aware local-snapshot naming (`repo:tag`,
e.g. `simular/ubuntu-hot-testing:v1`), breaking PullSnapshot for any
cocoon VM create that goes through vk-cocoon. The cocoon subprocess
exits with name validation error before reading stdin; vk-cocoon
then writes the blob into a closed pipe and surfaces the symptom as
"stream snapshot: ... broken pipe" with no visible upstream hint
(its `command()` discards subprocess stderr).
Split: keep validName strict for VMConfig (hostname / DNS-1123 /
cidata constraints apply) and introduce validSnapshotName that
additionally allows ':' and '/' for SnapshotConfig. Snapshot names
are local cocoon DB keys and never propagate to hostname / DNS /
cidata, so the strict charset isn't load-bearing there. Shell-unsafe
chars and leading non-alnum remain rejected.1 parent e56fa36 commit 7a490c0
3 files changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | | - | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
0 commit comments