Commit d2db358
Fix devfile parsing failure for devfiles with parent registry references
When parsing devfiles with parent references (e.g. devfile-sample-go-basic
which has parent.id: go from registry.devfile.io), the devfile library
resolves the parent by downloading registry resources and copying them to
the directory containing the devfile. When raw bytes are passed via the
Data field, the parser has no absPath set, so it defaults to the process
working directory. In the console container, WORKDIR is / and the process
runs as user 1001, so mkdir fails with "permission denied".
Fix by writing devfile content to a temp directory and passing the file
path to the parser instead of raw bytes. This gives the parser a writable
absPath for resolving parent/plugin resources. The temp directory is
cleaned up after each request.
Also add an early return when devfile content is empty to avoid
unnecessary temp directory creation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e6e8b8c commit d2db358
1 file changed
Lines changed: 31 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
52 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
53 | 82 | | |
54 | 83 | | |
55 | | - | |
| 84 | + | |
56 | 85 | | |
57 | 86 | | |
58 | 87 | | |
| |||
0 commit comments