File tree 17 files changed +39
-30
lines changed
controller/postgrescluster
17 files changed +39
-30
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ linters:
16
16
linters-settings :
17
17
exhaustive :
18
18
default-signifies-exhaustive : true
19
+ goimports :
20
+ local-prefixes : github.com/crunchydata/postgres-operator
19
21
gomodguard :
20
22
blocked :
21
23
modules :
Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ import (
24
24
"testing"
25
25
"time"
26
26
27
- "github.com/crunchydata/postgres-operator/internal/initialize"
28
- "github.com/crunchydata/postgres-operator/internal/naming"
29
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
30
27
"github.com/pkg/errors"
31
28
"go.opentelemetry.io/otel"
32
29
"gotest.tools/v3/assert"
@@ -43,6 +40,10 @@ import (
43
40
"sigs.k8s.io/controller-runtime/pkg/client"
44
41
"sigs.k8s.io/controller-runtime/pkg/manager"
45
42
"sigs.k8s.io/controller-runtime/pkg/reconcile"
43
+
44
+ "github.com/crunchydata/postgres-operator/internal/initialize"
45
+ "github.com/crunchydata/postgres-operator/internal/naming"
46
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
46
47
)
47
48
48
49
var gvks = []schema.GroupVersionKind {{
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import (
22
22
23
23
"go.opentelemetry.io/otel"
24
24
"gotest.tools/v3/assert"
25
-
26
25
appsv1 "k8s.io/api/apps/v1"
27
26
corev1 "k8s.io/api/core/v1"
28
27
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ import (
20
20
"fmt"
21
21
"io"
22
22
23
+ "github.com/pkg/errors"
24
+ corev1 "k8s.io/api/core/v1"
25
+ "k8s.io/apimachinery/pkg/api/resource"
26
+ "sigs.k8s.io/controller-runtime/pkg/client"
27
+
23
28
"github.com/crunchydata/postgres-operator/internal/config"
24
29
"github.com/crunchydata/postgres-operator/internal/initialize"
25
30
"github.com/crunchydata/postgres-operator/internal/logging"
@@ -29,10 +34,6 @@ import (
29
34
pgpassword "github.com/crunchydata/postgres-operator/internal/postgres/password"
30
35
"github.com/crunchydata/postgres-operator/internal/util"
31
36
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
32
- "github.com/pkg/errors"
33
- corev1 "k8s.io/api/core/v1"
34
- "k8s.io/apimachinery/pkg/api/resource"
35
- "sigs.k8s.io/controller-runtime/pkg/client"
36
37
)
37
38
38
39
const (
Original file line number Diff line number Diff line change @@ -26,10 +26,6 @@ import (
26
26
"strings"
27
27
"testing"
28
28
29
- "github.com/crunchydata/postgres-operator/internal/initialize"
30
- "github.com/crunchydata/postgres-operator/internal/naming"
31
- "github.com/crunchydata/postgres-operator/internal/pgmonitor"
32
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
33
29
"go.opentelemetry.io/otel"
34
30
"gotest.tools/v3/assert"
35
31
appsv1 "k8s.io/api/apps/v1"
@@ -40,6 +36,11 @@ import (
40
36
"k8s.io/apimachinery/pkg/types"
41
37
"sigs.k8s.io/controller-runtime/pkg/client"
42
38
"sigs.k8s.io/controller-runtime/pkg/manager"
39
+
40
+ "github.com/crunchydata/postgres-operator/internal/initialize"
41
+ "github.com/crunchydata/postgres-operator/internal/naming"
42
+ "github.com/crunchydata/postgres-operator/internal/pgmonitor"
43
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
43
44
)
44
45
45
46
func TestAddPGMonitorExporterToInstancePodSpec (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -27,14 +27,13 @@ import (
27
27
"time"
28
28
29
29
"github.com/pkg/errors"
30
- apierrors "k8s.io/apimachinery/pkg/api/errors"
31
- "k8s.io/apimachinery/pkg/util/wait"
32
-
33
30
"gotest.tools/v3/assert"
34
31
appsv1 "k8s.io/api/apps/v1"
35
32
corev1 "k8s.io/api/core/v1"
33
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
36
34
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
37
35
"k8s.io/apimachinery/pkg/types"
36
+ "k8s.io/apimachinery/pkg/util/wait"
38
37
"sigs.k8s.io/controller-runtime/pkg/client"
39
38
40
39
"github.com/crunchydata/postgres-operator/internal/naming"
Original file line number Diff line number Diff line change @@ -28,16 +28,16 @@ import (
28
28
"k8s.io/apimachinery/pkg/util/version"
29
29
"k8s.io/client-go/discovery"
30
30
"k8s.io/client-go/kubernetes/scheme"
31
+
32
+ // Google Kubernetes Engine / Google Cloud Platform authentication provider
33
+ _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
31
34
"k8s.io/client-go/rest"
32
35
"sigs.k8s.io/controller-runtime/pkg/client"
33
36
"sigs.k8s.io/controller-runtime/pkg/envtest"
34
37
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
35
38
"sigs.k8s.io/controller-runtime/pkg/log"
36
39
"sigs.k8s.io/controller-runtime/pkg/manager"
37
40
38
- // Google Kubernetes Engine / Google Cloud Platform authentication provider
39
- _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
40
-
41
41
"github.com/crunchydata/postgres-operator/internal/logging"
42
42
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
43
43
)
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import (
25
25
26
26
// Google Kubernetes Engine / Google Cloud Platform authentication provider
27
27
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
28
-
29
28
"sigs.k8s.io/controller-runtime/pkg/client"
30
29
"sigs.k8s.io/controller-runtime/pkg/envtest"
31
30
"sigs.k8s.io/yaml"
Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ import (
19
19
"strings"
20
20
"testing"
21
21
22
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
23
22
"gotest.tools/v3/assert"
23
+
24
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
24
25
)
25
26
26
27
func isUniqueAndSorted (slice []string ) bool {
Original file line number Diff line number Diff line change @@ -19,13 +19,14 @@ import (
19
19
"fmt"
20
20
"testing"
21
21
22
- "github.com/crunchydata/postgres-operator/internal/naming"
23
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
24
22
"gotest.tools/v3/assert"
25
23
corev1 "k8s.io/api/core/v1"
26
24
"k8s.io/apimachinery/pkg/api/equality"
27
25
"k8s.io/apimachinery/pkg/api/resource"
28
26
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27
+
28
+ "github.com/crunchydata/postgres-operator/internal/naming"
29
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
29
30
)
30
31
31
32
func TestAddRepoVolumesToPod (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -22,13 +22,14 @@ import (
22
22
"crypto/rand"
23
23
"fmt"
24
24
25
+ "golang.org/x/crypto/ssh"
26
+ corev1 "k8s.io/api/core/v1"
27
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28
+
25
29
"github.com/crunchydata/postgres-operator/internal/initialize"
26
30
"github.com/crunchydata/postgres-operator/internal/naming"
27
31
"github.com/crunchydata/postgres-operator/internal/pki"
28
32
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
29
- "golang.org/x/crypto/ssh"
30
- corev1 "k8s.io/api/core/v1"
31
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32
33
)
33
34
34
35
const (
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import (
22
22
"crypto/x509"
23
23
"encoding/pem"
24
24
"fmt"
25
-
26
25
"reflect"
27
26
"strings"
28
27
"testing"
Original file line number Diff line number Diff line change @@ -20,9 +20,10 @@ import (
20
20
"hash/fnv"
21
21
"io"
22
22
23
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
24
23
"github.com/pkg/errors"
25
24
"k8s.io/apimachinery/pkg/util/rand"
25
+
26
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
26
27
)
27
28
28
29
// maxPGBackrestRepos is the maximum number of repositories that can be configured according to the
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ import (
21
21
"strconv"
22
22
"testing"
23
23
24
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
25
24
"gotest.tools/v3/assert"
26
25
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26
+
27
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
27
28
)
28
29
29
30
func TestCalculateConfigHashes (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ import (
19
19
"strings"
20
20
"testing"
21
21
22
+ "gotest.tools/v3/assert"
23
+
22
24
"github.com/crunchydata/postgres-operator/internal/postgres"
23
25
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
24
- "gotest.tools/v3/assert"
25
26
)
26
27
27
28
func TestPostgreSQLHBA (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ package pgmonitor
18
18
import (
19
19
"testing"
20
20
21
- "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
22
21
"gotest.tools/v3/assert"
22
+
23
+ "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
23
24
)
24
25
25
26
func TestExporterEnabled (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ package password
16
16
*/
17
17
18
18
import (
19
+
19
20
// #nosec G501
20
21
"crypto/md5"
21
22
"errors"
You can’t perform that action at this time.
0 commit comments