Skip to content

Commit

Permalink
Merge pull request #37 from openshift-cherrypick-robot/cherry-pick-31…
Browse files Browse the repository at this point in the history
…-to-release-4.6

Bug 1916096: [release-4.6] check FollowLink errors
  • Loading branch information
openshift-merge-robot committed Jan 28, 2021
2 parents b4665df + d844dfe commit a2985b8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/operator/storageclass_controller.go
Expand Up @@ -97,7 +97,12 @@ func (c *OvirtStrogeClassController) getStorageDomain(ctx context.Context) (stri

for _, attachment := range attachments.MustAttachments().Slice() {
if attachment.MustBootable() {
d, _ := conn.FollowLink(attachment.MustDisk())
d, err := conn.FollowLink(attachment.MustDisk())
if err != nil {
klog.Errorf("Failed to follow disk: %v", err)
return "", err
}

disk, ok := d.(*ovirtsdk.Disk)
klog.Info(fmt.Sprintf("Extracting Storage Domain from disk: %s", disk.MustId()))

Expand All @@ -106,7 +111,11 @@ func (c *OvirtStrogeClassController) getStorageDomain(ctx context.Context) (stri
return "", err
}

s, _ := conn.FollowLink(disk.MustStorageDomains().Slice()[0])
s, err := conn.FollowLink(disk.MustStorageDomains().Slice()[0])
if err != nil {
klog.Errorf("Failed to follow Storage Domain: %v", err)
return "", err
}
sd, ok := s.(*ovirtsdk.StorageDomain)

klog.Info(fmt.Sprintf("Fetched Storage Domain %s", sd.MustName()))
Expand Down

0 comments on commit a2985b8

Please sign in to comment.