From b05d3bb0665c6c1770fde9c5156211ccd39ee07e Mon Sep 17 00:00:00 2001 From: barnettZQG Date: Mon, 1 Aug 2022 18:26:38 +0800 Subject: [PATCH] Fix: there is no color in the diff report (#4511) Signed-off-by: barnettZQG --- cmd/apiserver/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/apiserver/main.go b/cmd/apiserver/main.go index 0a57b937b..6567bdee9 100644 --- a/cmd/apiserver/main.go +++ b/cmd/apiserver/main.go @@ -26,6 +26,7 @@ import ( "time" restfulspec "github.com/emicklei/go-restful-openapi/v2" + "github.com/fatih/color" "github.com/go-openapi/spec" "github.com/google/uuid" flag "github.com/spf13/pflag" @@ -82,6 +83,10 @@ func main() { return } + // The server is not terminal, there is no color default. + // Force set to false, this is useful for the dry-run API. + color.NoColor = false + errChan := make(chan error) ctx, cancel := context.WithCancel(context.Background()) defer cancel()