Commit Graph

1226 Commits

Author SHA1 Message Date
John Mulligan ed5fad41e6 cephfs admin: add informational functions for cephfs mirroring
Add the functions DaemonStatus and PeerList which provide information
about the cephfs mirroring daemon and mirroring peers.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
John Mulligan d847769649 cephfs admin: add core functions needed to work with cephfs mirroring
These functions require support in the ceph mgr and pertain to setting
up mirroring in the file system, adding directories to mirror, and
setting up mirroring peers.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
John Mulligan 2e8b52be8a cephfs admin: add EnableMirroringModule and DisableMirroringModule funcs
Add functions EnableMirroringModule and DisableMirroringModule for
turning on an off the mirroring module at the ceph mgr.
This also adds the lower level EnableModule and DisableModule that take
a string parameter naming the module, and are the base for
EnableMirroringModule and DisableMirroringModule.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
John Mulligan 6febfd6650 micro-osd.sh: set up a cephfs mirroring daemon
This mirroring daemon is required to test the cephfs mirroring calls
that will be added to cephfs/admin.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
John Mulligan e56f10f3b4 cephfs admin: make fsConnect utility function more flexible
The fsConnect function is used by the tests to support getting a
data-path cephfs connection, in order to support those fs admin tests
that need to make changes in the file system directly. The new second
argument to the call allows for the cephfs connection to be made with a
non-default configuration.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
John Mulligan df3c6dae2e cephfs admin: add newFSAdmin func for setting up fsadmin test instances
Previously, the getFSAdmin function always fetched a cached (if
available) fsadmin instance set up for the default configuration of
ceph. This change makes getFSAdmin based on newFSAdmin a function
that always returns a new instance and allows a custom configuration
to be passed.

Otherwise, newFSAdmin works like getFSAdmin did previously, supporting
debugging via an environment variable.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
John Mulligan d11dd8b6d1 internal commands: add EmptyBody filter function
EmptyBody is like NoBody, but also accepts an empty JSON object ("{}").

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-03 07:25:28 +00:00
Effi Ofer 5ff1efe3aa rbd: add EncryptionLoad api to support the rbd_encryption_load librbd api
Signed-off-by: Effi Ofer <effio@il.ibm.com>
2021-08-02 21:03:36 +00:00
Sven Anderson b968165e78 rbd: add tests for MirrorImageInfoList
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-02 16:39:39 +00:00
Sven Anderson 520f6bfe0d rbd: remove unnecessary type casts
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-02 16:39:39 +00:00
Sven Anderson ac895ae097 rbd: implement binding for rbd_mirror_image_info_list
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-02 16:39:39 +00:00
Sven Anderson 8cbfd1971a rbd: fix comment formatting
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-02 16:39:39 +00:00
John Mulligan dfd1e08fab rbd: remove build tag for luminous from watchers.go
go-ceph stopped supporting luminous in v0.6.0. There's no need to
keep the build tag for it any more.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
John Mulligan b59dda4061 rbd: rename watchers_mimic.go to watchers.go
Drop the _mimic from watchers go file and tests go file.
The mimic was not specific to the version supported, just the version
it was new for. Clean up the naming to reflect that.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
John Mulligan aca200e407 rbd: remove features_mimic.go
go-ceph stopped supporting mimic in v0.7.0. Separate go files for
feature flags added in mimic are no longer needed. Constants and
tests from these files have been moved into the appropriate files.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
John Mulligan b3ed5036f3 rbd: remove luminous and mimic build tags from options_octopus.go
These versions of ceph have not been supported for the last few
release of go-ceph.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
John Mulligan 29a94e03b5 rbd: remove options_mimic.go moving content to options.go
go-ceph stopped supporting mimic in v0.7.0. Keeping the constants
that were added in mimic in a standalone file is no longer needed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
John Mulligan b201e01628 rbd: remove rbd_mimic.go
go-ceph stopped supporting mimic in v0.7.0. This file no longer is
needed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
John Mulligan 5c0c0c94da rbd: remove snapshot_mimic.go
go-ceph stopped supporting mimic in v0.7.0. This file no longer is
needed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-02 15:15:48 +00:00
Jiffin Tony Thottan 11f319727f
Merge pull request #543 from leseb/rm-debug
rgw/admin: remove Debug field from API type
2021-07-29 15:47:05 +05:30
Sébastien Han 9cae71ab54 rgw/admin: remove Debug field from API type
Instead of implementing our own logging let's the consumer implement
their own potential debug for each HTTP requests.

Closes: https://github.com/ceph/go-ceph/issues/508
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-27 18:21:53 +02:00
John Mulligan 402707f2f5 rados: naming conventions: fixes in WriteFull function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan b7b21273e3 rados: naming conventions: fixes in Write function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 396e8f32ff rados: naming conventions: fixes in Unlock function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan e7cdc8fa68 rados: naming conventions: fixes in Truncate function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 3a7c059e82 rados: naming conventions: fixes in Stat function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 86d8bee873 rados: naming conventions: fixes in SetXattr function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan c27c941bef rados: naming conventions: fixes in SetNamespace function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_ns -> cns" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan f4a114fdd6 rados: naming conventions: fixes in RmXattr function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 4dc59eed6a rados: naming conventions: fixes in Read function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 64bfa59378 rados: naming conventions: fixes in LockShared function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan b3cdd63c76 rados: naming conventions: fixes in LockExclusive function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 22b0d4636e rados: naming conventions: fixes in ListXattrs function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 9f1fdbbe9e rados: naming conventions: fixes in ListObjects function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_entry -> cEntry" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan c45780d58d rados: naming conventions: fixes in ListLockers function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 1cb879d9e0 rados: naming conventions: fixes in GetXattr function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 4307dc99ec rados: naming conventions: fixes in GetPoolStats function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_stat -> cStat" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan aba1bfef37 rados: naming conventions: fixes in Delete function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 35d991cf64 rados: naming conventions: fixes in BreakLock function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_client -> cClient" rados/ioctx.go
Command: gofmt -w -r "c_cookie -> cCookie" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 6485854703 rados: naming conventions: fixes in Append function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
Effi Ofer c15b97cf7c rbd: add image encryption format api
Signed-off-by: Effi Ofer <effio@il.ibm.com>
2021-07-26 15:48:33 +00:00
Sébastien Han 1a18c07193 rgw/admin: un-export mock client
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>
2021-07-22 10:24:57 +00:00
Sébastien Han 401fbe9698 rgw/admin: remove unnecessary type
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>
2021-07-21 05:11:49 +00:00
Sébastien Han 42a9620c93 rgw/admin: add ability to mock HTTP Client
We can now use a mocked client to be consumed by unit tests as well as
various users of the API.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-21 05:11:49 +00:00
Sébastien Han 53b3842e29 rgw/admin: add an interface around the HTTP Client
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>
2021-07-21 05:11:49 +00:00
Sven Anderson 5da5db0b9c devcontainer: add option to start ceph nodes for tests 2021-07-19 17:07:42 -04:00
Sébastien Han 7881ee6829 rgw/admin: use http verbs from the http package
The http package provides constants for common http methods so let's use
them.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-13 14:42:54 +00:00
John Mulligan 7f34da0592 cephfs: add test case for ReadConfigFile
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-13 13:53:48 +00:00
John Mulligan 5b727cf7a0 cephfs: add ReadConfigFile implementing ceph_conf_read_file
Unlike ReadDefaultConfigFile, ReadConfigFile supports user specified
paths.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-13 13:53:48 +00:00
John Mulligan 3add450741 cephfs: fix function doc comment for ReadDefaultConfigFile
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-13 13:53:48 +00:00