Repository navigation
Conversation
When validating paths in the fsnode module, use the `filepath` module instead of the (more generic) `path`.
| const usernameRegex = `^[A-Za-z0-9_.][A-Za-z0-9_.-]{0,31}$` | ||
| const groupnameRegex = `^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$` | ||
|
|
||
| type baseFsNodeJSON struct { |
There was a problem hiding this comment.
We could also call this baseFsNodeData might be a bit clearer
There was a problem hiding this comment.
This was exactly my idea when I read your concern about exposing fields.
Lesson learned, for the new blueprint I want to avoid getters/setters, so I think the new blueprint struct must be immutable. There might be some unmarshal hooks, but once everything is loaded up no changes should be allowed, no getters or anything. I really hope we can achieve this, then all fields can be exported. Well except unions which are not exported and one has to use AsXXX "getter" but that is the only way how to use it.
a7e9214 to
35661ad
Compare
When we move `ImageConfig` into YAML we will need support for
`fsnode.{Dir,File}` as it is used as part of the ImageConfig.
This commit adds support for JSON/YAML unmarshaling.
35661ad to
c6abf5f
Compare
lzap
left a comment
There was a problem hiding this comment.
I think this is miles cleaner than the reflection magic you were proposing initially.
|
Closing in favor of #1508 |
Pull request was closed
Another alternative version of #1479 - I think I like this one best so far
When we move
ImageConfiginto YAML we will need support forfsnode.Fileas it is used as part of the ImageConfig.This commit adds support for JSON/YAML unmarshaling.
fsnode: use
path/filepathinstead ofpathWhen validating paths in the fsnode module, use the
filepathmodule instead of the (more generic)
path.