Skip to content
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

[WIP] KAFKA-7805: Ducktape should use --bootstrap-server on topic creation #6143

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/kafkatest/services/kafka/kafka.py
Expand Up @@ -30,7 +30,7 @@
from kafkatest.services.monitor.jmx import JmxMixin
from kafkatest.services.security.minikdc import MiniKdc
from kafkatest.services.security.security_config import SecurityConfig
from kafkatest.version import DEV_BRANCH, LATEST_0_10_0
from kafkatest.version import DEV_BRANCH, LATEST_0_10_0, LATEST_2_1

Port = collections.namedtuple('Port', ['name', 'number', 'open'])

Expand Down Expand Up @@ -127,7 +127,6 @@ def __init__(self, context, num_nodes, zk, security_protocol=SecurityConfig.PLAI
node.version = version
node.config = KafkaConfig(**{config_property.BROKER_ID: self.idx(node)})


def set_version(self, version):
for node in self.nodes:
node.version = version
Expand Down Expand Up @@ -341,10 +340,16 @@ def create_topic(self, topic_cfg, node=None):
kafka_topic_script = self.path.script("kafka-topics.sh", node)

cmd = kafka_topic_script + " "
cmd += "--zookeeper %(zk_connect)s --create --topic %(topic)s " % {
if node.version > LATEST_2_1 or node.version == DEV_BRANCH:
cmd += "--bootstrap-server %(bootstrap_servers)s --create --topic %(topic)s " % {
'bootstrap_servers': self.bootstrap_servers(),
'topic': topic_cfg.get("topic"),
}
else:
cmd += "--zookeeper %(zk_connect)s --create --topic %(topic)s " % {
'zk_connect': self.zk_connect_setting(),
'topic': topic_cfg.get("topic"),
}
}
if 'replica-assignment' in topic_cfg:
cmd += " --replica-assignment %(replica-assignment)s" % {
'replica-assignment': topic_cfg.get('replica-assignment')
Expand Down