add annotation and prop tests#586
Conversation
|
|
rebased, PTAL @q384566678 |
validation/misc_props.go
Outdated
| PreCreate: func(r *util.Runtime) error { | ||
| r.SetID(containerID) | ||
| saveConfig(configFile, c.eSpec) | ||
| return nil |
There was a problem hiding this comment.
I think it's better to return saveConfig(configFile, c.eSpec)
|
It was in a panic when I was testing. Here is the test. I'm looking for the reason. |
Add test cases for test cases for AnnotationsKeyReversedDomain, AnnotationsKeyReservedNS, AnnotationsKeyIgnoreUnknown, ValidValues and ExtensibilityIgnoreUnknownProp. Signed-off-by: Liang Chenye <liangchenye@huawei.com>
|
@q384566678 it works in my test, can you post your 'config.json' file? |
|
|
@q384566678 thanks, I can reproduce it. Debugging now. |
|
Very strange, if I add the following |
Signed-off-by: Liang Chenye <liangchenye@huawei.com>
|
The original code return |
|
|
||
| type extendedSpec struct { | ||
| rspecs.Spec | ||
| Unknown string `json:"unknown,omitempty"` |
There was a problem hiding this comment.
I don't quite understand what that does.
There was a problem hiding this comment.
I use this to test ’runtimes that are reading or processing this configuration file MUST NOT generate an error if they encounter an unknown property‘. 'Unknown' here (in my commit) means the 'unknown property', so when a runtime reads this, it does not know what it means and it should not generete an error.
I filed an issue about this: opencontainers/runc#1846 |
test cases for AnnotationsKeyReversedDomain, AnnotationsKeyReservedNS,
AnnotationsKeyIgnoreUnknown, ExtensibilityIgnoreUnknownProp and
ValidValues
Signed-off-by: Liang Chenye liangchenye@huawei.com