Skip to content

Commit

Permalink
rename oc10-sql driver to owncloudsql (#2740)
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic authored Apr 12, 2022
1 parent 8b21092 commit 120c059
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/rename-oc10-share-manager-driver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: rename oc10 share manager driver

We aligned the oc10 SQL share manager driver name with all other owncloud spacific SQL drivers by renaming the package `pkg/share/manager/sql` to `pkg/share/manager/owncloudsql` and changing the name from `oc10-sql` to `owncloudsql`.

https://github.com/cs3org/reva/pull/2740
2 changes: 1 addition & 1 deletion pkg/share/manager/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import (
_ "github.com/cs3org/reva/v2/pkg/share/manager/cs3"
_ "github.com/cs3org/reva/v2/pkg/share/manager/json"
_ "github.com/cs3org/reva/v2/pkg/share/manager/memory"
_ "github.com/cs3org/reva/v2/pkg/share/manager/sql"
_ "github.com/cs3org/reva/v2/pkg/share/manager/owncloudsql"
// Add your own here
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package sql
package owncloudsql

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package sql
package owncloudsql

import (
"context"
Expand Down Expand Up @@ -49,7 +49,7 @@ const (
)

func init() {
registry.Register("oc10-sql", NewMysql)
registry.Register("owncloudsql", NewMysql)
}

type config struct {
Expand Down Expand Up @@ -112,7 +112,7 @@ func (m *mgr) Share(ctx context.Context, md *provider.ResourceInfo, g *collabora
// TODO(labkode): should not this be caught already at the gw level?
if g.Grantee.Type == provider.GranteeType_GRANTEE_TYPE_USER &&
(utils.UserEqual(g.Grantee.GetUserId(), user.Id) || utils.UserEqual(g.Grantee.GetUserId(), md.Owner)) {
return nil, errors.New("sql: owner/creator and grantee are the same")
return nil, errors.New("owncloudsql: owner/creator and grantee are the same")
}

// check if share already exists.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package sql_test
package owncloudsql_test

import (
"testing"
Expand All @@ -25,7 +25,7 @@ import (
. "github.com/onsi/gomega"
)

func TestSql(t *testing.T) {
func TestOwnCloudSQL(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Sql Suite")
RunSpecs(t, "ownCloudSQL share manager Suite")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package sql_test
package owncloudsql_test

import (
"context"
Expand All @@ -31,8 +31,8 @@ import (
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
ruser "github.com/cs3org/reva/v2/pkg/ctx"
"github.com/cs3org/reva/v2/pkg/share"
sqlmanager "github.com/cs3org/reva/v2/pkg/share/manager/sql"
mocks "github.com/cs3org/reva/v2/pkg/share/manager/sql/mocks"
sqlmanager "github.com/cs3org/reva/v2/pkg/share/manager/owncloudsql"
mocks "github.com/cs3org/reva/v2/pkg/share/manager/owncloudsql/mocks"
"google.golang.org/protobuf/types/known/fieldmaskpb"

_ "github.com/mattn/go-sqlite3"
Expand Down
File renamed without changes.

0 comments on commit 120c059

Please sign in to comment.