Skip to content

Commit

Permalink
api: add status api to support tidb operator (#128)
Browse files Browse the repository at this point in the history
Signed-off-by: dongmen <414110582@qq.com>
  • Loading branch information
asddongmen authored Jul 25, 2024
1 parent eba9469 commit cf5f6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/v2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func RegisterOpenAPIV2Routes(router *gin.Engine, api OpenAPIV2) {
v2.Use(middleware.LogMiddleware())

v2.GET("status", api.serverStatus)
// For compatibility with the old API,
// TiDB Operator relies on this API to determine whether the TiCDC node is healthy.
router.GET("/status", api.serverStatus)

coordinatorMiddleware := middleware.ForwardToCoordinatorMiddleware(api.server)

Expand Down
5 changes: 3 additions & 2 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ RUN apk add --no-cache git make bash
WORKDIR /go/src/tigate
COPY . .
ENV CDC_ENABLE_VENDOR=0
RUN make cdc

RUN --mount=type=cache,target=/root/.cache/go-build,target=/go/pkg/mod make cdc

FROM alpine:3.15
RUN apk add --no-cache tzdata bash curl socat
EXPOSE 8301
EXPOSE 8300
COPY --from=builder /go/src/tigate/bin/cdc /cdc
CMD [ "cdc" ]
CMD [ "/cdc" ]

0 comments on commit cf5f6a8

Please sign in to comment.