Skip to content

Commit

Permalink
rpk: fallback to profile's admin address in k8s bundle
Browse files Browse the repository at this point in the history
Clusters deployed with helm/operator will now
have the rpk section of the redpanda.yaml filled
with the Admin API addresses of the cluster. We
fallback to these addresses in case rpk can't
discover the API addresses using the k8s API.
  • Loading branch information
r-vasquez committed Jun 12, 2024
1 parent 63a367e commit 865af17
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/go/rpk/pkg/cli/debug/bundle/bundle_k8s_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ func executeK8SBundle(ctx context.Context, bp bundleParams) error {
zap.L().Sugar().Debugf("unable to get admin API addresses from the k8s API: %v", err)
}
if len(adminAddresses) == 0 {
adminAddresses = []string{fmt.Sprintf("127.0.0.1:%v", config.DefaultAdminPort)}
if len(bp.p.AdminAPI.Addresses) > 0 {
zap.L().Sugar().Debugf("using admin API addresses from profile: %v", bp.p.AdminAPI.Addresses)
adminAddresses = bp.p.AdminAPI.Addresses
} else {
defaultAddress := fmt.Sprintf("127.0.0.1:%v", config.DefaultAdminPort)
zap.L().Sugar().Debugf("profile empty, using %v for the Admin API address", defaultAddress)
adminAddresses = []string{defaultAddress}
}
}
steps = append(steps, []step{
saveClusterAdminAPICalls(ctx, ps, bp.fs, bp.p, adminAddresses, bp.partitions),
Expand Down

0 comments on commit 865af17

Please sign in to comment.