-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLI-3355] Fix some confluent kafka topic consume
errors
#2970
base: main
Are you sure you want to change the base?
Conversation
🎉 All Contributor License Agreements have been signed. Ready to merge. |
// Fetch the current SR cluster id and endpoint | ||
if srEndpoint == "" { | ||
srClusterId, srEndpoint, err = c.GetCurrentSchemaRegistryClusterIdAndEndpoint() | ||
if err != nil { | ||
return err | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if srEndpoint
is not empty, so the srClusterId
will not set, during normal consume without srClusterId
the deserializer couldn't be initialized correctly.
Not sure if that's the case and being tested?
var srClusterId string | ||
if (schemaId.IsSet() || schema != "") && srEndpoint == "" { | ||
srClusterId, srEndpoint, err = c.GetCurrentSchemaRegistryClusterIdAndEndpoint() | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, will the basic produce have issues with the empty srClusterId
if srEndpoint
is passed from customer flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also handle the auth.GetDataplaneToken(c.Context)
in consumeOnPrem()
and produceOnPrem()
?
Release Notes
Breaking Changes
New Features
Bug Fixes
confluent kafka topic consume
confluent kafka topic [produce | consume] --bootstrap
Checklist
What
GetDataplaneToken
call will fail for users consuming from a cloud cluster using--bootstrap
while logged out, so this PR adds a check that the user is logged in before attempting to get the tokenReferences
Test & Review
Tested with the following.
confluent kafka topic consume -b confluent-audit-log-events
confluent kafka topic [produce | consume] -b confluent-audit-log-events --bootstrap <endpoint> --api-key <api_key> --api-secret <api_secret>
confluent kafka topic produce <topic> --bootstrap <cluster_endpoint> --api-key <api_key> --api-secret <api_secret> --value-format protobuf --schema <schema_id> --schema-registry-endpoint <sr_endpoint> --schema-registry-api-key <sr_key> --schema-registry-api-secret <sr_secret>