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

topicctl get action to fetch controllerid and clusterid #176

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

ssingudasu
Copy link
Contributor

@ssingudasu ssingudasu commented Feb 6, 2024

Description

topicctl get action currently does not get the Kafka active controller broker id and cluster id

This PR is to implement actions topicctl get controllerid and topicctl get clusterid for the Kafka cluster

Usage

build topicctl

# cd /path/to/topicctl
# go build -o ./build/topicctl -a ./cmd/topicctl

topicctl get controllerid

# ./build/topicctl get controllerid --broker-addr {HOST}:{PORT}
# ./build/topicctl get controllerid --zk-addr {HOST}:{PORT}
# ./build/topicctl get controllerid --zk-addr {HOST}:{PORT} --zk-prefix {ZK_PREFIX}

topicctl get clusterid

# ./build/topicctl get clusterid --broker-addr {HOST}:{PORT}
# ./build/topicctl get clusterid --zk-addr {HOST}:{PORT}
# ./build/topicctl get clusterid --zk-addr {HOST}:{PORT} --zk-prefix {ZK_PREFIX}

local test

# cd /path/to/topicctl
# ./scripts/set_up_net_alias.sh
# docker-compose up -d
# KAFKA_TOPICS_TEST_BROKER_ADMIN=1 go test -count 1 -p 1 ./...

NOTE:

  • test cases have been implemented for GetControllerID since GetClusterID already has test cases

@ssingudasu ssingudasu requested a review from a team as a code owner February 6, 2024 16:48
@ssingudasu ssingudasu changed the title topicctl get action to fetch broker controller id topicctl get action to fetch controllerid and clusterid Feb 7, 2024
Copy link
Contributor

@petedannemann petedannemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I left one suggestion

pkg/admin/brokerclient_test.go Show resolved Hide resolved
pkg/admin/zkclient.go Outdated Show resolved Hide resolved
@ssingudasu ssingudasu merged commit 5bf428a into master Feb 7, 2024
8 checks passed
@ssingudasu ssingudasu deleted the ssingudasu/action-get-controller branch February 7, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants