Skip to content

Commit

Permalink
[receiver/redis] Change the type of Config.Password to be `configop…
Browse files Browse the repository at this point in the history
…aque.String` (#24060)

**Description:**
Split out from: #17353

**Link to tracking Issue:** #17273

Co-authored-by: Alex Boten <[email protected]>
  • Loading branch information
mackjmr and Alex Boten committed Jul 20, 2023
1 parent 91d1cd8 commit ab92b58
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .chloggen/redis-use-configopaque.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use this changelog template to create an entry for release notes.
# If your change doesn't affect end users, such as a test fix or a tooling change,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: receiver/redis

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Change the type of `Config.Password` to be `configopaque.String`

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [17273]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
3 changes: 2 additions & 1 deletion receiver/redisreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package redisreceiver // import "github.com/open-telemetry/opentelemetry-collect

import (
"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/receiver/scraperhelper"

Expand All @@ -21,7 +22,7 @@ type Config struct {

// Optional password. Must match the password specified in the
// requirepass server configuration option.
Password string `mapstructure:"password"`
Password configopaque.String `mapstructure:"password"`

TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"`

Expand Down
2 changes: 1 addition & 1 deletion receiver/redisreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/testcontainers/testcontainers-go v0.21.0
go.opentelemetry.io/collector/component v0.81.0
go.opentelemetry.io/collector/config/confignet v0.81.0
go.opentelemetry.io/collector/config/configopaque v0.81.0
go.opentelemetry.io/collector/config/configtls v0.81.0
go.opentelemetry.io/collector/confmap v0.81.0
go.opentelemetry.io/collector/consumer v0.81.0
Expand Down Expand Up @@ -61,7 +62,6 @@ require (
github.com/sirupsen/logrus v1.9.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector v0.81.0 // indirect
go.opentelemetry.io/collector/config/configopaque v0.81.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.81.0 // indirect
go.opentelemetry.io/collector/exporter v0.81.0 // indirect
go.opentelemetry.io/collector/featuregate v1.0.0-rcv0013 // indirect
Expand Down
2 changes: 1 addition & 1 deletion receiver/redisreceiver/redis_scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const redisMaxDbs = 16 // Maximum possible number of redis databases
func newRedisScraper(cfg *Config, settings receiver.CreateSettings) (scraperhelper.Scraper, error) {
opts := &redis.Options{
Addr: cfg.Endpoint,
Password: cfg.Password,
Password: string(cfg.Password),
Network: cfg.Transport,
}

Expand Down

0 comments on commit ab92b58

Please sign in to comment.