Merge pull request #10170 from rook/mergify/bp/release-1.9/pr-10125

build: update go-ceph version and remove ceph_preview (backport #10125)
This commit is contained in:
mergify[bot] authored and GitHub committed 2022-04-27 00:04:35 +00:00
commit d8667aca09
6 files changed
+21 -10

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
# working-directory: somedir
# Optional: golangci-lint command line arguments.
args: -E gosec --timeout=6m --build-tags ceph_preview
args: -E gosec --timeout=6m
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
+1 -2
View File
@@ -47,8 +47,7 @@ SHELL := /bin/bash
# Can be used or additional go build flags
BUILDFLAGS ?=
LDFLAGS ?=
# use the "ceph_preview" tag to consume go-ceph preview APIs, remove this once go-ceph 0.13 is out
TAGS ?= ceph_preview
TAGS ?=
# turn on more verbose build
V ?= 0
+1 -1
View File
@@ -6,7 +6,7 @@ require (
github.com/IBM/keyprotect-go-client v0.7.0
github.com/aws/aws-sdk-go v1.40.21
github.com/banzaicloud/k8s-objectmatcher v1.1.0
github.com/ceph/go-ceph v0.12.0
github.com/ceph/go-ceph v0.15.0
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
github.com/go-ini/ini v1.51.1
github.com/google/go-cmp v0.5.6
+2 -2
View File
@@ -250,8 +250,8 @@ github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1P
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/centrify/cloud-golang-sdk v0.0.0-20190214225812-119110094d0f/go.mod h1:C0rtzmGXgN78pYR0tGJFhtHgkbAs0lIbHwkB81VxDQE=
github.com/centrify/cloud-golang-sdk v0.0.0-20210923165758-a8c48d049166 h1:jQ93fKqb/wRmK/KiHpa7Tk9rmHeKXhp4j+5Sg/tENiY=
github.com/ceph/go-ceph v0.12.0 h1:nlFgKQZXOFR4oMnzXsKwTr79Y6EYDwqTrpigICGy/Tw=
github.com/ceph/go-ceph v0.12.0/go.mod h1:mafFpf5Vg8Ai8Bd+FAMvKBHLmtdpTXdRP/TNq8XWegY=
github.com/ceph/go-ceph v0.15.0 h1:ILB3NaLWOtt4u/2d8I8HZTC4Ycm1PsOYVar3IFU1xlo=
github.com/ceph/go-ceph v0.15.0/go.mod h1:mafFpf5Vg8Ai8Bd+FAMvKBHLmtdpTXdRP/TNq8XWegY=
github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
+3 -1
View File
@@ -346,6 +346,9 @@ func (r *ReconcileObjectStoreUser) createorUpdateCephUser(u *cephv1.CephObjectSt
}
// Set access and secret key
if r.userConfig.Keys == nil {
r.userConfig.Keys = make([]admin.UserKeySpec, 1)
}
r.userConfig.Keys[0].AccessKey = user.Keys[0].AccessKey
r.userConfig.Keys[0].SecretKey = user.Keys[0].SecretKey
logger.Info(logCreateOrUpdate)
@@ -393,7 +396,6 @@ func generateUserConfig(user *cephv1.CephObjectStoreUser) admin.User {
userConfig := admin.User{
ID: user.Name,
DisplayName: displayName,
Keys: make([]admin.UserKeySpec, 1),
}
defaultMaxBuckets := 1000
@@ -290,8 +290,9 @@ func TestCephObjectStoreUserController(t *testing.T) {
newMultisiteAdminOpsCtxFunc = func(objContext *cephobject.Context, spec *cephv1.ObjectStoreSpec) (*cephobject.AdminOpsContext, error) {
mockClient := &cephobject.MockClient{
MockDo: func(req *http.Request) (*http.Response, error) {
if (req.URL.RawQuery == "display-name=my-user&format=json&max-buckets=1000&uid=my-user" && (req.Method == http.MethodGet || req.Method == http.MethodPost) && req.URL.Path == "rook-ceph-rgw-my-store.mycluster.svc/admin/user") ||
(req.URL.RawQuery == "enabled=false&format=json&max-objects=-1&max-size=-1&quota=&quota-type=user&uid=my-user" && req.Method == http.MethodPut && req.URL.Path == "rook-ceph-rgw-my-store.mycluster.svc/admin/user") {
if (req.URL.RawQuery == "display-name=my-user&format=json&max-buckets=1000&uid=my-user" && req.Method == http.MethodPost && req.URL.Path == "rook-ceph-rgw-my-store.mycluster.svc/admin/user") ||
(req.URL.RawQuery == "enabled=false&format=json&max-objects=-1&max-size=-1&quota=&quota-type=user&uid=my-user" && req.Method == http.MethodPut && req.URL.Path == "rook-ceph-rgw-my-store.mycluster.svc/admin/user") ||
(req.URL.RawQuery == "format=json&uid=my-user" && req.Method == http.MethodGet && req.URL.Path == "rook-ceph-rgw-my-store.mycluster.svc/admin/user") {
return &http.Response{
StatusCode: 200,
Body: ioutil.NopCloser(bytes.NewReader([]byte(userCreateJSON))),
@@ -361,7 +362,16 @@ func TestCreateorUpdateCephUser(t *testing.T) {
return nil, fmt.Errorf("unexpected url path %q", req.URL.Path)
}
if req.Method == http.MethodGet || req.Method == http.MethodPost {
if req.Method == http.MethodGet {
if req.URL.RawQuery == "format=json&uid=my-user" {
return &http.Response{
StatusCode: 200,
Body: ioutil.NopCloser(bytes.NewReader([]byte(userCreateJSON))),
}, nil
}
}
if req.Method == http.MethodPost {
if req.URL.RawQuery == "display-name=my-user&format=json&max-buckets=1000&uid=my-user" ||
req.URL.RawQuery == "display-name=my-user&format=json&max-buckets=200&uid=my-user" ||
req.URL.RawQuery == "display-name=my-user&format=json&max-buckets=1000&uid=my-user&user-caps=users%3Dread%3Bbuckets%3Dread%3B" ||