Skip to content

Commit 25113b6

Browse files
[Refactoring] Reorganize package imports (#1347)
1 parent 266ca35 commit 25113b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+48
-1430
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- (Bugfix) Fix make manifests-crd-file command
55
- (Improvement) Allow tcp:// and ssl:// protocols in endpoints for members
6+
- (Maintenance) Reorganize package imports / move common code to separate repos
67

78
## [1.2.33](https://github.com/arangodb/kube-arangodb/tree/1.2.33) (2023-09-27)
89
- (Maintenance) Bump golang.org/x/net to v0.13.0

cmd/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949
"github.com/arangodb/kube-arangodb/pkg/api"
5050
deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
5151
"github.com/arangodb/kube-arangodb/pkg/crd"
52-
"github.com/arangodb/kube-arangodb/pkg/deployment/agency/cache"
52+
agencyConfig "github.com/arangodb/kube-arangodb/pkg/deployment/agency/config"
5353
"github.com/arangodb/kube-arangodb/pkg/deployment/features"
5454
"github.com/arangodb/kube-arangodb/pkg/deployment/reconcile"
5555
"github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme"
@@ -237,7 +237,7 @@ func init() {
237237
if err := features.Init(&cmdMain); err != nil {
238238
panic(err.Error())
239239
}
240-
if err := cache.Init(&cmdMain); err != nil {
240+
if err := agencyConfig.Init(&cmdMain); err != nil {
241241
panic(err.Error())
242242
}
243243
if err := reconcile.ActionsConfigGlobal.Init(&cmdMain); err != nil {

go.mod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ replace (
2424

2525
require (
2626
github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680
27+
github.com/arangodb-helper/go-helper v0.4.2
2728
github.com/arangodb/arangosync-client v0.9.0
28-
github.com/arangodb/go-driver v1.4.1
29-
github.com/arangodb/go-driver/v2 v2.0.0-20211021031401-d92dcd5a4c83
29+
github.com/arangodb/go-driver v1.6.0
30+
github.com/arangodb/go-driver/v2 v2.0.0-20230616090327-3b9171814ae4
3031
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21
3132
//github.com/arangodb/rebalancer v0.1.1
33+
//github.com/arangodb/go-agency-helper v0.3.0
3234
github.com/cenkalti/backoff v2.2.1+incompatible
3335
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9
3436
github.com/gin-gonic/gin v1.9.1
@@ -47,7 +49,7 @@ require (
4749
github.com/rs/zerolog v1.19.0
4850
github.com/spf13/cobra v1.4.0
4951
github.com/spf13/pflag v1.0.5
50-
github.com/stretchr/testify v1.8.3
52+
github.com/stretchr/testify v1.8.4
5153
golang.org/x/sync v0.1.0
5254
golang.org/x/sys v0.10.0
5355
golang.org/x/text v0.11.0

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
7272
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
7373
github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680 h1:5YCGq0gkf/sCEkDFIsMBPj59GOm5cMibGqDBH2OWWfQ=
7474
github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680/go.mod h1:xDyzBwyYzcEhsaDXtmxCNM4p5BrtuoVYYsRTuJqmCeg=
75+
github.com/arangodb-helper/go-helper v0.4.2 h1:Ekf8EtPYQdhlwtqJAEn17i7zbtuavksWamasxcyOGWQ=
76+
github.com/arangodb-helper/go-helper v0.4.2/go.mod h1:RHgEwQTFWdJ9wFDGUCgUZzaz9NLaFUskSsHgOPM5XR4=
7577
github.com/arangodb/arangosync-client v0.9.0 h1:XhY+5gGGpl9Gk8Prqmdv0SpK3HydFUXvN2CmTIKUxKI=
7678
github.com/arangodb/arangosync-client v0.9.0/go.mod h1:kU2UaOkv2AeHLAFMEo4Ug3qLbUQVKOuRtkfr6pZqmuk=
7779
github.com/arangodb/go-driver v1.2.1 h1:HREDHhDmzdIWxHmfkfTESbYUnRjESjPh4WUuXq7FZa8=
7880
github.com/arangodb/go-driver v1.2.1/go.mod h1:zdDkJJnCj8DAkfbtIjIXnsTrWIiy6VhP3Vy14p+uQeY=
79-
github.com/arangodb/go-driver/v2 v2.0.0-20211021031401-d92dcd5a4c83 h1:PCbi3alUFastUw6InBKGEXqniveJJcQuMYspubJMRS8=
80-
github.com/arangodb/go-driver/v2 v2.0.0-20211021031401-d92dcd5a4c83/go.mod h1:B8byYwvt1mDOQzpjiMuDTP5jOif/Y5dcEJtkdvPB7HY=
81+
github.com/arangodb/go-driver/v2 v2.0.0-20230616090327-3b9171814ae4 h1:LpIIPBcrbZ/mVDG2ioZN92Pbgb5HQ2Vnqj/UaQAyN4E=
82+
github.com/arangodb/go-driver/v2 v2.0.0-20230616090327-3b9171814ae4/go.mod h1:bnCd24JXOgd5rpG8uwSpHPsF6NCcH4m6rKtKh1EJ7Lo=
8183
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21 h1:+W7D5ttxi/Ygh/39vialtypE23p9KI7P0J2qtoqUV4w=
8284
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21/go.mod h1:RkPIG6JJ2pcJUoymc18NxAJGraZd+iAEVnOTDjZey/w=
8385
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g=
@@ -190,7 +192,6 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb
190192
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
191193
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
192194
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
193-
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
194195
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
195196
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
196197
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=

pkg/deployment/agency/cache.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ import (
2727

2828
"github.com/rs/zerolog"
2929

30+
agencyCache "github.com/arangodb-helper/go-helper/pkg/arangod/agency/cache"
31+
"github.com/arangodb-helper/go-helper/pkg/arangod/conn"
32+
3033
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
31-
agencyCache "github.com/arangodb/kube-arangodb/pkg/deployment/agency/cache"
3234
"github.com/arangodb/kube-arangodb/pkg/deployment/agency/state"
3335
"github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions"
3436
"github.com/arangodb/kube-arangodb/pkg/logging"
35-
"github.com/arangodb/kube-arangodb/pkg/util/arangod/conn"
3637
"github.com/arangodb/kube-arangodb/pkg/util/errors"
3738
"github.com/arangodb/kube-arangodb/pkg/util/globals"
3839
"github.com/arangodb/kube-arangodb/pkg/util/metrics"

pkg/deployment/agency/cache/interfaces.go

Lines changed: 0 additions & 43 deletions
This file was deleted.

pkg/deployment/agency/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import (
2424
"context"
2525
"net/http"
2626

27-
"github.com/arangodb/kube-arangodb/pkg/util/arangod/conn"
27+
"github.com/arangodb-helper/go-helper/pkg/arangod/conn"
28+
2829
"github.com/arangodb/kube-arangodb/pkg/util/errors"
2930
)
3031

pkg/deployment/agency/cache/config.go renamed to pkg/deployment/agency/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21-
package cache
21+
package config
2222

2323
import (
2424
"time"

pkg/deployment/agency/leader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ package agency
2323
import (
2424
"context"
2525

26-
agencyCache "github.com/arangodb/kube-arangodb/pkg/deployment/agency/cache"
27-
"github.com/arangodb/kube-arangodb/pkg/util/arangod/conn"
26+
agencyCache "github.com/arangodb-helper/go-helper/pkg/arangod/agency/cache"
27+
"github.com/arangodb-helper/go-helper/pkg/arangod/conn"
2828
)
2929

3030
func StaticLeaderDiscovery(in conn.Connection) agencyCache.LeaderDiscovery {

pkg/deployment/agency/loader.community.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
package agency
2424

25-
import agencyCache "github.com/arangodb/kube-arangodb/pkg/deployment/agency/cache"
25+
import agencyCache "github.com/arangodb-helper/go-helper/pkg/arangod/agency/cache"
2626

2727
func getLoaderBase[T interface{}]() agencyCache.StateLoader[T] {
2828
return NewSimpleStateLoader[T]()

0 commit comments

Comments
 (0)