mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: rename EncryptionTypeString() to EncryptionType.String()
This makes it easier to log the EncryptionType as string, or int, whatever is preferred. Standard fmt formatting notations like %s or %d can be used now. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
5a6556c4d4
commit
86b5db90bc
@ -387,8 +387,8 @@ func (conn *Connection) CheckReservation(ctx context.Context,
|
||||
if savedImageAttributes.EncryptionType != encryptionType {
|
||||
return nil, fmt.Errorf("internal state inconsistent, omap encryption type"+
|
||||
" mismatch, request type %q(%d) volume UUID (%s) volume omap encryption type %q (%d)",
|
||||
util.EncryptionTypeString(encryptionType), encryptionType,
|
||||
objUUID, util.EncryptionTypeString(savedImageAttributes.EncryptionType),
|
||||
encryptionType, encryptionType,
|
||||
objUUID, savedImageAttributes.EncryptionType,
|
||||
savedImageAttributes.EncryptionType)
|
||||
}
|
||||
}
|
||||
@ -561,7 +561,7 @@ func (conn *Connection) ReserveName(ctx context.Context,
|
||||
imagePool string, imagePoolID int64,
|
||||
reqName, namePrefix, parentName, kmsConf, volUUID, owner,
|
||||
backingSnapshotID string,
|
||||
encryptionType util.EncryptionType,
|
||||
encryptionType util.EncryptionType, //nolint:interfacer // prefer util.EncryptionType over fmt.Stringer
|
||||
) (string, string, error) {
|
||||
// TODO: Take in-arg as ImageAttributes?
|
||||
var (
|
||||
@ -642,7 +642,7 @@ func (conn *Connection) ReserveName(ctx context.Context,
|
||||
// Update UUID directory to store encryption values
|
||||
if kmsConf != "" {
|
||||
omapValues[cj.encryptKMSKey] = kmsConf
|
||||
omapValues[cj.encryptionType] = util.EncryptionTypeString(encryptionType)
|
||||
omapValues[cj.encryptionType] = encryptionType.String()
|
||||
}
|
||||
|
||||
// if owner is passed, set it in the UUID directory too
|
||||
|
Reference in New Issue
Block a user