* Add SetMirrorSiteName implementing rbd_mirror_site_name_set
* Add GetMirrorSiteName implementing rbd_mirror_site_name_get
These functions are used to set the name of the site (for an entire
cluster) for rbd mirroring purposes. It's a bit strange that it's
part of rdb and not rados, but such is life.
Tests included.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Following this discussion #492
This commit introduces a new package "rgw/admin" which helps you interact
with the [RadosGW Admin Ops API](https://docs.ceph.com/en/latest/radosgw/adminops).
Not all the API capabilities are covered by this commit, but this is a
solid foundation for adding code on top. I'm expecting a few more
iterations to make 100% complete. Also, the RadosGW Admin API is going
to implement new functions soon (like bucket creation). So this library
will live on and keep catching up.
As many unit tests as possible have been added. A new integration test
suite also runs. The "micro-osd.sh" now deploys a RGW and the
integration suite tests on it. Thus the CI should cover it.
Shout out to @QuentinPerez and @IrekFasikhov for their existing
libraries. They were a very good inspiration to get started.
Co-authored-by: Irek Fasikhov <malmyzh@gmail.com>
Co-authored-by: Quentin Perez <qperez42@gmail.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
We now set the hostname for the "test-container" to "test_ceph_aio"
where "aio" means "all in one". This will be useful for the rgw test
where we need an hostname to reach out to the endpoint.
Signed-off-by: Sébastien Han <seb@redhat.com>
Sometimes the version in the RPM repository don't match the version
of the base image. This change updates the packages before installing
the libraries in order to make them match.
Signed-off-by: Sven Anderson <sven@redhat.com>
Tests are running against Ceph Pacific and passing, so this can be
marked as a required CI status.
dpulls handles dependencies between PRs, once the status is marked with
success, the requirements have all been merged. Prevent merging when
dpulls is in a failed state.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
For better or worse, unlike Go, shell does not have a standard formatting style.
Add a vim modeline that should match the basic current formatting style of the
scripts. This ought to help fellow vim users when editing the scripts.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
a file name .build.octopus gets created everytime the repoository is opened into the dev cointainer, adding it in gitignore will solve this issue.
Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
The MirrorImageStatusSummary returns a map of image mirroring states to
the number of images in those states or an error.
Tests of both the basic conditions and actual mirrored images are added.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change uses slices on top of C allocated array memory in order
to have a simple (no pointer arithmetic) and safe (boundary-checked)
access to its elements.
Signed-off-by: Sven Anderson <sven@redhat.com>
We're adding a fair amount of octopus (and later) only features now, and
at the time of this writing, pacific is already out. Stop defaulting to
nautilus and default to octopus instead.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Some tests were not run, because entrypoint.sh used a fixed list of package,
which is easily forgotten to update. This change creates the list of
packages dynamically.
Signed-off-by: Sven Anderson <sven@redhat.com>
This change adds configurations for running the development
environment in a container, as supported by VSCode or GitHub
Codespaces.
Signed-off-by: Sven Anderson <sven@redhat.com>
Unless these apis are deprecated in the (far?) future it is safer to say
"not nautilus" rather than explicitly tag all current and future ceph
release codenames.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Replace uses of the rbd-fuse virtual file system with command line
invocations of `rbd import` and `rbd export`. This allows us to drop
the dependency on rbd-fuse (and fuse entirely, again). Fuse requires
additional privs and special stuff so not using it makes running the
container simpler and more secure.
The only downside that I see to this change is that `rbd import` refuses
to overwrite existing images. This means the logic of the setup
function needed to be slightly changed but I don't consider it all
that different.
I did also slightly decrease the size of the image to ~500K. I didn't
think we needed to be copying so much zeros over the wire nor did
mirroring a lot of zeros demonstrate much IMO.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Allow passing additional arguments for the entrypoint.sh script to
the test container. This is useful to limit the test run to
a single package with `--test-pkg=<X>` for example.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
When running the new test-multi-container make rule, I found that
podman generated "random" hex based hostnames for the containers.
These names work internally and do resolve but I found that putting
these in the ceph config files does not work as ceph sees them as
addresses, not hostnames, presumably due to the hex.
This change simply specifies the hostnames manually on the cli
so that both podman and docker should match docker's default behavior.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
With the infrastructure for running two ceph clusters now available,
we add tests to ensure the functionality of GetGlobalMirrorStatus in
the more typical case, when one or more mirroring clusters exist,
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This function can be used to connect to a non-default ceph cluster,
in a simple, convenient way similar to the function we have for
connecting to the default cluster.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This function is used to "manually" trigger a snapshot for snapshot
based mirroring. It is needed as a pre-req to test actual cross-cluster
mirroring and the full functionality of GetGlobalMirrorStatus.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Later changes to the test Go code will make use of the MIRROR_CONF
variable to access the secondary ceph cluster.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This function is added, along with required return types and some helper
functions, to support fetching the global mirroring status component
that makes up a major part of `rbd mirror image status` command's
output.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Remove the logic previously ported over to internal/commands and just
leave the functions in place as to not have to excessively touch the
existing code.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Now that we have shared support working with "command json" we attempt
a minimal conversion, using aliases where appropriate, to the
new commands.Response type.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Uintptr are guaranteed to be at least of the size of a pointer. However, in
theory it could be larger. Since the code of PtrGuard assumes both have the
same size and to be on the safe side, this change adds a compile-time check,
that the sizes of uintptr and pointers are the same.
Signed-off-by: Sven Anderson <sven@anderson.de>
The current version we are testing with is no longer supported.
This updates Go to a supported released version.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
When invoking podman/docker/etc. it is no longer needed to add fuse
support, or (AFAICT) keeping cap SYS_ADMIN.
Signed-off-by: John Mulligan <jmulligan@redhat.com>