Skip to content

Commit

Permalink
Generate a warning if the builder and collector base version mismatch (
Browse files Browse the repository at this point in the history
…open-telemetry#30)

* Generate a warning if the builder and collector base version mismatch

* Show current default version in the warning message
  • Loading branch information
fangyi-zhou authored Apr 6, 2021
1 parent 3d80039 commit 8ad7683
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8ad7683

Please sign in to comment.