Skip to content

Commit

Permalink
vcenterreceiver client adds better check for vApps not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKurek committed Apr 24, 2024
1 parent f8998e2 commit 2b71603
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion receiver/vcenterreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package vcenterreceiver // import "github.com/open-telemetry/opentelemetry-colle

import (
"context"
"errors"
"fmt"
"net/url"

Expand Down Expand Up @@ -116,7 +117,8 @@ func (vc *vcenterClient) ResourcePools(ctx context.Context) ([]*object.ResourceP
func (vc *vcenterClient) VirtualApps(ctx context.Context) ([]*object.VirtualApp, error) {
vApps, err := vc.finder.VirtualAppList(ctx, "*")
if err != nil {
if _, ok := err.(*find.NotFoundError); ok {
var notFoundErr *find.NotFoundError
if errors.As(err, &notFoundErr) {
return []*object.VirtualApp{}, nil
}

Expand Down

0 comments on commit 2b71603

Please sign in to comment.