Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbd: log formatting and go-ceph deprecation in constructImageOptions #5116

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1586,27 +1586,27 @@ func (rv *rbdVolume) constructImageOptions(ctx context.Context) (*librbd.ImageOp

logMsg := fmt.Sprintf("setting image options on %s", rv)
if rv.DataPool != "" {
logMsg += ", data pool %s" + rv.DataPool
err = options.SetString(librbd.RbdImageOptionDataPool, rv.DataPool)
logMsg += ", data pool " + rv.DataPool
err = options.SetString(librbd.ImageOptionDataPool, rv.DataPool)
if err != nil {
return nil, fmt.Errorf("failed to set data pool: %w", err)
}
}

if rv.ImageFeatureSet != 0 {
err = options.SetUint64(librbd.RbdImageOptionFeatures, uint64(rv.ImageFeatureSet))
err = options.SetUint64(librbd.ImageOptionFeatures, uint64(rv.ImageFeatureSet))
if err != nil {
return nil, fmt.Errorf("failed to set image features: %w", err)
}
}

if rv.StripeCount != 0 {
logMsg += fmt.Sprintf(", stripe count %d, stripe unit %d", rv.StripeCount, rv.StripeUnit)
err = options.SetUint64(librbd.RbdImageOptionStripeCount, rv.StripeCount)
err = options.SetUint64(librbd.ImageOptionStripeCount, rv.StripeCount)
if err != nil {
return nil, fmt.Errorf("failed to set stripe count: %w", err)
}
err = options.SetUint64(librbd.RbdImageOptionStripeUnit, rv.StripeUnit)
err = options.SetUint64(librbd.ImageOptionStripeUnit, rv.StripeUnit)
if err != nil {
return nil, fmt.Errorf("failed to set stripe unit: %w", err)
}
Expand All @@ -1615,7 +1615,7 @@ func (rv *rbdVolume) constructImageOptions(ctx context.Context) (*librbd.ImageOp
if rv.ObjectSize != 0 {
order := uint64(math.Log2(float64(rv.ObjectSize)))
logMsg += fmt.Sprintf(", object size %d, order %d", rv.ObjectSize, order)
err = options.SetUint64(librbd.RbdImageOptionOrder, order)
err = options.SetUint64(librbd.ImageOptionOrder, order)
if err != nil {
return nil, fmt.Errorf("failed to set object size: %w", err)
}
Expand Down