-
Notifications
You must be signed in to change notification settings - Fork 146
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
support for quota, allocator, maintenance, master, and agent v1.2.x APIs #312
Conversation
jdef
commented
Jul 25, 2017
•
edited
Loading
edited
- updated 1.2.x protobufs
- refactored client, encoding, httpcli, recordio packages to account for v1 protocol changes in 1.2.x
- updated and enhanced examples
- fixes support new content and message type headers w/ mesos 1.2.0 #300, add support for master 1.2.x operator API #310
The (generated, then hacked) test case is: func TestEvent_TaskUpdatedGoString(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedEvent_TaskUpdated(popr, false)
s1 := p.GoString()
s2 := fmt.Sprintf("%#v", p)
if s1 != s2 {
t.Fatalf("GoString want %v got %v", s1, s2)
}
_, err := go_parser.ParseExpr(s1)
if err != nil {
t.Errorf("failed to parse %s", s1) // I added this to see what GoString was returning
panic(err) // fails the test
}
} |
… handle Mesos v1 protocol changes introduced in Mesos 1.2.x
I've been testing the "attach container" API with an interactive
slave logs:
container stderr:
container stdout:
There are (currently) a number of open MESOS tickets related to container attachment: https://issues.apache.org/jira/browse/MESOS-7103 |
api/v1/lib/httpcli/http.go
Outdated
@@ -27,7 +30,8 @@ type ProtocolError string | |||
func (pe ProtocolError) Error() string { return string(pe) } | |||
|
|||
const ( | |||
debug = false // TODO(jdef) kill me at some point | |||
debug = false // TODO(jdef) kill me at some point | |||
MediaTypeRecordIO = encoding.MediaType("application/recordio") |
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.
why is this public?
api/v1/lib/httpcli/http.go
Outdated
enc = c.codec.NewEncoder(func() framing.Writer { return recordio.NewWriter(pw) }) | ||
) | ||
|
||
req, err := http.NewRequest("POST", c.url, pr) |
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.
move to var block?
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.
no, because err is already declared
api/v1/lib/httpcli/http.go
Outdated
} | ||
|
||
case http.StatusAccepted: | ||
// nothing to validate, we're not expecting any response entity in this case |
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.
maybe a TODO to validate ContentLength (if Mesos actually supplies that?)
848347f
to
4c21684
Compare
2a8c4c4
to
6329032
Compare