-
Notifications
You must be signed in to change notification settings - Fork 106
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
cloudapi: git sha version api and journal for workers #4484
Changes from all commits
57fcbbd
6a6398e
4b215c5
45cde9c
5e1445c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
exclude-dirs: | ||
- vendor | ||
|
||
linters-settings: | ||
govet: | ||
disable: | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -45,6 +45,19 @@ func (b binder) Bind(i interface{}, ctx echo.Context) error { | |||
return nil | ||||
} | ||||
|
||||
func (h *apiHandlers) GetVersion(ctx echo.Context) error { | ||||
spec, err := GetSwagger() | ||||
if err != nil { | ||||
return HTTPError(ErrorFailedToLoadOpenAPISpec) | ||||
} | ||||
version := Version{ | ||||
Version: spec.Info.Version, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, but the API version is not what I expect under There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can rename this to APIVersion, is there any version information provided currently I could return in here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really see anywhere where we could read the release version from code. Reading it from osbuild-composer/osbuild-composer.spec Line 15 in 8b0a1d1
I think we could just omit the release for now and rename this field to APIVersion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we should not be reading it from the SPEC file or from the system 😉 It should be (and in most of the cases is) embedded in the binary itself, see #4484 (comment)
In that case, I'd suggest entirely omitting the API version. What is the use case for listing it there? |
||||
BuildCommit: common.ToPtr(common.BuildCommit), | ||||
BuildTime: common.ToPtr(common.BuildTime), | ||||
} | ||||
return ctx.JSON(http.StatusOK, version) | ||||
} | ||||
|
||||
lzap marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
func (h *apiHandlers) GetOpenapi(ctx echo.Context) error { | ||||
spec, err := GetSwagger() | ||||
if err != nil { | ||||
|
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.
For full transparency, I sneaked this hunk in with the last amend, I realized that go linter lints also vendor directories and that slows it significantly. Can do a separate PR if requested.