We don't need to export the mock, the consumer will generate its own.
What really matters is to have an interface that consumer can mock it
desired. Reference: https://github.com/golang/go/wiki/CodeReviewComments#interfaces
Signed-off-by: Sébastien Han <seb@redhat.com>
Now that we use http.Method* constant from the http package, we don't
need to have verbHTTP type anymore.
Signed-off-by: Sébastien Han <seb@redhat.com>
We now have a new interface `HTTPClient` which helps us doing various
operations such as mutating and mocking the HTTP Client.
Signed-off-by: Sébastien Han <seb@redhat.com>
By running `make USE_GOCO=1` the makefile will run go build, etc.
commands using _GO_ from a _COntainer_. This is inspired by recent work
to enable development containers for VSCode, but is more aimed at
vim/cli users like myself who want to compile the code via makefile
rules and make use of vim's quickfix feature without having to have ceph
libs or, more importantly, the right version of the ceph libs, locally.
Full example: `make build test-bins USE_CACHE=1 USE_GOCO=1`
Signed-off-by: John Mulligan <jmulligan@redhat.com>
There are use cases where the default go commands are not what you want,
including an upcoming change. This simply "variablizes" the makefile.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
If the make variable USE_CACHE is set, the test container will mount
the /go directory from a named volume that is reused in following
test runs, so that go dependencies don't have to be installed again.
Signed-off-by: Sven Anderson <sven@redhat.com>
* Add GetMirrorUUID implementing rbd_mirror_uuid_get
This function is be used to get the mirroring uuid for the pool.
Basic tests included.
Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
This adds the function call in the style of an iterator, as the number
of mirrored images in the entire pool could be large. Tests are
included.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Since we are not passing a pointer, let's not return a pointer either.
Also, our use case fits well the non-returning pointer approach since
the content of the struct type is not expected to be modified.
Signed-off-by: Sébastien Han <seb@redhat.com>
This commit introduces support for user and bucket quota on the rgw
admin ops API.
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>
It indicates a mal-formed query for the API where some parameters are
incorrect. This is unlikely to happen with good integration test but we
never know.
Signed-off-by: Sébastien Han <seb@redhat.com>
* Add CreateMirrorPeerBootstrapToken implementing rbd_mirror_peer_bootstrap_create
* Add ImportMirrorPeerBootstrapToken implementing rbd_mirror_peer_bootstrap_import
These functions can be used to set up mirroring between pools. Basic tests
included. The tests only verify that functions work, not that they
actually mirror data. That is a job for another day.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
changed build tag in rados/ioctx_nautilus.go and
rados/ioctx_nautilus_test.go in a way such that the
functions in these files are built for nautilus only.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
Now, we don't support ceph versions < nautilus this function
can move to a generic file so that nautilus specific functions
can be written here. Moved GetNamespace() and the corresponding
test function.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
With rbd_deep_copy() an image can be copied with selected options. This
can be used to create a copy and flatten the image in one go.
Updates: ceph/ceph-csi#2077
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This is a complex test as it requires the pool and an image before it
will return any (non empty) data.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
These are the functions that let one administrate the snapshot schedules
for mirrored pools and images.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adds types to work with the ceph cluster (the admin type) and a type
to work with the "level spec" - which is unfortunately not well
described in the ceph docs, but I think I worked it out well enough
by reading the ceph sources.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This package will be used for issuing json commands to the mgr (or
mons, etc) that perform background tasks to administrate rbd pools,
images, etc.
This commit just adds a doc.go as a stub.
Signed-off-by: John Mulligan <jmulligan@redhat.com>