Commit Graph

1057 Commits

Author SHA1 Message Date
Sven Anderson b5c4989a88 rados: add comment about missing pinning in writeStep
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-11-15 21:47:09 +00:00
Sven Anderson 3a7f2e2896 rados: C-allocate return parameters in GetOmapStep
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-11-15 21:47:09 +00:00
Seena Fallah bae93ac4ab rbd: export image name
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2021-11-09 02:31:09 +00:00
John Mulligan a46d9cbd62 entrypoint: ensure implements tool is up to date
When running things by hand it's nice to reuse the same build of
implements over and over, but for the casual contributor
who may need to run implements as part of adding a new API we want to
ensure the tool being run is up-to-date with the repo.
Cleaning the binary first is a quick and dirty way of getting there.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan dfba5f5bb0 makefile: add a rule to clean up implements binary
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan a1fbaf921a docs: expand on the newer doc/comment policies in dev guide
Specifically, this provides examples of the newly standardized
methods for marking deprecated and preview as well as telling
the user how to update the api-status docs.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 8f19d77c68 docs: reference api-status.md from api-stability.md
Removes a long standing TODO.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 0f565466b2 github: add a checklist item as a reminder about api preview
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 5d1ec1d64f makefile: generate implements.json if not present
Add new rules to build/run the implements tool via the test container,
an only the implements tool, when apiage is to be run and the
implements.json is not present.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 3c874e078d makefile: add rules for managing api stability docs
The rules added to the makefile help contributors and maintainers follow
the recent api stability policy by allowing one to check the state,
update the state (using the git tags for versioning info) and update
only the generated markdown doc.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan fc3ffc95e4 entrypoint: support executing only implements tool
The implements tool just does static code (ast) analysis. Support
running it in the container, but on its own in the case you only
want the implements tool output.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 689ee58bf8 contrib: have apiage fail if no source data is available
It is kind of pointless to let the tool run if no source data is
present, so treat empty/missing source as an error.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 0d5ae4da1f contrib: add support for using the most recent tag for basing updates
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan 5985d410ce rados: merge test case into standard tests file, removing luminous tag
We no longer support ceph luminous, and have not for a while. This
test case was kept separately from the others because it didn't function
correctly when tested against luminous clusters. As part of the effort
to remove the unsupported build tags, there's no longer even a reason
to keep this as it's own file with the tags removed, so merge it
together.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 01:24:01 +00:00
John Mulligan cc9f4d6b39 rbd: remove luminous and mimic build tags
Luminous and mimic have not been supported for a few releases now.
There's no need to keep these build tags any more.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 01:24:01 +00:00
John Mulligan e79f1d786f cephfs: remove luminous and mimic build tags
Luminous and mimic have not been supported for a few releases now.
There's no need to keep these build tags any more.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 01:24:01 +00:00
John Mulligan c0852d43d0 cephfs admin: add sleeps after mgr module is enabled (workaround)
This is a workaround for the common test flake:
```
=== RUN   TestMirroring
    mirror_workflow_test.go:63:
            Error Trace:    mirror_workflow_test.go:63
            Error:          Received unexpected error:
                            rados: ret=-95, Operation not supported:
"Module 'mirroring' is not enabled (required by command 'fs snapshot
mirror enable'): use `ceph mgr module enable mirroring` to enable it"
            Test:           TestMirroring
```
at even though we've certainly requested the mode be enabled the mgr
has apparently not fully processed the request and the module is
not yet available. We add a half-second sleep after each call
to hopefully give the mgr time enough to completely enable the module.

A future improvement would be to poll the mgr until we know it is ready to
use the cephfs mirroring module, but that would take some research and
(probably) new API calls. So this is a temporary workaround just
to try and reduce the number of test flakes sooner rather than later.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-01 15:45:03 +00:00
Sébastien Han e23ab127c0 rgw/admin: promote add/remove caps to stable
Promoting the API.AddUserCap and API.RemoveUserCap calls to stable so
they can be release in 0.13.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-10-29 12:49:23 +00:00
John Mulligan 2ef8713fc5 readme: document v0.12.0 and the ceph versions it supports
Also, change the hint regarding build tags to use "pacific" as it
a fully supported ceph version.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-10-19 13:52:10 -04:00
Sébastien Han 67c57bd965 rgw/admin: ability to retrieve user by access key
We can now get an s3 user from the rgw admin ops API with its access
key. No validation on the key is performed other than not being empty.

Closes: https://github.com/ceph/go-ceph/issues/600
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-10-18 14:28:21 +00:00
Sven Anderson 87f4563118 format: run gofmt on all files
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 18:58:35 +00:00
Sven Anderson 26fd846da1 docs: update comments of preview and deprecated APIs
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 18:58:35 +00:00
Sven Anderson cee047149f tools: update implements tool to new deprecated/preview style
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 18:58:35 +00:00
Sven Anderson ac4494e707 docs: use Go convention for deprectated APIs
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 18:58:35 +00:00
Sven Anderson 97630486ee contrib: implements tool prints stderr if castxml fails
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 15:49:43 +00:00
Sven Anderson 3210885d21 ptrguard: simplify pointer size assert
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 06:58:23 +00:00
John Mulligan a451da9e8e github: require explicit "no-API" label for merge on 1 review
It's too easy to forget to triage a PR with the API label, and then
if the PR looks good and is approved the mergify system will merge
it. Move to using an explicit "no-API" label for marking the PR as truly
not having API changes and not requiring a 2nd review.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 09:49:24 -04:00
John Mulligan 3fef124e9d docs: add new rbd admin functions to api-status (post rebase)
While working on this patch series new APIs were added to the rbd/admin
package. This patch includes them in the initial set of apis being
tracked.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 3f32efcf56 docs: add initial copies of the api-status.json & markdown doc
The file api-status.json is designed to track changes to the go-ceph
APIs, especially the 'deprecated' and 'preview' apis. It also stores
lists of stable apis so that we can see if something new but not
explicitly stable appears.

The api-status.md file is actually meant to be read by users of go-ceph
so to help make decisions about the use of new preview apis or
deprecated apis. It is generated from api-status.json.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 7ce34854e1 workflows: experiment with apiage check in the ci
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 5d41b671df contrib: add apiage.py - a script to help track the "aging" of apis
This tool can be run as part of our CI as a mechanism to check that
(some) of the policy requirements are being met. It can also be run by
humans as part of the process to update the tracked API information.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 16ff05194c entrypoint: scan the sources of cephfs/admin, rbd/admin, rgw/admin
Now that 'implements' has rudimentary support for these packages we can
gather information on them just like the C based ones.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 970b2eecda entrypoint: don't print results of 'command' when testing for castxml
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 953e3ab495 dockerfile: enable castxml when possible (again)
Return to trying to install castxml into the container image when
possible. This now appears to work (and function) on the centos 8 based
images.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan f986a965ca implements: always include the ceph_preview build tag
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 3590347f60 implements: add support for scanning the api of the "admin" subpackages
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 961ff19bfd implements: don't panic if no counts for C functions are avaiable
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 29c18bcfd0 implements: report on stable functions in json output
Because there will be a lot of stable functions we only report on them
in the json report as the text report is more meant for summaries.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan d1aa76c613 implements: track all public functions, including stable ones
The go source (ast) visitor will now keep track of all public functions it
finds putting them into lists by category: deprecated, preview, stable.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 2ebd4bc1d5 implements: ignore some C package calls that are just noise
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 18a134b535 implements: gather more per-api-function stats into a struct
Do more than collect names, because we're going to need more information
to feed to the eventual check tool.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 12e7178bc0 implements: teach the implements tool to detect deprecated/preview funcs
Teach the implements tool how to detect functions marked deprecated and
marked preview in the go-ceph codebase. Especially helpful will be the
JSON output which can, in the future, be added to a tool-chain that
helps track when deprecated functions are to be removed and when preview
functions should become stable.

Note that this change ONLY implements the detection of
preview/deprecated based on the doc comments.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan f015cc36ca rbd: clearly mark Set as deprecated
Use the notation described in the new API stability doc.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 7f74708d5b rbd: clearly mark open function as deprecated
Use the notation described in the new API stability doc.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
Rakshith R 126d6f5747 rbd admin: add rbd task [list|cancel|remove|trash remove|flatten]` apis
These functions let one add various rbd tasks that are done
asynchronously in the background. Also added tests for the same.

Signed-off-by: Rakshith R <rar@redhat.com>
2021-09-28 13:13:07 +00:00
Rakshith R 890b3619db rbd admin: add type ImageSpec to work with rbd task api
ImageSpec type has been added to work with rbd task api.
It consists of optional pool & namespace and image name/id.
[pool/][namespace/]image[Name/id].
Added unit tests.

Signed-off-by: Rakshith R <rar@redhat.com>
2021-09-28 13:13:07 +00:00
Jiffin Tony Thottan 62627bf406 rgw/admin: add apis for handling UserCap
Added two apis AddUserCap() and RemoveUserCap() to add/remove the
capabilities from RGW user.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-09-27 12:23:29 +00:00
John Mulligan b425523f44 entrypoint: handle adding build tags through a function
The previous code was somewhat dependent on always having the ceph
version build tag set first. Change the code to use a function so that
constructing the build tags is no longer order dependent and relocate
the actual tag stetting if-statements to below the various function
definitions.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-22 11:42:22 +00:00
John Mulligan 8835a26c9b makefile: support NO_PREVIEW env var
Following on the previous change, the NO_PREVIEW var can be set to skip
testing with preview functions. We default to testing with preview
functions.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-22 11:42:22 +00:00
John Mulligan ee90ae5906 entrypoint: default to running tests with 'ceph_preview' build tag
As this script is the heart of our ci and we generally want to test all
of go-ceph in our ci, we default to enabling ceph_preview build tag. If
we need to test only non-preview functions one can set "NO_PREVIEW" env
var to skip setting the build tag.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-22 11:42:22 +00:00