Skip to content

Commit

Permalink
Fix hostname for internal
Browse files Browse the repository at this point in the history
  • Loading branch information
alungu committed Mar 2, 2021
1 parent 86bf343 commit c19291f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/k8sutil/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,10 @@ func CreateInternalListenerStatuses(kafkaCluster *v1beta1.KafkaCluster, external
// add addresses per broker
for _, broker := range kafkaCluster.Spec.Brokers {
var address = ""

if iListener.ExternalListenerForHostname != "" && iListener.InternalStartingPort > 0 {
if eListenerStatus, ok := externalListenerStatus[iListener.ExternalListenerForHostname]; ok {
hostname := getHostnameForBrokerId(eListenerStatus, broker.Id)
address = fmt.Sprintf("%s://%s:%d",
strings.ToUpper(iListener.Name), hostname, iListener.InternalStartingPort+broker.Id)
address = fmt.Sprintf("%s:%d", getHostnameForBrokerId(eListenerStatus, broker.Id),
iListener.InternalStartingPort+broker.Id)
}
}

Expand Down

0 comments on commit c19291f

Please sign in to comment.