Skip to content

Commit

Permalink
rpk: fill schema registry information in cloud profiles
Browse files Browse the repository at this point in the history
This is available in all of our cloud deployments.
  • Loading branch information
r-vasquez committed Oct 24, 2024
1 parent 5333337 commit 1392dd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/go/rpk/pkg/cli/profile/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ func fromCloudCluster(yAuth *config.RpkCloudAuth, rg *controlplanev1beta2.Resour
isMTLS = mtls.Enabled
}
}
if c.SchemaRegistry != nil {
p.SR.Addresses = []string{c.SchemaRegistry.Url}
p.SR.TLS = new(config.TLS)
if mtls := c.SchemaRegistry.Mtls; !isMTLS && mtls != nil {
isMTLS = mtls.Enabled
}
}
return CloudClusterOutputs{
Profile: p,
ResourceGroupName: rg.Name,
Expand All @@ -522,6 +529,10 @@ func fromVirtualCluster(yAuth *config.RpkCloudAuth, rg *controlplanev1beta2.Reso
Addresses: []string{vc.Status.Listeners.ConsoleURL},
TLS: new(config.TLS),
},
SR: config.RpkSchemaRegistryAPI{
Addresses: vc.Status.Listeners.SchemaRegistryURL,
TLS: new(config.TLS),
},
CloudCluster: config.RpkCloudCluster{
ResourceGroup: rg.Name,
ClusterID: vc.ID,
Expand Down
5 changes: 3 additions & 2 deletions src/go/rpk/pkg/cloudapi/api_virtual_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ type (

Status struct {
Listeners struct {
ConsoleURL string `json:"consoleUrl"`
SeedAddresses []string `json:"seedAddress"`
ConsoleURL string `json:"consoleUrl"`
SeedAddresses []string `json:"seedAddress"`
SchemaRegistryURL []string `json:"schemaRegistryUrl,omitempty"`
} `json:"listeners"`
} `json:"status"`
}
Expand Down

0 comments on commit 1392dd7

Please sign in to comment.