Skip to content

Commit

Permalink
fix loop skip (istio#45106)
Browse files Browse the repository at this point in the history
  • Loading branch information
syw14 authored May 24, 2023
1 parent cf18a42 commit bd3c325
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tools/bug-report/pkg/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,19 @@ func GetIstiodInfo(p *Params) (map[string]string, error) {
if p.Namespace == "" || p.Pod == "" {
return nil, fmt.Errorf("getIstiodInfo requires namespace and pod")
}
errs := istiomultierror.New()
ret := make(map[string]string)
for _, url := range common.IstiodDebugURLs(p.ClusterVersion) {
out, err := p.Runner.Exec(p.Namespace, p.Pod, common.DiscoveryContainerName, fmt.Sprintf(`pilot-discovery request GET %s`, url), p.DryRun)
if err != nil {
return nil, err
errs = multierror.Append(errs, err)
continue
}
ret[url] = out
}
if errs.ErrorOrNil() != nil {
return nil, errs
}
return ret, nil
}

Expand Down Expand Up @@ -209,14 +214,19 @@ func GetZtunnelInfo(p *Params) (map[string]string, error) {
if p.Namespace == "" || p.Pod == "" {
return nil, fmt.Errorf("getZtunnelInfo requires namespace and pod")
}
errs := istiomultierror.New()
ret := make(map[string]string)
for _, url := range common.ZtunnelDebugURLs(p.ClusterVersion) {
out, err := p.Runner.EnvoyGet(p.Namespace, p.Pod, url, p.DryRun)
if err != nil {
return nil, err
errs = multierror.Append(errs, err)
continue
}
ret[url] = out
}
if errs.ErrorOrNil() != nil {
return nil, errs
}
return ret, nil
}

Expand Down

0 comments on commit bd3c325

Please sign in to comment.