Skip to content

Commit

Permalink
Fixes based on the latest review
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • Loading branch information
jpkrohling committed Aug 18, 2020
1 parent 0ad549a commit 4a88da9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/version/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Get() Version {
return Version{
Operator: version,
BuildDate: buildDate,
OpenTelemetryCollector: DefaultOpenTelemetryCollector(),
OpenTelemetryCollector: OpenTelemetryCollector(),
Go: runtime.Version(),
}
}
Expand All @@ -39,8 +39,8 @@ func (v Version) String() string {
)
}

// DefaultOpenTelemetryCollector returns the default OpenTelemetryCollector to use when no versions are specified via CLI or configuration
func DefaultOpenTelemetryCollector() string {
// OpenTelemetryCollector returns the default OpenTelemetryCollector to use when no versions are specified via CLI or configuration
func OpenTelemetryCollector() string {
if len(otelCol) > 0 {
// this should always be set, as it's specified during the build
return otelCol
Expand Down
4 changes: 2 additions & 2 deletions internal/version/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

var _ = Describe("Version management", func() {
It("should have a fallback version", func() {
Expect(DefaultOpenTelemetryCollector()).To(Equal("0.0.0"))
Expect(OpenTelemetryCollector()).To(Equal("0.0.0"))
})

It("should use a version set during the build", func() {
Expand All @@ -17,7 +17,7 @@ var _ = Describe("Version management", func() {
otelCol = ""
}()

Expect(DefaultOpenTelemetryCollector()).To(Equal(otelCol))
Expect(OpenTelemetryCollector()).To(Equal(otelCol))
Expect(Get()).To(ContainSubstring(otelCol))
})
})
4 changes: 3 additions & 1 deletion pkg/collector/parser/receiver_generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var _ = Describe("Generic receivers", func() {

It("should parse the endpoint", func() {
// prepare
// there's no parser registered to handle "myreceiver", so, it falls back to the generic parser
builder := parser.NewGenericReceiverParser(logger, "myreceiver", map[interface{}]interface{}{
"endpoint": "0.0.0.0:1234",
})
Expand All @@ -29,7 +30,8 @@ var _ = Describe("Generic receivers", func() {
})

It("should have failed to parse the endpoint", func() {
// there's no parser regitered to handle "myreceiver", so, it falls back to the generic parser
// prepare
// there's no parser registered to handle "myreceiver", so, it falls back to the generic parser
builder := parser.NewGenericReceiverParser(logger, "myreceiver", map[interface{}]interface{}{
"endpoint": "0.0.0.0",
})
Expand Down

0 comments on commit 4a88da9

Please sign in to comment.