Commit Graph

1006 Commits

Author SHA1 Message Date
Sven Anderson
af5a9e9906 rados: remove unused constant
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-09-16 13:47:56 +00:00
Sven Anderson
605e31fef8 rados: remove gosimple linter warnings
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-09-16 13:47:56 +00:00
Sven Anderson
54fe45484a rados: remove errcheck linter warnings
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-09-16 13:47:56 +00:00
Sven Anderson
b7f01be284 rados: remove ineffassign linter warnings
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-09-16 13:47:56 +00:00
Sven Anderson
ff75b9c2a2 rados: add missing error asserts
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-09-14 14:14:23 +00:00
yjkim1
bb535d6df2 cephfs: add missing cephfs API components: function ceph_version
Signed-off-by: Kim young jin <oct28-yjkim@gmail.com>
2021-09-13 15:51:10 +00:00
John Mulligan
361598d4d3 revive: enable additional rules
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>
2021-09-13 15:13:53 +00:00
John Mulligan
6a9c0b243a rgw admin: import testify suite as tsuite
This avoids import shadowing elsewhere in radosgw_test.go.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
c658cc93a9 rados: import testify suite as tsuite
This avoids import shadowing elsewhere in rados_test.go.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
bf6cd07204 cephfs admin: import path package as pathpkg
This avoids import shadowing elsewhere in workflow_test.go.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
2256a73262 revive: enable var-naming rule (with exceptions)
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>
2021-09-13 15:13:53 +00:00
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
91efd1f092 rados: naming conventions: disable revive naming check on old struct
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>
2021-09-13 15:13:53 +00:00
John Mulligan
25c0699926 rados: naming conventions: disable revive naming check on old struct
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>
2021-09-13 15:13:53 +00:00
John Mulligan
572de578f6 rados: naming conventions: rename ensure_connected to ensureConnected
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
6856f9efa2 implements: naming conventions: remove underscores from c stub vars
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
c1e544b8c3 implements: naming conventions: Xml -> XML
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan
2456bf70a1 containers: update go version
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>
2021-09-02 13:53:09 +00:00
John Mulligan
ac2e61a699 makefile: add a variable for passing additional container build options
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>
2021-09-02 13:53:09 +00:00
John Mulligan
c7fb7aaa7c makefile: determine CEPH_TAG based on CEPH_VERSION
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>
2021-09-02 13:53:09 +00:00
John Mulligan
cf6de4b12d containers: use ceph/ceph as our base image
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>
2021-09-02 13:53:09 +00:00
John Mulligan
1adc3bac8b workflows: simplify ci runs using new make targets
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>
2021-08-31 17:51:58 +02:00
John Mulligan
d535ef39de cephfs: make statx test more robust
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>
2021-08-31 17:51:58 +02:00
John Mulligan
528893ce1d cephfs: clean up symlink created in TestSymlink func
Add a defer to clean up the symlink created by the test.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-31 17:51:58 +02:00
Sven Anderson
83c0acf52c docs: add a API stability document
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-25 16:51:26 +00:00
John Mulligan
cdbffdc229 makefile: expand test-multi-container into multiple test-containers-* rules
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>
2021-08-25 15:15:48 +00:00
John Mulligan
58289e2547 entrypoint: add --mirror-state option
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>
2021-08-25 15:15:48 +00:00
John Mulligan
615b122e49 rados: naming conventions: fixes in test func TestListAcrossNamespaces
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
5506545be0 rados: naming conventions: fixes in test function TestSetNamespace
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
35bcee9804 rados: naming conventions: fixes in test funcs TestObjectIterator*
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
ef031dddcf rados: naming conventions: fixes in test function TestGetPoolStats
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
a15c91d711 rados: naming conventions: fixes in test function TestCreate
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
b045c8b239 rados: naming conventions: fixes in test funcs TestGetPoolBy{Name,ID}
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
810022af7b rados: naming conventions: fixes in test function TestMakeDeletePool
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
e3196e45e0 rados: naming conventions: fixes in test function TestGetClusterStats
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
9d7d31d158 rados: naming conventions: fixes in test functions for config
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
fcdd6fd657 rados: naming conventions: fixes in TestMonCommandWithInputBuffer
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
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
John Mulligan
067924a4cf cephfs: naming conventions: fix names in cephfs permissions test
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 14:51:22 +00:00
John Mulligan
7a542b786a github: update mergify rules to handle API vs non-API PRs
This implements the policy first outlined in
https://github.com/ceph/go-ceph/discussions/549

In short: if a PR includes API changes (has the API label) then
either 2 reviews are required or 1 review plus 10 days must pass;
if a PR includes no API changes, then only 1 review is needed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-23 10:14:21 -04: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
1d2ef78c2f remove .travis.yml file
We haven't used tavis ci for more than a year. There's no reason to keep
this config yaml file around any longer.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-19 12:29:06 -04:00
parth-gr
882da262a3 cephfs: re-enabled the skipped test for cephfs
cephfs test was disabled because there was bug in ceph related to ftruncate
the ceph bug is resolved, so re-enabling the cephfs test

Closes: https://github.com/ceph/go-ceph/issues/439
Signed-off-by: parth-gr <paarora@redhat.com>
2021-08-12 18:47:26 +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