Add health check at /status
There are times where it would be good to monitor that osbuild-composer is up and running. Add a very simple status check that always returns 200/OK. This can be expanded later to verify that other parts of osbuild-composer are working properly. Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
parent
e503b0a4d4
commit
0921643fa3
3 changed files with 23 additions and 0 deletions
|
|
@ -14,6 +14,12 @@ import (
|
|||
"github.com/osbuild/osbuild-composer/internal/worker"
|
||||
)
|
||||
|
||||
// Ensure that the status request returns OK.
|
||||
func TestStatus(t *testing.T) {
|
||||
server := worker.NewServer(nil, testjobqueue.New(), "")
|
||||
test.TestRoute(t, server, false, "GET", "/status", ``, http.StatusOK, `{"status":"OK"}`, "message")
|
||||
}
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
var cases = []struct {
|
||||
Method string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue