Skip to content

Commit

Permalink
Ssingudasu/bug fix conn timeout flag (#203)
Browse files Browse the repository at this point in the history
* Bug fix conn timeout for cluster config

* Bug fix conn timeout for cluster config
  • Loading branch information
ssingudasu authored Jun 14, 2024
1 parent 757a906 commit 17d49c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/topicctl/subcmd/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func (s sharedOptions) getAdminClient(
UsernameOverride: s.saslUsername,
PasswordOverride: s.saslPassword,
SecretsManagerArnOverride: s.saslSecretsManagerArn,
KafkaConnTimeout: s.connTimeout,
},
)
} else if s.brokerAddr != "" {
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ type AdminClientOpts struct {
UsernameOverride string
PasswordOverride string
SecretsManagerArnOverride string
KafkaConnTimeout time.Duration
}

// NewAdminClient returns a new admin client using the parameters in the current cluster config.
Expand Down Expand Up @@ -268,6 +269,7 @@ func (c ClusterConfig) NewAdminClient(
Password: saslPassword,
SecretsManagerArn: secretsManagerArn,
},
ConnTimeout: opts.KafkaConnTimeout,
},
ExpectedClusterID: c.Spec.ClusterID,
ReadOnly: opts.ReadOnly,
Expand All @@ -284,6 +286,7 @@ func (c ClusterConfig) NewAdminClient(
ExpectedClusterID: c.Spec.ClusterID,
Sess: sess,
ReadOnly: opts.ReadOnly,
KafkaConnTimeout: opts.KafkaConnTimeout,
},
)
}
Expand Down

0 comments on commit 17d49c2

Please sign in to comment.