Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

Conversation

@lucab
Copy link
Member

@lucab lucab commented Jun 24, 2016

appc 0.8.5 performs stricter validation on types.Isolator instances,
and some rkt tests would fail due to misuses.
This commit switches to proper unmarshaling to construct those
instances.

Context at appc/spec#633

@jonboulle
Copy link
Contributor

we actually have constructors for cpu and memory for this exact reason - maybe we should add for caps?

@lucab
Copy link
Member Author

lucab commented Jun 24, 2016

@jonboulle I'll switch to use those two here, so I can drop one more helper. Regarding you question, we could but we will end up with one constructor per-isolator (briefly discussed that with @alban yesterday, but we were not super happy about it). cpu/memory are special as they parse/transform values, but other isolators are straightforward to construct.

I think types.Isolator.UnmarshalJSON() is enough there (maybe it could gain a NewIsolator wrapper to be more obvious? But still no way to forbid direct construction).

EDIT: I'm actually mixing up things here, and we already have those constructors. They are just not very handy/useful in this table-context though. Amending anyway as one helper is superfluous now.

@lucab lucab added this to the v1.10.0 milestone Jun 24, 2016
@lucab lucab force-pushed the to-upstream/tests-fix-appc-isolators branch from a7cebc9 to fb01cea Compare June 24, 2016 14:08
@lucab
Copy link
Member Author

lucab commented Jun 24, 2016

Amended.

}
if limit == "" {
return rawValue(fmt.Sprintf(`{"request":%q}`, request))
func newIsolator(body string) (i types.Isolator) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mustNewIsolator

@jonboulle
Copy link
Contributor

LGTM after one nit

appc 0.8.5 perform stricter validation on types.Isolator instances,
and some rkt tests would fail due to library misuses.
This commit switches to proper unmarshaling to construct those
instances.
@lucab lucab force-pushed the to-upstream/tests-fix-appc-isolators branch from fb01cea to 2810a4c Compare June 27, 2016 14:13
@lucab
Copy link
Member Author

lucab commented Jun 27, 2016

Rebased.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants