Skip to content

Commit fa595ff

Browse files
authored
Update module and import path for v2 (FoundationDB#2224)
* Update module and import path for v2
1 parent 4938468 commit fa595ff

File tree

206 files changed

+460
-420
lines changed

Some content is hidden

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

206 files changed

+460
-420
lines changed

api/v1beta2/foundationdbcluster_types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ type MaintenanceModeOptions struct {
12231223

12241224
// ResetMaintenanceMode defines whether the operator should reset the maintenance mode if all storage processes
12251225
// under the maintenance zone have been restarted. The default is false. For more details see:
1226-
// https://github.com/FoundationDB/fdb-kubernetes-operator/blob/improve-maintenance-mode-integration/docs/manual/operations.md#maintenance
1226+
// https://github.com/FoundationDB/fdb-kubernetes-operator/v2/blob/improve-maintenance-mode-integration/docs/manual/operations.md#maintenance
12271227
// Default is false.
12281228
ResetMaintenanceMode *bool `json:"resetMaintenanceMode,omitempty"`
12291229

@@ -2971,15 +2971,15 @@ func (cluster *FoundationDBCluster) GetCurrentProcessGroupsAndProcessCounts() (m
29712971
// GetNextRandomProcessGroupID will return a randomly picked ProcessGroupID, the ID number will be between 1 and maxProcessGroupIDNum.
29722972
// This method makes sure that the returned ProcessGroupID is not in use and not marked to be removed.
29732973
// Using a randomized ProcessGroupID will reduce the risk of reusing the same ProcessGroupID for different process groups, see:
2974-
// https://github.com/FoundationDB/fdb-kubernetes-operator/issues/2071
2974+
// https://github.com/FoundationDB/fdb-kubernetes-operator/v2/issues/2071
29752975
func (cluster *FoundationDBCluster) GetNextRandomProcessGroupID(processClass ProcessClass, processGroupIDs map[int]bool) ProcessGroupID {
29762976
return cluster.GetNextRandomProcessGroupIDWithExclusions(processClass, processGroupIDs, nil)
29772977
}
29782978

29792979
// GetNextRandomProcessGroupIDWithExclusions will return a randomly picked ProcessGroupID, the ID number will be between 1 and MaxProcessGroupIDNum.
29802980
// This method makes sure that the returned ProcessGroupID is not in use and not marked to be removed and is not excluded.
29812981
// Using a randomized ProcessGroupID will reduce the risk of reusing the same ProcessGroupID for different process groups, see:
2982-
// https://github.com/FoundationDB/fdb-kubernetes-operator/issues/2071
2982+
// https://github.com/FoundationDB/fdb-kubernetes-operator/v2/issues/2071
29832983
func (cluster *FoundationDBCluster) GetNextRandomProcessGroupIDWithExclusions(processClass ProcessClass, processGroupIDs map[int]bool, exclusions map[ProcessGroupID]None) ProcessGroupID {
29842984
var processGroupID ProcessGroupID
29852985
for {
@@ -3012,7 +3012,7 @@ func (cluster *FoundationDBCluster) newProcessGroupIDAllowed(processGroupID Proc
30123012
}
30133013

30143014
// If the randomly picked process group is part of the locality based exclusions, we shouldn't pick it.
3015-
// See: https://github.com/FoundationDB/fdb-kubernetes-operator/issues/1862
3015+
// See: https://github.com/FoundationDB/fdb-kubernetes-operator/v2/issues/1862
30163016
if _, ok := exclusions[processGroupID]; ok {
30173017
return false
30183018
}

controllers/add_pods.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"context"
2525
"fmt"
2626

27-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
28-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
27+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2929
"github.com/go-logr/logr"
3030
corev1 "k8s.io/api/core/v1"
3131
k8serrors "k8s.io/apimachinery/pkg/api/errors"

controllers/add_pods_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ package controllers
2222

2323
import (
2424
"context"
25-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
26-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
25+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
26+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2727
. "github.com/onsi/ginkgo/v2"
2828
. "github.com/onsi/gomega"
2929
corev1 "k8s.io/api/core/v1"

controllers/add_process_groups.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
corev1 "k8s.io/api/core/v1"
3131

32-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
32+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3333
)
3434

3535
// addProcessGroups provides a reconciliation step for adding new pods to a cluster.

controllers/add_process_groups_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"context"
2525
"fmt"
2626

27-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
28-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
29-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient/mock"
27+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
29+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient/mock"
3030
. "github.com/onsi/ginkgo/v2"
3131
. "github.com/onsi/gomega"
3232
"k8s.io/utils/pointer"

controllers/add_pvcs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525

2626
"github.com/go-logr/logr"
2727

28-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2929

30-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
30+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3131
corev1 "k8s.io/api/core/v1"
3232
k8serrors "k8s.io/apimachinery/pkg/api/errors"
3333
"sigs.k8s.io/controller-runtime/pkg/client"

controllers/add_pvcs_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"context"
2525
"sort"
2626

27-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
27+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2828

29-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
29+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3030
. "github.com/onsi/ginkgo/v2"
3131
. "github.com/onsi/gomega"
3232
corev1 "k8s.io/api/core/v1"

controllers/add_services.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ package controllers
2222

2323
import (
2424
"context"
25-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
25+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2626
"github.com/go-logr/logr"
2727

2828
"k8s.io/apimachinery/pkg/api/equality"
2929
k8serrors "k8s.io/apimachinery/pkg/api/errors"
3030
"sigs.k8s.io/controller-runtime/pkg/client"
3131

32-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
32+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3333
corev1 "k8s.io/api/core/v1"
3434
)
3535

controllers/add_services_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626

2727
"k8s.io/utils/pointer"
2828

29-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
29+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
3030

31-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
31+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3232
. "github.com/onsi/ginkgo/v2"
3333
. "github.com/onsi/gomega"
3434
corev1 "k8s.io/api/core/v1"

controllers/admin_client_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525
"fmt"
2626
"net"
2727

28-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
29-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
30-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient/mock"
28+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
29+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
30+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient/mock"
3131
. "github.com/onsi/ginkgo/v2"
3232
. "github.com/onsi/gomega"
3333
"k8s.io/utils/pointer"

controllers/backup_controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ import (
2525

2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727

28-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient"
2929

3030
"sigs.k8s.io/controller-runtime/pkg/controller"
3131
"sigs.k8s.io/controller-runtime/pkg/predicate"
3232

33-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
33+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3434
"github.com/go-logr/logr"
3535
appsv1 "k8s.io/api/apps/v1"
3636
k8serrors "k8s.io/apimachinery/pkg/api/errors"

controllers/backup_controller_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ package controllers
2222

2323
import (
2424
"fmt"
25-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient/mock"
25+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient/mock"
2626

27-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
27+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2828

2929
. "github.com/onsi/ginkgo/v2"
3030
. "github.com/onsi/gomega"
3131

3232
"context"
3333

34-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
34+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3535
appsv1 "k8s.io/api/apps/v1"
3636
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3737
"k8s.io/apimachinery/pkg/types"

controllers/bounce_processes.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ import (
2525
"fmt"
2626
"time"
2727

28-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbstatus"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbstatus"
2929

30-
"github.com/FoundationDB/fdb-kubernetes-operator/internal/buggify"
30+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/buggify"
3131

32-
"github.com/FoundationDB/fdb-kubernetes-operator/internal/restarts"
32+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/restarts"
3333

34-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
35-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient"
34+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
35+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient"
3636
"github.com/go-logr/logr"
3737
corev1 "k8s.io/api/core/v1"
3838
"k8s.io/utils/pointer"
@@ -52,7 +52,9 @@ func (c bounceProcesses) reconcile(_ context.Context, r *FoundationDBClusterReco
5252
if err != nil {
5353
return &requeue{curError: err}
5454
}
55-
defer adminClient.Close()
55+
defer func() {
56+
_ = adminClient.Close()
57+
}()
5658

5759
// If the status is not cached, we have to fetch it.
5860
if status == nil {

controllers/bounce_processes_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ import (
2525
"fmt"
2626
"time"
2727

28-
"github.com/FoundationDB/fdb-kubernetes-operator/internal/buggify"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/buggify"
2929

30-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient/mock"
30+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient/mock"
3131
"k8s.io/utils/pointer"
3232

33-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
33+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
3434
. "github.com/onsi/ginkgo/v2"
3535
. "github.com/onsi/gomega"
3636

37-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
37+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3838
)
3939

4040
var _ = Describe("bounceProcesses", func() {

controllers/change_coordinators.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ package controllers
2222

2323
import (
2424
"context"
25-
"github.com/FoundationDB/fdb-kubernetes-operator/internal/coordinator"
26-
"github.com/FoundationDB/fdb-kubernetes-operator/internal/locality"
25+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/coordinator"
26+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/locality"
2727
"github.com/go-logr/logr"
2828

2929
corev1 "k8s.io/api/core/v1"
3030

31-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
31+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3232
)
3333

3434
// changeCoordinators provides a reconciliation step for choosing new
@@ -45,7 +45,9 @@ func (c changeCoordinators) reconcile(ctx context.Context, r *FoundationDBCluste
4545
if err != nil {
4646
return &requeue{curError: err, delayedRequeue: true}
4747
}
48-
defer adminClient.Close()
48+
defer func() {
49+
_ = adminClient.Close()
50+
}()
4951

5052
// If the status is not cached, we have to fetch it.
5153
if status == nil {

controllers/change_coordinators_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525
"k8s.io/utils/pointer"
2626
"math"
2727

28-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
29-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
30-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient/mock"
28+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
29+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
30+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient/mock"
3131
. "github.com/onsi/ginkgo/v2"
3232
. "github.com/onsi/gomega"
3333
corev1 "k8s.io/api/core/v1"

controllers/check_client_compatibility.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
corev1 "k8s.io/api/core/v1"
3232

33-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
33+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3434
)
3535

3636
// checkClientCompatibility confirms that all clients are compatible with the
@@ -69,7 +69,9 @@ func (c checkClientCompatibility) reconcile(_ context.Context, r *FoundationDBCl
6969
if err != nil {
7070
return &requeue{curError: err}
7171
}
72-
defer adminClient.Close()
72+
defer func() {
73+
_ = adminClient.Close()
74+
}()
7375

7476
// If the status is not cached, we have to fetch it.
7577
if status == nil {

controllers/check_client_compatibility_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
package controllers
2222

2323
import (
24-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
24+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
2525
. "github.com/onsi/ginkgo/v2"
2626
. "github.com/onsi/gomega"
2727
"net"

controllers/choose_removals.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import (
2626

2727
"github.com/go-logr/logr"
2828

29-
"github.com/FoundationDB/fdb-kubernetes-operator/internal/locality"
29+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/locality"
3030

3131
corev1 "k8s.io/api/core/v1"
3232

33-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
33+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3434
)
3535

3636
// chooseRemovals chooses which processes will be removed during a shrink.
@@ -60,7 +60,9 @@ func (c chooseRemovals) reconcile(ctx context.Context, r *FoundationDBClusterRec
6060
if err != nil {
6161
return &requeue{curError: err, delayedRequeue: true}
6262
}
63-
defer adminClient.Close()
63+
defer func() {
64+
_ = adminClient.Close()
65+
}()
6466

6567
status, err = adminClient.GetStatus()
6668
if err != nil {

controllers/choose_removals_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ package controllers
2323
import (
2424
"context"
2525

26-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient/mock"
26+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient/mock"
2727

28-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
28+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
2929

30-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
30+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3131
. "github.com/onsi/ginkgo/v2"
3232
. "github.com/onsi/gomega"
3333
)

controllers/cluster_controller.go

+11-7
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ import (
3737
"sigs.k8s.io/controller-runtime/pkg/source"
3838
"time"
3939

40-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/fdbadminclient"
41-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/podmanager"
40+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/fdbadminclient"
41+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/podmanager"
4242
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4343

4444
"sigs.k8s.io/controller-runtime/pkg/controller"
4545

46-
"github.com/FoundationDB/fdb-kubernetes-operator/internal"
46+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/internal"
4747
"sigs.k8s.io/controller-runtime/pkg/predicate"
4848
sigyaml "sigs.k8s.io/yaml"
4949

50-
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2"
51-
"github.com/FoundationDB/fdb-kubernetes-operator/pkg/podclient"
50+
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
51+
"github.com/FoundationDB/fdb-kubernetes-operator/v2/pkg/podclient"
5252
"github.com/go-logr/logr"
5353
corev1 "k8s.io/api/core/v1"
5454
k8serrors "k8s.io/apimachinery/pkg/api/errors"
@@ -147,7 +147,9 @@ func (r *FoundationDBClusterReconciler) Reconcile(ctx context.Context, request c
147147
if err != nil {
148148
return ctrl.Result{}, err
149149
}
150-
defer adminClient.Close()
150+
defer func() {
151+
_ = adminClient.Close()
152+
}()
151153

152154
err = cluster.Validate()
153155
if err != nil {
@@ -581,7 +583,9 @@ func (r *FoundationDBClusterReconciler) getStatusFromClusterOrDummyStatus(logger
581583
if err != nil {
582584
return nil, err
583585
}
584-
defer adminClient.Close()
586+
defer func() {
587+
_ = adminClient.Close()
588+
}()
585589

586590
// If the cluster is not yet configured, we can reduce the timeout to make sure the initial reconcile steps
587591
// are faster.

0 commit comments

Comments
 (0)