diff --git a/README.md b/README.md index 72a9aad0b..1978ddd8c 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ go test -tags pacific .... | go-ceph version | Supported Ceph Versions | Deprecated Ceph Versions | | --------------- | ------------------------| -------------------------| +| v0.23.0 | pacific, quincy, reef | nautilus, octopus | | v0.22.0 | pacific, quincy | nautilus, octopus | | v0.21.0 | pacific, quincy | nautilus, octopus | | v0.20.0 | pacific, quincy | nautilus, octopus | diff --git a/cephfs/admin/pin.go b/cephfs/admin/pin.go index 5c29d91aa..104c3cce0 100644 --- a/cephfs/admin/pin.go +++ b/cephfs/admin/pin.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package admin diff --git a/cephfs/admin/pin_test.go b/cephfs/admin/pin_test.go index 265ab636d..7aa8a7f63 100644 --- a/cephfs/admin/pin_test.go +++ b/cephfs/admin/pin_test.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package admin diff --git a/cephfs/admin/volume_info.go b/cephfs/admin/volume_info.go index 039a8f781..b45e00a6d 100644 --- a/cephfs/admin/volume_info.go +++ b/cephfs/admin/volume_info.go @@ -1,5 +1,5 @@ -//go:build !(nautilus || octopus) && ceph_preview -// +build !nautilus,!octopus,ceph_preview +//go:build !(nautilus || octopus) +// +build !nautilus,!octopus package admin diff --git a/cephfs/admin/volume_info_test.go b/cephfs/admin/volume_info_test.go index b07f05b2e..52a26d6ff 100644 --- a/cephfs/admin/volume_info_test.go +++ b/cephfs/admin/volume_info_test.go @@ -1,5 +1,5 @@ -//go:build !(nautilus || octopus) && ceph_preview -// +build !nautilus,!octopus,ceph_preview +//go:build !(nautilus || octopus) +// +build !nautilus,!octopus package admin diff --git a/cephfs/makedirs.go b/cephfs/makedirs.go index cd3e6879c..24b0c34ab 100644 --- a/cephfs/makedirs.go +++ b/cephfs/makedirs.go @@ -1,6 +1,3 @@ -//go:build ceph_preview -// +build ceph_preview - package cephfs /* diff --git a/cephfs/makedirs_test.go b/cephfs/makedirs_test.go index 26b5f424a..744c034db 100644 --- a/cephfs/makedirs_test.go +++ b/cephfs/makedirs_test.go @@ -1,6 +1,3 @@ -//go:build ceph_preview -// +build ceph_preview - package cephfs import ( @@ -14,7 +11,7 @@ func TestMakeDirs(t *testing.T) { defer fsDisconnect(t, mount) dir1 := "/base/sub/way" - err := mount.MakeDirs(dir1, 0755) + err := mount.MakeDirs(dir1, 0o755) assert.NoError(t, err) defer func() { assert.NoError(t, mount.RemoveDir("/base/sub/way")) diff --git a/docs/api-status.json b/docs/api-status.json index 75350d3d2..ac9ee656a 100644 --- a/docs/api-status.json +++ b/docs/api-status.json @@ -317,15 +317,15 @@ "comment": "SelectFilesystem selects a file system to be mounted. If the ceph cluster\nsupports more than one cephfs this optional function selects which one to\nuse. Can only be called prior to calling Mount. The name of the file system\nis not validated by this call - if the supplied file system name is not\nvalid then only the subsequent mount call will fail.\n\nImplements:\n\n\tint ceph_select_filesystem(struct ceph_mount_info *cmount, const char *fs_name);\n", "added_in_version": "v0.20.0", "became_stable_version": "v0.22.0" - } - ], - "preview_api": [ + }, { "name": "MountInfo.MakeDirs", "comment": "MakeDirs creates multiple directories at once.\n\nImplements:\n\n\tint ceph_mkdirs(struct ceph_mount_info *cmount, const char *path, mode_t mode);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" - }, + "became_stable_version": "v0.23.0" + } + ], + "preview_api": [ { "name": "MountInfo.Mknod", "comment": "Mknod creates a regular, block or character special file.\n\nImplements:\n\n\tint ceph_mknod(struct ceph_mount_info *cmount, const char *path, mode_t mode,\n\t\t\t\t dev_t rdev);\n", @@ -594,36 +594,35 @@ "comment": "ListSnapshotMetadata lists custom metadata (key-value pairs) set on the subvolume\nsnapshot in a volume belonging to an optional subvolume group.\n\nSimilar To:\n\n\tceph fs subvolume snapshot metadata ls [--group_name ]\n", "added_in_version": "v0.20.0", "became_stable_version": "v0.22.0" - } - ], - "deprecated_api": [ - { - "name": "New", - "comment": "New creates an FSAdmin automatically based on the default ceph\nconfiguration file. If more customization is needed, create a\n*rados.Conn as you see fit and use NewFromConn to use that\nconnection with these administrative functions.\n\nDeprecated: Use NewFromConn instead of New. The New function does not expose\nthe rados connection and therefore can not be deterministically cleaned up.\n", - "deprecated_in_version": "v0.21.0", - "expected_remove_version": "v0.24.0" - } - ], - "preview_api": [ + }, { "name": "FSAdmin.PinSubVolume", "comment": "PinSubVolume pins subvolume to ranks according to policies. A valid pin\nsetting value depends on the type of pin as described in the docs from\nhttps://docs.ceph.com/en/latest/cephfs/multimds/#cephfs-pinning and\nhttps://docs.ceph.com/en/latest/cephfs/multimds/#setting-subtree-partitioning-policies\n\nSimilar To:\n\n\tceph fs subvolume pin \n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "FSAdmin.PinSubVolumeGroup", "comment": "PinSubVolumeGroup pins subvolume to ranks according to policies. A valid pin\nsetting value depends on the type of pin as described in the docs from\nhttps://docs.ceph.com/en/latest/cephfs/multimds/#cephfs-pinning and\nhttps://docs.ceph.com/en/latest/cephfs/multimds/#setting-subtree-partitioning-policies\n\nSimilar To:\n\n\tceph fs subvolumegroup pin \n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "FSAdmin.FetchVolumeInfo", "comment": "FetchVolumeInfo fetches the information of a CephFS volume.\n\nSimilar To:\n\n\tceph fs volume info \n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" } - ] + ], + "deprecated_api": [ + { + "name": "New", + "comment": "New creates an FSAdmin automatically based on the default ceph\nconfiguration file. If more customization is needed, create a\n*rados.Conn as you see fit and use NewFromConn to use that\nconnection with these administrative functions.\n\nDeprecated: Use NewFromConn instead of New. The New function does not expose\nthe rados connection and therefore can not be deterministically cleaned up.\n", + "deprecated_in_version": "v0.21.0", + "expected_remove_version": "v0.24.0" + } + ], + "preview_api": [] }, "rados": { "stable_api": [ @@ -1829,75 +1828,75 @@ "comment": "MigrationStatus retrieve status of a live migration\nfor the specified image.\n\nImplements:\n\n\tint rbd_migration_status(rados_ioctx_t ioctx,\n\t const char *image_name,\n\t rbd_image_migration_status_t *status,\n\t size_t status_size);\n", "added_in_version": "v0.20.0", "became_stable_version": "v0.22.0" - } - ], - "preview_api": [ + }, { "name": "SiteMirrorImageStatus.UnmarshalDescriptionJSON", "comment": "UnmarshalDescriptionJSON parses an embedded JSON string that may be found in\nthe description of the SiteMirrorImageStatus. It will store the result in\nthe value pointed to by v. If no embedded JSON string is found an\nErrNotExist error is returned. An error may also be returned if the contents\ncan not be parsed.\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "SiteMirrorImageStatus.DescriptionReplayStatus", "comment": "DescriptionReplayStatus parses a MirrorDescriptionReplayStatus result out of\nthe image status description field if available. If the embedded status JSON\nis not found or fails to parse and error will be returned.\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "AddMirrorPeerSite", - "comment": "AddMirrorPeerSite adds a peer site to the list of existing sites.\n", + "comment": "AddMirrorPeerSite adds a peer site to the list of existing sites\n\nImplements:\n\n\tint rbd_mirror_peer_site_add(rados_ioctx_t p, char *uuid, size_t uuid_max_length,\n\t\t\t\t\t\t\t\t rbd_mirror_peer_direction_t direction,\n\t\t\t\t\t\t\t\t const char *site_name,\n\t\t\t\t\t\t\t\t const char *client_name);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "RemoveMirrorPeerSite", - "comment": "RemoveMirrorPeerSite removes the site with the provided uuid.\n", + "comment": "RemoveMirrorPeerSite removes the site with the provided uuid\n\nImplements:\n\n\tint rbd_mirror_peer_site_remove(rados_ioctx_t p, const char *uuid)\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "GetAttributesMirrorPeerSite", - "comment": "GetAttributesMirrorPeerSite fetches the list of key,value pair of attributes of a peer site.\n", + "comment": "GetAttributesMirrorPeerSite fetches the list of key,value pair of attributes of a peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_get_attributes(rados_ioctx_t p, const char *uuid, char *keys,\n\t\t\t\t\t\t\t\t\t\t\tsize_t *max_key_len, char *values, size_t *max_val_len,\n\t\t\t\t\t\t\t\t\t\t\tsize_t *key_value_count);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "SetAttributesMirrorPeerSite", - "comment": "SetAttributesMirrorPeerSite sets the attributes for the site with the given uuid.\n", + "comment": "SetAttributesMirrorPeerSite sets the attributes for the site with the given uuid\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_attributes(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t\t\tconst char *keys, const char *values,\n\t\t\t\t\t\t\t\t\t\t\tsize_t count) ;\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "ListMirrorPeerSite", - "comment": "ListMirrorPeerSite returns the list of peer sites.\n", + "comment": "ListMirrorPeerSite returns the list of peer sites\n\nImplements:\n\n\tint rbd_mirror_peer_site_list(rados_ioctx_t p, rbd_mirror_peer_site_t *peers, int *max_peers)\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "SetMirrorPeerSiteClientName", - "comment": "SetMirrorPeerSiteClientName sets the client name of a mirror peer site.\n", + "comment": "SetMirrorPeerSiteClientName sets the client name for a mirror peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_client_name(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t\t\t const char *client_name);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { - "name": "SetMirrorPeerSiteName", - "comment": "SetMirrorPeerSiteName sets the site name of a mirror peer site.\n", + "name": "SetMirrorPeerSiteDirection", + "comment": "SetMirrorPeerSiteDirection sets the direction of a mirror peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_direction(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t\t rbd_mirror_peer_direction_t direction);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { - "name": "SetMirrorPeerSiteDirection", - "comment": "SetMirrorPeerSiteDirection sets the direction of a mirror peer site.\n", + "name": "SetMirrorPeerSiteName", + "comment": "SetMirrorPeerSiteName sets the name of a mirror peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_name(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t const char *site_name);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" + "became_stable_version": "v0.23.0" }, { "name": "Image.SparsifyWithProgress", "comment": "SparsifyWithProgress makes an image sparse by deallocating runs of zeros.\nThe sparseSize value will be used to find runs of zeros and must be\na power of two no less than 4096 and no larger than the image size.\nThe given progress callback will be called to report on the progress\nof sparse. The operation will be aborted if the progress callback returns\na non-zero value.\n\nImplements:\n\n\tint rbd_sparsify_with_progress(rbd_image_t image, size_t sparse_size,\n\t\t\t\t\t\t\t\t librbd_progress_fn_t cb, void *cbdata);\n", "added_in_version": "v0.21.0", - "expected_stable_version": "v0.23.0" - }, + "became_stable_version": "v0.23.0" + } + ], + "preview_api": [ { "name": "Image.LockAcquire", "comment": "LockAcquire takes a lock on the given image as per the provided lock_mode.\n\nImplements:\n\n\tint rbd_lock_acquire(rbd_image_t image, rbd_lock_mode_t lock_mode);\n", diff --git a/docs/api-status.md b/docs/api-status.md index 36fa16a51..f9528b6f5 100644 --- a/docs/api-status.md +++ b/docs/api-status.md @@ -8,7 +8,6 @@ Name | Added in Version | Expected Stable Version | ---- | ---------------- | ----------------------- | -MountInfo.MakeDirs | v0.21.0 | v0.23.0 | MountInfo.Mknod | v0.22.0 | v0.24.0 | MountInfo.Futime | v0.22.0 | v0.24.0 | MountInfo.Futimens | v0.22.0 | v0.24.0 | @@ -16,14 +15,6 @@ MountInfo.Futimes | v0.22.0 | v0.24.0 | ## Package: cephfs/admin -### Preview APIs - -Name | Added in Version | Expected Stable Version | ----- | ---------------- | ----------------------- | -FSAdmin.PinSubVolume | v0.21.0 | v0.23.0 | -FSAdmin.PinSubVolumeGroup | v0.21.0 | v0.23.0 | -FSAdmin.FetchVolumeInfo | v0.21.0 | v0.23.0 | - ### Deprecated APIs Name | Deprecated in Version | Expected Removal Version | @@ -40,17 +31,6 @@ No Preview/Deprecated APIs found. All APIs are considered stable. Name | Added in Version | Expected Stable Version | ---- | ---------------- | ----------------------- | -SiteMirrorImageStatus.UnmarshalDescriptionJSON | v0.21.0 | v0.23.0 | -SiteMirrorImageStatus.DescriptionReplayStatus | v0.21.0 | v0.23.0 | -AddMirrorPeerSite | v0.21.0 | v0.23.0 | -RemoveMirrorPeerSite | v0.21.0 | v0.23.0 | -GetAttributesMirrorPeerSite | v0.21.0 | v0.23.0 | -SetAttributesMirrorPeerSite | v0.21.0 | v0.23.0 | -ListMirrorPeerSite | v0.21.0 | v0.23.0 | -SetMirrorPeerSiteClientName | v0.21.0 | v0.23.0 | -SetMirrorPeerSiteName | v0.21.0 | v0.23.0 | -SetMirrorPeerSiteDirection | v0.21.0 | v0.23.0 | -Image.SparsifyWithProgress | v0.21.0 | v0.23.0 | Image.LockAcquire | v0.22.0 | v0.24.0 | Image.LockBreak | v0.22.0 | v0.24.0 | Image.LockGetOwners | v0.22.0 | v0.24.0 | diff --git a/rbd/mirror_desc_status.go b/rbd/mirror_desc_status.go index 94b1b1d93..58bd4b390 100644 --- a/rbd/mirror_desc_status.go +++ b/rbd/mirror_desc_status.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package rbd @@ -61,7 +61,8 @@ func (s *SiteMirrorImageStatus) UnmarshalDescriptionJSON(v interface{}) error { // the image status description field if available. If the embedded status JSON // is not found or fails to parse and error will be returned. func (s *SiteMirrorImageStatus) DescriptionReplayStatus() ( - *MirrorDescriptionReplayStatus, error) { + *MirrorDescriptionReplayStatus, error, +) { // --- mdrs := MirrorDescriptionReplayStatus{} if err := s.UnmarshalDescriptionJSON(&mdrs); err != nil { diff --git a/rbd/mirror_desc_status_test.go b/rbd/mirror_desc_status_test.go index f14262860..0ebbcbd13 100644 --- a/rbd/mirror_desc_status_test.go +++ b/rbd/mirror_desc_status_test.go @@ -1,8 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview - -// IMPORTANT - when removing ceph_preview from this file also delete -// rbd/mirror_stub_test.go as it will no longer serve a purpose. +//go:build !nautilus +// +build !nautilus package rbd diff --git a/rbd/mirror_peer_site.go b/rbd/mirror_peer_site.go index 05b08111d..6fa44a5ec 100644 --- a/rbd/mirror_peer_site.go +++ b/rbd/mirror_peer_site.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package rbd @@ -26,8 +26,8 @@ import ( // const char *site_name, // const char *client_name); func AddMirrorPeerSite(ioctx *rados.IOContext, siteName string, clientName string, - direction MirrorPeerDirection) (string, error) { - + direction MirrorPeerDirection, +) (string, error) { var ( err error buf []byte @@ -78,7 +78,6 @@ func RemoveMirrorPeerSite(ioctx *rados.IOContext, uuid string) error { // size_t *max_key_len, char *values, size_t *max_val_len, // size_t *key_value_count); func GetAttributesMirrorPeerSite(ioctx *rados.IOContext, uuid string) (map[string]string, error) { - var ( err error keys []byte diff --git a/rbd/mirror_peer_site_test.go b/rbd/mirror_peer_site_test.go index 788c4681d..79dfc9c7e 100644 --- a/rbd/mirror_peer_site_test.go +++ b/rbd/mirror_peer_site_test.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package rbd diff --git a/rbd/mirror_stub_test.go b/rbd/mirror_stub_test.go deleted file mode 100644 index 6a4633cc2..000000000 --- a/rbd/mirror_stub_test.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build !nautilus && !ceph_preview -// +build !nautilus,!ceph_preview - -package rbd - -import ( - "testing" -) - -// testDescriptionReplayStatus is a stub function that exists only to be -// compiled as a near no-op on non ceph_preview builds. -func testDescriptionReplayStatus(t *testing.T, _ SiteMirrorImageStatus) { - t.Log("not testing DescriptionReplayStatus") -} diff --git a/rbd/sparsify.go b/rbd/sparsify.go index 7ed6082b1..e46ca0d78 100644 --- a/rbd/sparsify.go +++ b/rbd/sparsify.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package rbd @@ -56,7 +56,8 @@ type sparsifyCallbackCtx struct { // int rbd_sparsify_with_progress(rbd_image_t image, size_t sparse_size, // librbd_progress_fn_t cb, void *cbdata); func (image *Image) SparsifyWithProgress( - sparseSize uint, cb SparsifyCallback, data interface{}) error { + sparseSize uint, cb SparsifyCallback, data interface{}, +) error { // the provided callback must be a real function if cb == nil { return rbdError(C.EINVAL) @@ -80,8 +81,8 @@ func (image *Image) SparsifyWithProgress( //export sparsifyCallback func sparsifyCallback( - offset, total C.uint64_t, index uintptr) C.int { - + offset, total C.uint64_t, index uintptr, +) C.int { v := sparsifyCallbacks.Lookup(index) ctx := v.(sparsifyCallbackCtx) return C.int(ctx.callback(uint64(offset), uint64(total), ctx.data)) diff --git a/rbd/sparsify_test.go b/rbd/sparsify_test.go index b7ec54580..bc79dc438 100644 --- a/rbd/sparsify_test.go +++ b/rbd/sparsify_test.go @@ -1,5 +1,5 @@ -//go:build !nautilus && ceph_preview -// +build !nautilus,ceph_preview +//go:build !nautilus +// +build !nautilus package rbd