-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to return saveConfig(configFile, c.eSpec)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update it.
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 <[email protected]>
@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 <[email protected]>
The original code return |
|
||
type extendedSpec struct { | ||
rspecs.Spec | ||
Unknown string `json:"unknown,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand what that does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 [email protected]