Commit Graph

228 Commits

Author SHA1 Message Date
Riya Singhal 2852a13c88 cephfs: made ENOENT a public error
this commit renames ErrNoEntry of cephfs
to ErrNotExist and making it public allowing
other projects to access this.

Signed-off-by: Riya Singhal <rsinghal@redhat.com>
2023-11-09 15:10:14 +00:00
John Mulligan 81dc03889d cephfs admin: remove deprecated New function
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-10-05 11:22:38 +00:00
John Mulligan 4fef2fe1b1 cephfs: promote some file apis to stable
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-10-05 11:22:38 +00:00
Sven Anderson f5c0b089f1 cephfs/admin: promote preview API for release v0.23.0
Signed-off-by: Sven Anderson <sven@redhat.com>
2023-08-14 14:43:57 +00:00
Sven Anderson 5875e7f74b cephfs: promote preview API for release v0.23.0
Signed-off-by: Sven Anderson <sven@redhat.com>
2023-08-14 14:43:57 +00:00
John Mulligan db97336f62 cephfs admin: add version check for reef
Reef is a valid target for testing fsadmin.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-08-02 15:26:51 +00:00
guoguangwu 448e4b7f5c cephfs: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-07-08 14:26:48 +00:00
Anoop C S 37b9a31fd0 cephfs/admin: Make subvolume snapshot metadata APIs stable
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-06-08 17:35:55 +00:00
Anoop C S c2e03fe3bb cephfs/admin: Make subvolume metadata APIs stable
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-06-08 17:35:55 +00:00
Anoop C S 9eb24e9f67 cephfs: Make MountInfo.SelectFilesystem stable
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-06-08 17:35:55 +00:00
Nikhil-Ladha 15ede44c2f cephfs: Add futimes cephfs API
Added a new cephfs API named `ceph_futimes`

Fixes: #254

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
2023-05-18 07:18:07 +00:00
Nikhil-Ladha 39336dae84 cephfs: Add futimens cephfs API
Added a new cephfs API named `ceph_futimens`

Fixes: #253

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
2023-05-12 08:45:32 +00:00
Nikhil-Ladha 46cf8b0c75 cephfs: Add futime cephfs API
Added a new cephfs API named `ceph_futime`

Fixes: #252

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
2023-04-25 04:16:54 +00:00
Nikhil-Ladha bc48ab4143 cephfs: Add mknod cephfs API
Added a new API for the cephfs component named `ceph_mknod`.

Fixes: #257

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
2023-04-13 17:48:39 +00:00
John Mulligan ad61049254 cephfs admin: deprecate the New function
The New function created a rados connection object but did not expose it
via a public api, making it impossible to deterministically sever / clean up
the connection. This commit assumes that the patch will be merged prior
to the go-ceph v0.21 release so that we can plan to remove the function
three versions later (v0.24).  I chose three versions so that it is one
release longer than our typical stabilization period as this function
has been around for a while.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-03-27 17:55:51 +00:00
Anoop C S 2eb895d54f cephfs/admin: Add tests for API fetching volume info
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-03-20 14:17:55 +00:00
Anoop C S d9b77dfca6 cephfs/admin: Add API to fetch volume info
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-03-20 14:17:55 +00:00
Anoop C S 8bc6ef4fa5 cephfs/admin: Add tests for Subvolume{Group} pinning API
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-03-17 20:32:44 +00:00
Anoop C S 11361b05a8 cephfs/admin: Add Subvolume{Group} pinning API
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-03-17 20:32:44 +00:00
Sven Anderson 87041ee7d8 gofmt: reformat everything with new gofmt of go 1.19
Signed-off-by: Sven Anderson <sven@redhat.com>
2023-02-20 20:50:24 +00:00
Damien 4ea99c452e cephfs: implementation of mkdirs
Signed-off-by: Damien <maitredede@gmail.com>
2023-02-20 06:00:15 +00:00
John Mulligan 7accfa6b82 cephfs admin: update tests to handle more than one file system
If the ceph cluster we're testing against supports more then one
fs our tests shouldn't fail. Update the tests to ensure a cephfs
exists as expected but don't assume it's the only one (or that
it's the first one returned).

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-02-13 10:11:06 -05:00
John Mulligan b596cb959b cephfs: add test cases for SelectFileystem call
These tests are all scoped within a test function that will only run if
the alternate fs name is supplied through the environment. This way the
tests can be run by hand on older versions if need be.

The tests verify the use of the SelectFilesystem function and that the
file systems are distinct namespaces.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-02-13 10:11:06 -05:00
John Mulligan 1755e31f71 cephfs: add SelectFileystem implementing ceph_select_filesystem
Add SelectFileystem implementing ceph_select_filesystem which can be
used to select a cephfs by name, prior to calling mount, when the ceph
cluster hosts more than one cephfs file system.

Fixes: #262
Fixes: #818
Original-Version-By: "Arvid E. Picciani" <arvid@kraud.cloud>
Original-PR-URL: https://github.com/ceph/go-ceph/pull/819
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-02-13 10:11:06 -05:00
Anoop C S 8b8e63ebde cephfs/admin: Remove ceph_pre_quincy tags
With an exemption to Pacific, necessary backports are already available
with recent Quincy releases.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2023-01-23 15:12:52 +00:00
John Mulligan 6f7879428f cephfs admin: add additional delay when module is enabled
There was continued flakiness when the tests that enabled the cephfs
mirroring module were enabled. This change adds another 200 ms delay
to hopefully cover the time that might occur as the mgr has a new
module enabled and restart. But unfortunately this is still a bit of
a wild guess.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-12-08 15:12:38 +00:00
John Mulligan 63370f4df6 cephfs admin: remove test skip in TestCancelClone
This will re-enable the test case on ceph quincy and pacific.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-12-08 15:12:38 +00:00
John Mulligan 6c62acb906 cephfs admin: make CloneStatus.GetFailure stable
As per the stabilization doc, this api is now stable for release 0.18.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-10-17 17:18:49 +00:00
John Mulligan d47bc3acbc cephfs: fix a minor typo in a doc comment
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-09-27 15:44:32 +00:00
John Mulligan 9f22ac412d cephfs admin: remove unnecessary import C lines
All the C functions needed by cephfs/admin package come from
one of the other go-ceph packages (rados, cephfs, etc) there's
no good reason to have this unused import in these files.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-08-03 14:35:14 +00:00
Anoop C S 62b4a7323d cephfs/admin: Replace 'unstested' with pre-release tags
Now that we have support for testing APIs from pre-release Ceph
versions lets convert the current 'ceph_ci_untested' tag into
corresponding pre-release version tags.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2022-08-02 14:38:54 +00:00
Anoop C S 31b208ff55 cephfs/admin: Add 'main' to expected Ceph versions
When run against Ceph built out of 'main' development branch our
test-suite fails to find corresponding code name. Therefore we
include 'main' also to the expected list of versions.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2022-08-02 12:38:57 +00:00
Sven Anderson fde1e1b66b cephfs: add AtStatxDontSync and deprecate AtNoAttrSync
This change follows the upstream deprecation of AT_NO_ATTR_SYNC in
favor of the standard AT_STATX_DONT_SYNC.

Fixes: #741

Signed-off-by: Sven Anderson <sven@redhat.com>
2022-08-01 17:04:15 +00:00
Sven Anderson fdd9853f0f go-ceph: add warn logs to finalizers.
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-07-19 14:37:32 +00:00
Anoop C S db3a21808f cephfs/admin: Fix compile errors
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2022-06-30 08:58:01 +00:00
Sven Anderson 6c459dc039 CI: also disable TestCancelClone for pacific
The code causing this issue has been packported to pacific and blocks
the CI. We need to temporarily disable for pacific as well.

Signed-off-by: Sven Anderson <sven@redhat.com>
2022-06-29 13:57:41 +00:00
John Mulligan d31582cf06 cephfs admin: remove deprecated EnableModule, DisableModule funcs
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-06-14 13:10:09 +00:00
Prasanna Kumar Kalever ec40a6c6c3 cephfs: add subvolume snapshot metadata APIs
Exports below APIs:
SetSnapshotMetadata(),
GetSnapshotMetadata(),
RemoveSnapshotMetadata(),
ForceRemoveSnapshotMetadata() and
ListSnapshotMetadata()

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2022-06-13 15:16:36 +00:00
Prasanna Kumar Kalever 7d224905ca cephfs: add subvolume metadata APIs
Exports below APIs:
SetMetadata(),
GetMetadata(),
RemoveMetadata(),
ForceRemoveMetadata() and
ListMetadata()

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2022-06-13 10:44:05 -04:00
Niels de Vos e8c006b3af cephfs/admin: add CloneStatus.GetFailure()
In case cloning failed, Ceph Mgr returns an additional attribute in the
response. The "failed" attribute contains an errno (as string?!) and a
description. It is useful for applications using go-ceph to report the
error back to the user.

As the CloneStatus is on the same level as the CloneFailure object in
the response, keeping strictly to the CephFS Mgr API would break
compatibility. Instead, a new CloneStatus.GetFailure() method has been
introduced, returning a CloneFailure type (or nil) object with details
about the failure.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2022-06-09 19:47:04 +00:00
John Mulligan e0369cdf88 cephfs admin: disable test TestCancelClone on quincy
This test feels very flaky, only passing 2-3 times out of ten (by
my vague guesstimate). This needs investigation.
However I don't want to block all of CI against quincy for this this
now.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-05-02 14:14:25 +00:00
John Mulligan 13bdb3e26c cephfs admin: remove explicit subvol delete from snap retention test
On ceph quincy, removing the subvolume explicitly (even with --force)
triggered an error. Due to the discussion in
https://tracker.ceph.com/issues/54625
I was informed that the explicit delete was not necessary, and while
the error on quincy was not correct, even on previous versions the
call is basically a no-op.

Rather than wait for this to be changed back to a no-op on quincy,
we remove the unneeded call. While we're at it, change the polling
loop to use the assert lib's Eventually call which is much nicer
to read and expires based on a duration avoiding the need to
think about loop iterations. :-)

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-05-02 14:14:25 +00:00
John Mulligan ae44f69791 cephfs admin: flexibly decode the MDSVersion field in volume status
It appears the JSON being returned from `ceph fs status` has changed.
The field returning the mds version was previously "just" a string.
Now its a more complex thing. This of course breaks the old version
of the go code which is statically typed to expect a string.

In order not to break backwards compatibility we replace the object
used for parsing the JSON with a private object that has a custom
unmarshaller function for the mds version field. If it sees the string
it uses the string. Otherwise, it looks for this new structure and,
if possible, extracts the version string from the first item.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-05-02 14:14:25 +00:00
John Mulligan ac1401b4e2 cephfs admin: add quincy to valid server editions
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-05-02 14:14:25 +00:00
John Mulligan c4cfd15e12 cephfs admin: increase timeout waiting for mirroring module
Again.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-08 15:55:02 +00:00
John Mulligan f705d41c96 cephfs admin: mark general mgr module funcs as deprecated
The versions in cluster/admin/manager should be used instead.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-08 15:55:02 +00:00
John Mulligan cc1cb6ed24 cephfs admin: use the new admintest module to set up tests
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-08 15:55:02 +00:00
John Mulligan 85208d213f cephfs admin: reimplement cephfs mgr module calls via common admin
Now that we've moved the logic over to common admin, replace the
implementation in cephfs admin.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-08 15:55:02 +00:00
John Mulligan 1d9c3f8533 cephfs admin: poll mgr to see if mirroring module is enabled
When testing the mirroing workflow, we will not explicitly check
on the mgr for the presence of the mirroring module before proceeding
with the tests. The plan is to have this cut down on test flakes.

The previous workaround also had a bug in that the 2nd sleep was in the
wrong location. Perhaps, fixing this alone would resolve the test
flakes, but this is more proper anyway.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-12-07 18:00:56 +00:00
John Mulligan a26d4b8563 cephfs admin: add a private function for getting mgr modules
Add a function for getting the lists of enabled/disabled mgr modules
from ceph. This is private for the moment as general module management
probably shouldn't be part of cephfs admin. It's bad enough we hacked
in the functions for enabling mirroring. :-)

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-12-07 18:00:56 +00:00