Skip to content

Commit

Permalink
rpk: rename redpanda_client_id global config
Browse files Browse the repository at this point in the history
to kafka_protocol_request_client_id
  • Loading branch information
r-vasquez committed Jul 13, 2023
1 parent 99ccc7d commit 1b5a94d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/go/rpk/pkg/config/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,12 @@ var xflags = map[string]xflag{
},
},

"globals.redpanda_client_id": {
"globals.redpanda_client_id",
"globals.kafka_protocol_request_client_id": {
"globals.kafka_protocol_request_client_id",
"rpk",
xkindGlobal,
func(v string, y *RpkYaml) error {
y.Globals.RedpandaClientID = v
y.Globals.KafkaProtocolReqClientID = v
return nil
},
},
Expand Down Expand Up @@ -532,7 +532,7 @@ globals.fetch_max_wait=5s
This timeout specifies the maximum time that brokers will wait before
replying to a fetch request with whatever data is available.
globals.redpanda_client_id=rpk
globals.kafka_protocol_request_client_id=rpk
This string value is the client ID that rpk uses when issuing Kafka protocol
requests to Redpanda. This client ID shows up in Redpanda logs and metrics,
changing it can be useful if you want to have your own rpk client stand out
Expand Down Expand Up @@ -563,7 +563,7 @@ globals.dial_timeout=duration(3s,1m,2h)
globals.request_timeout_overhead=duration(10s,1m,2h)
globals.retry_timeout=duration(30s,1m,2h)
globals.fetch_max_wait=duration(5s,1m,2h)
globals.redpanda_client_id=rpk
globals.kafka_protocol_request_client_id=rpk
`
}

Expand Down
4 changes: 2 additions & 2 deletions src/go/rpk/pkg/config/rpk_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ type (
// fetch requests.
FetchMaxWait Duration `yaml:"fetch_max_wait"`

// RedpandaClientID is the client ID to use for the Kafka API.
RedpandaClientID string `yaml:"redpanda_client_id"`
// KafkaProtocolReqClientID is the client ID to use for the Kafka API.
KafkaProtocolReqClientID string `yaml:"kafka_protocol_request_client_id"`
}

RpkProfile struct {
Expand Down
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/config/rpk_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestRpkYamlVersion(t *testing.T) {
shastr := hex.EncodeToString(sha[:])

const (
v1sha = "0f2ca9327b6ea07b93e37909c7c2c4eb1497d953038386443d6bac553f36b4fa" // 23-06-08
v1sha = "80da2a033d75b87212732138f5a4f9acbecee31a8d8c8be96afb2625f2b4f202" // 23-06-08
)

if shastr != v1sha {
Expand Down
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/kafka/client_franz.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func NewFranzClient(fs afero.Fs, p *config.RpkProfile, extraOpts ...kgo.Opt) (*k
if d := d.FetchMaxWait; d.Duration != 0 {
opts = append(opts, kgo.FetchMaxWait(d.Duration))
}
if id := d.RedpandaClientID; id != "" {
if id := d.KafkaProtocolReqClientID; id != "" {
opts = append(opts, kgo.ClientID(id))
}

Expand Down

0 comments on commit 1b5a94d

Please sign in to comment.