Skip to content

Commit

Permalink
DRA e2e: fix error reporting in test driver
Browse files Browse the repository at this point in the history
Dropping the error that is returned by allocateOne hides the reason *why*
allocation failed. Including the UID is "too much information" for an error
message (usually the user doesn't care about the exact identity, just the name)
and the claim name can and will be added by the caller.
  • Loading branch information
pohly committed Jun 26, 2024
1 parent 999d2e7 commit f436a1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/dra/test-driver/app/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (c *ExampleController) allocateOneByOne(ctx context.Context, claimAllocatio
for _, ca := range claimAllocations {
allocationResult, err := c.allocateOne(ctx, ca.Claim, ca.ClaimParameters, ca.Class, ca.ClassParameters, selectedNode)
if err != nil {
ca.Error = fmt.Errorf("failed allocating claim %v", ca.Claim.UID)
ca.Error = err
continue
}
ca.Allocation = allocationResult
Expand Down

0 comments on commit f436a1b

Please sign in to comment.