mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: use go-ceph v0.3.0
v0.3.0 adds support for rbd.FeatureSet that can be used to parse the features of an RBD image. This will be used in the followup commit that adds rbdVolume.getImageInfo(). Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
323cc0e3bb
commit
772d1dfa77
63
vendor/github.com/ceph/go-ceph/rados/errors.go
generated
vendored
Normal file
63
vendor/github.com/ceph/go-ceph/rados/errors.go
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
package rados
|
||||
|
||||
/*
|
||||
#include <errno.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ceph/go-ceph/internal/errutil"
|
||||
)
|
||||
|
||||
// revive:disable:exported Temporarily live with stuttering
|
||||
|
||||
// RadosError represents an error condition returned from the Ceph RADOS APIs.
|
||||
type RadosError int
|
||||
|
||||
// revive:enable:exported
|
||||
|
||||
// Error returns the error string for the RadosError type.
|
||||
func (e RadosError) Error() string {
|
||||
errno, s := errutil.FormatErrno(int(e))
|
||||
if s == "" {
|
||||
return fmt.Sprintf("rados: ret=%d", errno)
|
||||
}
|
||||
return fmt.Sprintf("rados: ret=%d, %s", errno, s)
|
||||
}
|
||||
|
||||
func getError(e C.int) error {
|
||||
if e == 0 {
|
||||
return nil
|
||||
}
|
||||
return RadosError(e)
|
||||
}
|
||||
|
||||
// Public go errors:
|
||||
|
||||
var (
|
||||
// ErrNotConnected is returned when functions are called without a RADOS connection
|
||||
ErrNotConnected = errors.New("RADOS not connected")
|
||||
)
|
||||
|
||||
// Public RadosErrors:
|
||||
|
||||
const (
|
||||
// ErrNotFound indicates a missing resource.
|
||||
ErrNotFound = RadosError(-C.ENOENT)
|
||||
// ErrPermissionDenied indicates a permissions issue.
|
||||
ErrPermissionDenied = RadosError(-C.EPERM)
|
||||
// ErrObjectExists indicates that an exclusive object creation failed.
|
||||
ErrObjectExists = RadosError(-C.EEXIST)
|
||||
|
||||
// RadosErrorNotFound indicates a missing resource.
|
||||
//
|
||||
// Deprecated: use ErrNotFound instead
|
||||
RadosErrorNotFound = ErrNotFound
|
||||
// RadosErrorPermissionDenied indicates a permissions issue.
|
||||
//
|
||||
// Deprecated: use ErrPermissionDenied instead
|
||||
RadosErrorPermissionDenied = ErrPermissionDenied
|
||||
)
|
Reference in New Issue
Block a user