Skip to content

Commit de6902d

Browse files
Add shutdown api (#380)
Will be used in a prestop hook in shell containers
1 parent 3602036 commit de6902d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/server/server.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func SetUpRouter() *gin.Engine {
2222
v1.GET("/configuration", serverFunc(configuration))
2323
v1.GET("/applications", serverFunc(listApplications))
2424
v1.POST("/context/configuration", serverFunc(contextConfiguration))
25+
v1.POST("/shutdown", serverFunc(shutdown))
2526
}
2627
return r
2728
}
@@ -54,6 +55,15 @@ func healthcheck(c *gin.Context) {
5455
c.String(http.StatusOK, "OK")
5556
}
5657

58+
func shutdown(c *gin.Context) error {
59+
if err := syncGit(); err != nil {
60+
return err
61+
}
62+
63+
c.String(http.StatusOK, "OK")
64+
return nil
65+
}
66+
5767
func teardown() error {
5868
return syncGit()
5969
}

0 commit comments

Comments
 (0)