Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/vcenter] Print the correct error message if VM fetch fails #15685

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Print the correct error message if VM fetch fails
  • Loading branch information
neelayu committed Oct 27, 2022
commit 1b1d59c55539568ed3b847ad2b78dd7ef67e4d03
16 changes: 16 additions & 0 deletions .chloggen/vcenter-err.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'bug_fix'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: vcenterreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Print the correct error message if VM fetch fails.

# One or more tracking issues related to the change
issues: [15682]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
4 changes: 2 additions & 2 deletions receiver/vcenterreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (vc *vcenterClient) Clusters(ctx context.Context, datacenter *object.Datace
vc.finder = vc.finder.SetDatacenter(datacenter)
clusters, err := vc.finder.ClusterComputeResourceList(ctx, "*")
if err != nil {
return []*object.ClusterComputeResource{}, err
return []*object.ClusterComputeResource{}, fmt.Errorf("unable to get cluster lists: %w", err)
}
return clusters, nil
}
Expand All @@ -118,7 +118,7 @@ func (vc *vcenterClient) ResourcePools(ctx context.Context) ([]*object.ResourceP
func (vc *vcenterClient) VMs(ctx context.Context) ([]*object.VirtualMachine, error) {
vms, err := vc.finder.VirtualMachineList(ctx, "*")
if err != nil {
return nil, fmt.Errorf("unable to retrieve resource pools: %w", err)
return nil, fmt.Errorf("unable to retrieve vms: %w", err)
}
return vms, err
}
Expand Down