Skip to content

Commit 8ad7683

Browse files
authored
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
1 parent 3d80039 commit 8ad7683

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/builder/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ func GenerateAndCompile(cfg Config) error {
5050

5151
// Generate assembles a new distribution based on the given configuration
5252
func Generate(cfg Config) error {
53+
// create a warning message for non-aligned builder and collector base
54+
if cfg.Distribution.OtelColVersion != defaultOtelColVersion {
55+
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)
56+
}
5357
// if the file does not exist, try to create it
5458
if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) {
5559
if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil {

0 commit comments

Comments
 (0)