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>
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>
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>
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>
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>
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>
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>
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>
Added two apis AddUserCap() and RemoveUserCap() to add/remove the
capabilities from RGW user.
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
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>
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>
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>
This enables a bunch of rules that are fairly safe for go-ceph.
There's a lot more rules, but many of them are not as good a fit.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Revive's var-naming rule will help us avoid adding future violations
of Go's standard naming convention (camelCase, etc.).
We make exceptions for "Id" and "Uid" as they are treated more like
words than initialisms in this codebase and there are already many many
instances if "Id", etc. that need renaming or exceptions and it's just
not worth it. :-)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
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>
This struct has public fields that violate standard naming
conventions.
Disable the check on this struct only.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This struct has public fields that violate standard naming conventions.
Disable the check on this struct only.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
With the recent release of go1.17 the oldest supported go version is
1.16. Update to the newest 1.16.z and clean up the structure of
the go install process a bit.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The one I often use is "--no-cache" to force a rebuild. Adding a var to
the makefile makes it so I don't have to get too hacky with it.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
For go-ceph's purposes we prefer the series codename so we can simply
derive CEPH_TAG from CEPH_VERSION in the makefile.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
First off, ceph is no longer using docker hub for the canonical image
hosting. We have also been recommended to use ceph/ceph instead of
ceph/daemon-base. Thus we switch to 'quay.io/ceph/ceph'.
However, ceph/ceph doesn't use codenames for tags so we also have to use
version number tags. These are set as build args now. To retain
compatibility with the way we were working previously we have add a
best-effort "assertion" to ensure the code name we provide matches with
the codename embedded in the base image.
While working on this I discovered that our previous build args were
probably not working as intended, but only by accident. See:
https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
This is why we now name our build arg GO_CEPH_VERSION and it is located
after the 'FROM' line.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The new make targets allow us to share (mirror-enabled) ceph container
instances. Use this to test both non-ptrguard and prtguard test runs
while dropping the (now redundant) non-mirror-enabled ceph + tests
container run.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The TestStatxFieldsRootDir test was assuming that the nlink count
returned by statx would be exactly 2. Make the test more robust against
varying content the root dir of the volume might have by only asserting
that the nlink be 2 or more.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change adds a whole family of test-containers-* rules. The role
meant to be used directly "test-containers-test" brings up the
required dependencies once, and will reuse them on subsequent runs.
The targets "test-containers-kill" and "test-containers-clean" will
remove just the ceph containers and all dependencies respectively.
The change may look big, and I did shorten some lines, thus lengthening
the makefile vertically, but the logic is basically the same as before.
One can continue using "test-multi-container" and it should behave
pretty much as before, but outside the CI when working on code or
testing things out using the more granular rules can help speed things
up.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The --mirror-state option specifies a path to a file in which the script
will record the state of (rbd) mirroring. This can then later be reused
in order to skip the somewhat time consuming mirroring setup if the
statefile indicates mirroring is already functional.
Signed-off-by: John Mulligan <jmulligan@redhat.com>