mesos / mesos-go

Go language bindings for Apache Mesos
Apache License 2.0
545 stars 146 forks source link

v1: gogoproto annotations prevent valid reservation request generation #340

Closed ajwerner closed 6 years ago

ajwerner commented 6 years ago

In mesos 1.4 the agent API enforces the comment on ReservationInfo that

// NOTE: This field must not be set for `Resource.reservation`.

https://github.com/mesos/mesos-go/blob/master/api/v1/lib/mesos.proto#L1253 but because of the

optional Type type = 4 [(gogoproto.nullable) = false];

it is impossible to omit type.

so we end up getting back a 400 response from the agent:

Header:  map[Date:[Wed, 10 Jan 2018 16:52:46 GMT] Content-Length:[117] Content-Type:[text/plain; charset=utf-8]]
Status:  400 Bad Request
Body:  Resource 'mem:30000' is invalid: 'Resource.ReservationInfo.type' must not be set for the 'Resource.reservation' field

We've verified that setting nullable to true, regenerating the protos, and setting type to nil resolves the issues.

ajwerner commented 6 years ago

this appears to be addressed by https://github.com/mesos/mesos-go/pull/335

ajwerner commented 6 years ago

What's the ETA #335? If it's more than a couple of weeks, would you be willing to accept a pull request with the single line change?

jdef commented 6 years ago

Thanks for this, yes willing to accept a 1 line change. I'm holding off on 1.5.x protos until Mesos 1.5 actually lands.

On Wed, Jan 17, 2018 at 10:12 AM, ajwerner notifications@github.com wrote:

What's the ETA #335 https://github.com/mesos/mesos-go/pull/335? If it's more than a couple of weeks, would you be willing to accept a pull request with the single line change?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mesos/mesos-go/issues/340#issuecomment-358334446, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPVLG0TJXIA3i5242j_EWt0Wbpv3mxmks5tLg3DgaJpZM4RgEu5 .

jdef commented 6 years ago

resolved by #341