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>
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>
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>
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>
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: #262Fixes: #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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>