diff --git a/api/v2/api.go b/api/v2/api.go index d7d2f266f..2df3c258a 100644 --- a/api/v2/api.go +++ b/api/v2/api.go @@ -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) diff --git a/dockerfile b/dockerfile index 007006515..5c99617d1 100644 --- a/dockerfile +++ b/dockerfile @@ -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" ] \ No newline at end of file +CMD [ "/cdc" ] \ No newline at end of file