From 16563b62eb5b22680947e2ec127f966a56ec1aeb Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Thu, 24 Jun 2021 16:54:13 +0800 Subject: [PATCH] Update to Collector v0.28.0 (#49) * Update to Collector v0.28.0 Closes #48 Addresses the breaking API change in https://github.com/open-telemetry/opentelemetry-collector/pull/3163, besides the usual version number changes. Signed-off-by: Fangyi Zhou * Use `go mod tidy` instead of `go mod download` It appears that this magically resolves the go.mod file issue. https://stackoverflow.com/questions/67203641/missing-go-sum-entry-for-module-providing-package-package-name Signed-off-by: Fangyi Zhou --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/builder/main.go | 2 +- internal/scaffold/main.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e044ce179f1..3de3ec472a5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index b0c3da6a217..73eaf2b56e0 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.27.0" +const defaultOtelColVersion = "0.28.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/builder/main.go b/internal/builder/main.go index 1d22f43452f..ff17bcccf8e 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -130,7 +130,7 @@ func GetModules(cfg Config) error { retries := 3 failReason := "unknown" for i := 1; i <= retries; i++ { - cmd := exec.Command(goBinary, "mod", "download") + cmd := exec.Command(goBinary, "mod", "tidy") cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { failReason = fmt.Sprintf("%s. Output: %q", err, out) diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index fd6de23a66d..e7a55d82e4f 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -53,7 +53,7 @@ func main() { Version: "{{ .Distribution.Version }}", } - app, err := service.New(service.Parameters{BuildInfo: info, Factories: factories}) + app, err := service.New(service.AppSettings{BuildInfo: info, Factories: factories}) if err != nil { log.Fatalf("failed to construct the application: %v", err) } diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 6fbc32844b2..aed07139568 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.27.0 + otelcol_version: 0.28.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 06acd8f32e9..832851b543a 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.27.0 + otelcol_version: 0.28.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.27.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.27.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.28.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.28.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0