Skip to content

Commit

Permalink
[chore] [cmd/builder] Require github.com/knadh/koanf submodules (#8301)
Browse files Browse the repository at this point in the history
Explicitly require `github.com/knadh/koanf/maps` and
`github.com/knadh/koanf/providers/confmap` in go.mod to workaround
ambiguous imports. Otherwise, the command fails with:
```
Error: failed to update go.mod: exit status 1. Output:
go: github.com/open-telemetry/opentelemetry-collector-contrib/cmd/otelcontribcol imports
	github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector imports
	go.opentelemetry.io/collector/confmap imports
	github.com/knadh/koanf/maps: ambiguous import: found package github.com/knadh/koanf/maps in multiple modules:
	github.com/knadh/koanf v1.5.0 (/Users/danoshin/go/pkg/mod/github.com/knadh/[email protected]/maps)
	github.com/knadh/koanf/maps v0.1.1 (/Users/danoshin/go/pkg/mod/github.com/knadh/koanf/[email protected])
go: github.com/open-telemetry/opentelemetry-collector-contrib/cmd/otelcontribcol imports
	github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector imports
	go.opentelemetry.io/collector/confmap imports
	github.com/knadh/koanf/providers/confmap: ambiguous import: found package github.com/knadh/koanf/providers/confmap in multiple modules:
	github.com/knadh/koanf v1.5.0 (/Users/danoshin/go/pkg/mod/github.com/knadh/[email protected]/providers/confmap)
	github.com/knadh/koanf/providers/confmap v0.1.0 (/Users/danoshin/go/pkg/mod/github.com/knadh/koanf/providers/[email protected])

make: *** [genotelcontribcol] Error 1
```
  • Loading branch information
dmitryax authored Aug 29, 2023
1 parent 0af1c11 commit 4f94232
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/builder/internal/builder/templates/go.mod.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ require (
go.opentelemetry.io/collector v{{.Distribution.OtelColVersion}}
)

require (
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
)

{{- range .Connectors}}
{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}}
{{- end}}
Expand Down

0 comments on commit 4f94232

Please sign in to comment.