mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cleanup: replace github.com/pborman/uuid with github.com/google/uuid
The github.com/google/uuid package is used by Kubernetes, and it is part of the vendor/ directory already. Our usage of github.com/pborman/uuid can be replaced by github.com/google/uuid, so that github.com/pborman/uuid can be removed as a dependency. Closes: #3315 Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
aad99ebcb7
commit
b697b9b0d9
@ -27,7 +27,7 @@ import (
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Length of string representation of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is 36 bytes.
|
||||
@ -431,8 +431,8 @@ func (conn *Connection) UndoReservation(ctx context.Context,
|
||||
}
|
||||
|
||||
imageUUID := volName[len(volName)-36:]
|
||||
if valid := uuid.Parse(imageUUID); valid == nil {
|
||||
return fmt.Errorf("failed parsing UUID in %s", volName)
|
||||
if _, err := uuid.Parse(imageUUID); err != nil {
|
||||
return fmt.Errorf("failed parsing UUID in %s: %w", volName, err)
|
||||
}
|
||||
|
||||
err := util.RemoveObject(
|
||||
@ -484,7 +484,7 @@ func reserveOMapName(
|
||||
iterUUID = volUUID
|
||||
} else {
|
||||
// generate a uuid for the image name
|
||||
iterUUID = uuid.NewUUID().String()
|
||||
iterUUID = uuid.New().String()
|
||||
}
|
||||
|
||||
err := util.CreateObject(ctx, monitors, cr, pool, namespace, oMapNamePrefix+iterUUID)
|
||||
|
Reference in New Issue
Block a user