-
Notifications
You must be signed in to change notification settings - Fork 2k
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
two fixes for inspect on connect proxy #7690
Conversation
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.
Is there a backward compatibility concern with struct renaming? Might need use tags rather than renaming field. Also, are these values set by user in the API or just read-only fields?
Given that nomad/structs are persisted, changing the field name would mean that future versions will silently drop 0.11.0 Expose field.
FWIWI, struct persistence use msgpack with codec tags, while api interaction uses json tag - so probably a clever use of tags can preserve compatibility while solving the issue.
35bd50f
to
b956062
Compare
Before, the proxy stanza did not parse non-object fields `local_service_port` and `local_service_address` from the connect `proxy` stanza. This change fixes that.
…tions The field names within the structs representing the Connect proxy definition were not the same (nomad/structs/ vs api/), causing the values to be lost in translation for the 'nomad job inspect' command. Since the field names already shipped in v0.11.0 we cannot simply fix the names. Instead, use the json struct tag on the structs/ structs to remap the name to match the publicly expose api/ package on json encoding. This means existing jobs from v0.11.0 will continue to work, and the JSON API for job submission will remain backwards compatible.
b956062
to
eef81c3
Compare
Gah! yep, we need to preserve the field names as they're persisted in 0.11. Following your suggestion, I've now left the field names alone, and only applied |
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.
LGTM, don't forget to update CHANGELOG
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR contains 2 commits, each with a fix around the response of
nomad job inspect
on jobs containing aproxy
stanza. More details in each commit, but basicallyproxy.local_service_address
andproxy.local_service_port
was missingproxy
representation withinapi
andnomad/structs
were different, causing them to be lost in translation (i.e. JSON marshaling)Fixes #7397