This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pmem-csi-driver: fix rescheduling after CreateVolume failure
If CreateVolume fails for a volume with late binding, the Kubernetes scheduler is supposed to be told that it needs to reschedule the pod. This didn't work with PMEM-CSI because it returned an "internal" error code instead of the "resource exhausted" one that the external-provisioner knows about. Instead of having different well-defined errors at different levels of the PMEM-CSI software stack, a common error package is used. These errors get wrapped when it is useful to add more information. We still add the gRPC error code, though. That could be avoided by making the internal errors based on gRPC but it is uncertain whether we want to go that far. (cherry picked from commit 34323ff)
- Loading branch information
Showing
12 changed files
with
99 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
Copyright 2020 Intel Coporation. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// Package errors contain some well-defined errors that may have to be | ||
// passed up from low-level layers in the PMEM-CSI stack up to the | ||
// gRPC interface. | ||
// | ||
// These errors must be wrapped (for example, with %w) so that the | ||
// upper layers can use errors.Is to recognize these special errors if | ||
// needed. | ||
package errors | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
var ( | ||
// DeviceExists device with given id already exists | ||
DeviceExists = errors.New("device exists") | ||
|
||
// ErrDeviceNotFound device does not exists | ||
DeviceNotFound = errors.New("device not found") | ||
|
||
// ErrDeviceInUse device is in use | ||
DeviceInUse = errors.New("device in use") | ||
|
||
// ErrNotEnoughSpace no space to create the device | ||
NotEnoughSpace = errors.New("not enough space") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.