From 8ad7683f2f1087bf11c697ee0c78850ddf89c4cd Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Tue, 6 Apr 2021 12:58:00 +0100 Subject: [PATCH] Generate a warning if the builder and collector base version mismatch (#30) * Generate a warning if the builder and collector base version mismatch * Show current default version in the warning message --- internal/builder/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/builder/main.go b/internal/builder/main.go index b199c012897..1b514023179 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -50,6 +50,10 @@ func GenerateAndCompile(cfg Config) error { // Generate assembles a new distribution based on the given configuration func Generate(cfg Config) error { + // create a warning message for non-aligned builder and collector base + if cfg.Distribution.OtelColVersion != defaultOtelColVersion { + cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", "builder-version", defaultOtelColVersion) + } // if the file does not exist, try to create it if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil {