Skip to content

Commit

Permalink
feat: now listing customer cloud in rhoas kafka list (#1816)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdelahunt authored Feb 28, 2023
1 parent 57ab2f1 commit e2dae0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/cmd/kafka/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type kafkaRow struct {
Status string `json:"status" header:"Status"`
CloudProvider string `json:"cloud_provider" header:"Cloud Provider"`
Region string `json:"region" header:"Region"`
CustomerCloud string `json:"customer_cloud" header:"Customer Cloud"`
}

type options struct {
Expand Down Expand Up @@ -160,13 +161,22 @@ func mapResponseItemsToRows(kafkas []kafkamgmtclient.KafkaRequest, selectedId st
if k.GetId() == selectedId {
name = fmt.Sprintf("%s %s", name, icon.Emoji("✔", "(current)"))
}

var customerCloud string
if id, ok := k.GetClusterIdOk(); ok {
customerCloud = *id
} else {
customerCloud = "Red Hat Infrastructure"
}

row := kafkaRow{
ID: k.GetId(),
Name: name,
Owner: k.GetOwner(),
Status: k.GetStatus(),
CloudProvider: k.GetCloudProvider(),
Region: k.GetRegion(),
CustomerCloud: customerCloud,
}

rows[i] = row
Expand Down

0 comments on commit e2dae0b

Please sign in to comment.