Commit Graph

273 Commits

Author SHA1 Message Date
John Mulligan ef655aa904 makefile: support using other container runtimes
Add new variables to the Makefile that allow the use of other container
runtimes (that have a docker compatible cli) and allow setting extra
opts to work on platforms that don't run apparmor.
All defaults continue to be the same as before.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-11-01 14:35:28 -04:00
CodeLingo Bot 9e2fbe369f Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-03-06 03:14:57 +00:00
Noah Watkins e32f9f0f2e
Merge pull request #81 from MalloZup/golint
Enable golint in travis and Makefile
2018-12-17 14:15:54 -08:00
dmaiocchi 157d0c73b3 Enable golint in travis and Makefile 2018-12-11 23:38:36 +01:00
Noah Watkins b8f75ed68d
Merge pull request #80 from ZYecho/fix-func-depred
bugfix: fix rados_read_op_omap_get_vals deprecated
2018-12-03 12:21:57 -08:00
zhangyue 7884e8a8af bugfix: fix function deprecated rados_read_op_omap_get_vals
Signed-off-by: zhangyue <zy675793960@yeah.net>
2018-12-02 11:04:21 +08:00
Noah Watkins e1762cd8b3
Merge pull request #74 from mergetb/cephfs-add-rmdir
cephfs: add unmount, release, chmod, chown, etc
2018-10-11 14:59:13 -07:00
Lincoln Thurlow 5a74b46a87 cephfs: modified guard clauses + golint'd 2018-10-11 11:36:26 -07:00
Lincoln Thurlow ecf9a99249 cephfs: add unmount, release, chmod, chown, etc
This commit adds the following cephfs functions:

* Unmount // Unmounting is necessary to cleanup mounts
* Release // Release destroys the cmount ~ end of transaction
* RemoveDir // inverse of MakeDir
* Chown // change ownership of file or directory
* Chmod // change permissions of file or directory

Tests are included for each function.

In addition to these changes modifications to:

.travis.yml, Dockerfile, and Makefile

were made to accomodate tests to mount the ceph volume.  Tests use
fuse to mount the volume which requires adding:

--device /dev/fuse --cap-add SYS_ADMIN --security-opt \
apparmor:unconfined

to the docker container (alternatively --privileged works but adds
additional permissions).

Changes to README add the above docker changes as well as point
users to the necessary ceph development libraries.
2018-10-11 11:09:16 -07:00
Lincoln Thurlow f3df337fab cephfs: add cephfs commands, expand logging
* CephError uses syscall for string version of error
* Add error logging for every function
* Add RemoveDir() function
* Add Unmount() function
* Add Release() function
* Add Chown() function
* Add Chmod() function
2018-10-11 11:09:16 -07:00
Noah Watkins 768c5507d1
Merge pull request #73 from mergetb/cephfs-fix-docker
go-ceph: add cephfs to docker

fixes: #35
2018-10-09 21:20:50 -07:00
Lincoln Thurlow b7c7659ec4 go-ceph: add cephfs to docker
* Adds metadata server (mds) for cephfs to Dockerfile
* Enables cephfs tests
2018-10-09 20:56:52 -07:00
Noah Watkins 21c4240aa3
Merge pull request #69 from MalloZup/Nitpick
Use Guardclause for function
2018-10-09 10:24:23 -07:00
Dario Maiocchi caf0f7ed68 Use Guardclause for function 2018-10-09 10:22:02 +02:00
Noah Watkins 92d7415a65
Merge pull request #71 from MalloZup/examplego
Make example more golang
2018-10-07 07:23:36 -07:00
dmaiocchi f34b1cc12a Make example more golang 2018-10-07 09:36:09 +02:00
Noah Watkins 336289075e
Merge pull request #68 from dswarbrick/code-cleanups
Code cleanups
2018-09-18 08:55:02 -07:00
Daniel Swarbrick 951118e855
Drop unnecessary typecasts
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2018-09-18 11:12:32 +02:00
Daniel Swarbrick 3023eb281d
Go style cleanups
- Use C errno constants in place of hardcoded ints
- Use type inference where possible (especially C.CString
- Don't explicitly specify zero values where value would be default anway
- Rewrap some unnecessarily wrapped short lines
- Use if/else one-liners where value is not needed afterwards

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2018-09-18 11:03:41 +02:00
Noah Watkins c521b5aa72
Merge pull request #67 from ceph/ci-go-fmt
Ci go fmt
2018-09-17 16:06:29 -07:00
Noah Watkins 208695a8c1 fmt: apply gofmt updates
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-09-17 15:57:31 -07:00
Noah Watkins 6107372c34 ci: check go formatting
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-09-17 15:41:24 -07:00
Noah Watkins fd4036e498
Merge pull request #66 from dswarbrick/trash-wrappers
Implement wrappers around rbd_trash_* functions
2018-09-17 15:28:21 -07:00
Daniel Swarbrick bdc1c100fe
Force trash remove to override deferment time
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2018-09-17 23:33:23 +02:00
Daniel Swarbrick 837181cb94
Add unit test for rbd_trash functionality
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2018-09-17 23:07:18 +02:00
Daniel Swarbrick 4a88b5da12
Implement wrappers around rbd_trash_* functions
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2018-09-17 20:46:23 +02:00
Noah Watkins 28db807c97
Merge pull request #65 from ceph/connected-state
Connected state
2018-09-14 15:10:35 -07:00
Noah Watkins 4e815e9872
Merge pull request #64 from dswarbrick/feature-consts
Convert RBD feature flags to constants with iota
2018-09-14 15:10:05 -07:00
Daniel Swarbrick 9d12f2ecd1
Merge branch 'master' into feature-consts 2018-09-14 23:53:47 +02:00
Daniel Swarbrick 1623e77d20
Wrap feature macros from rbd/features.h 2018-09-14 23:52:24 +02:00
Noah Watkins fe9a93bb73 rados: migrate remaining tests to suite interface
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-09-14 14:35:45 -07:00
Noah Watkins 818e026b20 rados: grab all namespace prefix from C header
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-09-14 14:34:51 -07:00
Noah Watkins 5074481957 fmt: fix formatting
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-09-14 14:34:33 -07:00
Daniel Swarbrick 3a8c38ca41 Add RBD feature flag sets as per Python rbd module 2018-09-14 16:59:08 +02:00
Noah Watkins 92db4f867c
Merge pull request #63 from dswarbrick/fix-snapshot-unopened-parent
Check that parent image is open before attempting snapshot operations
2018-09-14 07:55:28 -07:00
Daniel Swarbrick 340e124452 Convert RBD feature flags to constants with iota 2018-09-14 16:38:01 +02:00
Daniel Swarbrick df4109f4b7 Check that parent image has been opened before attempting snapshot operations 2018-09-14 16:02:11 +02:00
Noah Watkins a1c3394414 test: convert more tests to use suite
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-22 10:58:45 -07:00
Noah Watkins fad63ff1f9 test: convert more tests to use suite
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-17 11:51:36 -07:00
Noah Watkins 7b5a27ca9a rados: refactor tests to use testing suite
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-09 07:34:43 -07:00
Noah Watkins 3dd9a8e5d4 ci: build and run tests with luminous/mimic
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-09 07:34:43 -07:00
Noah Watkins 96b41ea93e ci: change mon id in micro-osd script
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-07 18:48:28 -07:00
Noah Watkins b389ed391c ci: update golang in ci
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-07 18:48:28 -07:00
Noah Watkins 6363bf77ae rados: use test suite to share code
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-07 18:48:17 -07:00
Noah Watkins 0a30725b59 ioctx: do not short-circuit read for empty slice
ioctx.read should contact the cluster even when its slice is empty so
that errors like ENOENT can be reported.

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-08-07 18:48:17 -07:00
Noah Watkins c14a3857fa rados: add a connected flag to the conn obj
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-07-28 14:23:18 -07:00
Noah Watkins 3b687cfa99 doc: add note about vstart.sh setup
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2018-07-28 10:08:19 -07:00
Noah Watkins b2d948844f
Merge pull request #60 from ceph/ci-update
ci: update to luminous and dockerized setup
2018-07-07 13:21:27 -07:00
Noah Watkins 19a37c4565 ci: update to luminous and dockerized setup
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-07-07 13:20:41 -07:00
Noah Watkins e57e53d585
Merge pull request #31 from Vicente-Cheng/minor-fixed-rbd-go
rbd: the length of args on create_v3 should be 3 instead of 2
2018-07-07 12:26:02 -07:00