[skip ci] Implement REST API handler to return the version #6154
Conversation
| // GET /container/version | ||
| api.GetVersionHandler = operations.GetVersionHandlerFunc(func(params operations.GetVersionParams) middleware.Responder { | ||
| return middleware.NotImplemented("operation .GetVersion has not yet been implemented") | ||
| }) |
There was a problem hiding this comment.
how about returning the version directly here without version_get.go (assuming it works)?
api.GetVersionHandler = operations.GetVersionHandlerFunc(func(params operations.GetVersionParams) middleware.Responder {
return operations.NewGetVersionOK().WithPayload(version.GetBuild().ShortVersion())
})
There was a problem hiding this comment.
I believe that would work fine (and is similar to how I implemented it initially), but I think there's a lot of value in having the APIs handled consistently.
If configure_vic_machine.go is simply a dispatcher to logic in other files, and never the place where handler logic is implemented, I think it's easier to reason about. (It also allows for consistent patterns around, for example, testing.)
b235b15 to
761b376
Compare
| } | ||
|
|
||
| // Cleanup returns either an initialized connection, or nil if it was never initialized | ||
| func (l *LazySessionInteractor) Cleanup() (SessionInteractor, error) { |
There was a problem hiding this comment.
Might be worth rebasing - I seem to remember these changes in a different PR (@hickeng's) that I suspect has already been merged.
There was a problem hiding this comment.
It looks like this picked up a bunch of random CLs from other people. Doing a force push seems to have cleared that up.
761b376 to
1a82eb6
Compare
1a82eb6 to
b981097
Compare
Resolves #6016.
Note: this change builds on #6132 and, once approved, I would like this to land as the third commit on
feature/vic-machine-service.