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: add ErrExists as standard error #1027

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

nixpanic
Copy link
Member

Certain operations with RBD can return the C errno EEXISTS. Applications using go-ceph benefit from easily detecting this error.

@nixpanic
Copy link
Member Author

CI jobs fail with something completely unrelated:

revive -config .revive.toml $(find . -name '*.go')
Error: ./rbd/snapshot_octopus.go:53:36: redefinition of the built-in function len
Error: ./rados/snapshot.go:88:36: redefinition of the built-in function len
make: *** [Makefile:258: check-revive] Error 1
Error: ./rados/watcher.go:301:45: redefinition of the built-in function len

@anoopcs9
Copy link
Collaborator

CI jobs fail with something completely unrelated:

revive -config .revive.toml $(find . -name '*.go')
Error: ./rbd/snapshot_octopus.go:53:36: redefinition of the built-in function len
Error: ./rados/snapshot.go:88:36: redefinition of the built-in function len
make: *** [Makefile:258: check-revive] Error 1
Error: ./rados/watcher.go:301:45: redefinition of the built-in function len

Recently released revive v1.4.0 checks function related variables for redefines-builtin-id rule. Let me quickly update the function argument names.

@anoopcs9
Copy link
Collaborator

@Mergifyio rebase

Copy link

mergify bot commented Sep 24, 2024

rebase

✅ Branch has been successfully rebased

rbd/errors.go Outdated
@@ -73,6 +73,8 @@ var (

// Public general error
const (
// ErrExist indicates a non-specific already existing resource.
ErrExist = rbdError(-C.EXISTS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ErrExist = rbdError(-C.EXISTS)
ErrExist = rbdError(-C.EEXIST)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, and I thought I tested this 🤦

@anoopcs9
Copy link
Collaborator

@Mergifyio rebase

Certain operations with RBD can return the C errno EEXIST. Applications
using go-ceph benefit from easily detecting this error.

Signed-off-by: Niels de Vos <[email protected]>
Copy link

mergify bot commented Sep 24, 2024

rebase

✅ Branch has been successfully rebased

Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@phlogistonjohn phlogistonjohn added the API This PR includes a change to the public API of a go-ceph package label Sep 25, 2024
@mergify mergify bot merged commit 5a7f9c9 into ceph:master Sep 25, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This PR includes a change to the public API of a go-ceph package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants