Commit Graph

281 Commits

Author SHA1 Message Date
John Mulligan
89c64b3100 rbd: change instance_ids to instanceIDs
Fix up variable names that don't meet Go standards.
This one crept in while working on older code but before the newer
patch enabling revive to find these was available.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
e5a1f842e5 rbd: naming conventions: fixes in test function TestOpenImage
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 15:28:00 +00:00
John Mulligan
ee3c7f3a80 rbd: naming conventions: fixes in test function TestReadAt
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 15:28:00 +00:00
John Mulligan
e6941b1e27 rbd: naming conventions: fixes in test function TestIOReaderWriter
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 15:28:00 +00:00
John Mulligan
d78d42972e rbd: naming conventions: fixes in test function TestWriteSame
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 15:28:00 +00:00
John Mulligan
c2e4cd5377 rbd: naming conventions: fixes in test function TestDeprecatedImageOpen
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 15:28:00 +00:00
Rakshith R
a32355cba2 rbd: implement binding for rbd_mirror_image_instance_id_list
This commit adds MirrorImageInstanceIDList and
MirrorImageInstanceIDIter with necessary helper functions
and tests.

Fixes: #483

Signed-off-by: Rakshith R <rar@redhat.com>
2021-08-23 06:39:51 +00:00
John Mulligan
4f9322e9f1 rbd: add revive directives to ignore underscores in ImageInfo
These are public fields of a public type and changing them would be
a breaking change. Add revive comment directives to ignore them
so we can continue to have names in this struct that violate the
Go naming convention.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
8ea2109309 rbd: naming conventions: fixes in RemoveImage function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
ae97cd3e7d rbd: naming conventions: fixes in CreateImage function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
6abfb039a4 rbd: naming conventions: fixes in TrashRemove, TrashRestore functions
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
e4cfae9eaa rbd: naming conventions: fixes in SetSnapshot function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
1cbbe2cea5 rbd: naming conventions: fixes in GetSnapshotNames function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
d1b251fef5 rbd: naming conventions: fixes in BreakLock function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
8848df53e1 rbd: 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-08-12 11:05:09 -04:00
John Mulligan
70db71e0b6 rbd: naming conventions: fixes in LockExclusive, LockShared functions
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
05538bceab rbd: 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-08-12 11:05:09 -04:00
John Mulligan
96846c2ccf rbd: naming conventions: fixes in Copy function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
2add913aaf rbd: naming conventions: fixes in GetStripeCount, GetStripeUnit functions
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
ee7767a0d3 rbd: naming conventions: fixes in IsOldFormat function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
f4769e6f89 rbd: 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-08-12 11:05:09 -04:00
John Mulligan
751c644eb5 rbd: naming conventions: fixes in Rename function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
07df8d3338 rbd: naming conventions: fixes in Trash function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
645fd2be49 rbd: naming conventions: fixes in Clone function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
3d2c476cd4 rbd: naming conventions: fixes in Create, Create2, Create3 functions
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
3a168ec717 rbd: naming conventions: fixes in Version function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
56af1b3822 rbd: fix naming convention violations in options.go
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r 'c_set -> cSet' rbd/options.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
030411ac3f rbd: fix naming convention violations in options.go
Fix up variable names that don't meet Go standards.

Command:  gofmt -w -r 'c_value -> cValue' rbd/options.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
bf0ddeffa9 rbd: fix naming convention violations in snapshot.go
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r 'c_is_protected -> cIsProtected' rbd/snapshot.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
7536a52346 rbd: fix naming convention violations in snapshot.go
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r 'c_snapname -> cSnapName' rbd/snapshot.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
John Mulligan
848b877686 rbd: fix naming convention violations in metadata.go
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r 'c_key -> cKey' rbd/metadata.go
Command: gofmt -w -r 'c_value -> cValue' rbd/metadata.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-12 11:05:09 -04:00
Sven Anderson
3de317e39d rbd: export mirror image list functions
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-10 14:15:01 +00:00
Sven Anderson
6fe40e05fc rbd: deprecate Close() method of MirrorImageGlobalStatusIter
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-10 13:23:58 +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
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
RAJAT SINGH
5c49aab11e rbd: add GetMirrorUUID function
* 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>
2021-06-08 14:01:09 +00:00
John Mulligan
24eeb9512c rbd: add a MirrorImageGlobalStatusIter implementing rbd_mirror_image_global_status_list
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>
2021-06-08 12:20:53 +00:00
John Mulligan
2be2128e33 rbd: add CreateMirrorPeerBootstrapToken & ImportMirrorPeerBootstrapToken functions
* 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>
2021-06-03 14:42:42 +00:00
Niels de Vos
92b808cbbe rbd: add DeepCopy()
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>
2021-06-01 14:40:37 +00:00