Merge branch 'master' into bump-v2.0.2

This commit is contained in:
Felix Kunde 2026-08-20 09:05:55 +02:00 committed by GitHub
commit a378f3227b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
87 changed files with 662 additions and 530 deletions

View File

@ -10,9 +10,9 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/zalando/postgres-operator/pkg/controller" "github.com/zalando/postgres-operator/v2/pkg/controller"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
) )
var ( var (

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/zalando/postgres-operator module github.com/zalando/postgres-operator/v2
go 1.26.4 go 1.26.4

View File

@ -19,7 +19,7 @@ set -o nounset
set -o pipefail set -o pipefail
SRC="github.com" SRC="github.com"
GOPKG="$SRC/zalando/postgres-operator" GOPKG="$SRC/zalando/postgres-operator/v2"
CUSTOM_RESOURCE_NAME_ZAL="zalando.org" CUSTOM_RESOURCE_NAME_ZAL="zalando.org"
CUSTOM_RESOURCE_NAME_ACID="acid.zalan.do" CUSTOM_RESOURCE_NAME_ACID="acid.zalan.do"
CUSTOM_RESOURCE_VERSION="v1" CUSTOM_RESOURCE_VERSION="v1"

View File

@ -3,9 +3,9 @@ package v1
// Operator configuration CRD definition, please use snake_case for field names. // Operator configuration CRD definition, please use snake_case for field names.
import ( import (
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -1,7 +1,7 @@
package v1 package v1
import ( import (
acidzalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do" acidzalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -28,7 +28,7 @@ SOFTWARE.
package v1 package v1
import ( import (
config "github.com/zalando/postgres-operator/pkg/util/config" config "github.com/zalando/postgres-operator/v2/pkg/util/config"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"

View File

@ -1,7 +1,7 @@
package v1 package v1
import ( import (
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -1,7 +1,7 @@
package v1 package v1
import ( import (
"github.com/zalando/postgres-operator/pkg/apis/zalando.org" "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -12,10 +12,10 @@ import (
"time" "time"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
) )
const ( const (

View File

@ -14,20 +14,20 @@ import (
"time" "time"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
"github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
pgteams "github.com/zalando/postgres-operator/pkg/teams" pgteams "github.com/zalando/postgres-operator/v2/pkg/teams"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
"github.com/zalando/postgres-operator/pkg/util/teams" "github.com/zalando/postgres-operator/v2/pkg/util/teams"
"github.com/zalando/postgres-operator/pkg/util/users" "github.com/zalando/postgres-operator/v2/pkg/util/users"
"github.com/zalando/postgres-operator/pkg/util/volumes" "github.com/zalando/postgres-operator/v2/pkg/util/volumes"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1" batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"

View File

@ -11,15 +11,15 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake" fakeacidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
"github.com/zalando/postgres-operator/pkg/util/teams" "github.com/zalando/postgres-operator/v2/pkg/util/teams"
batchv1 "k8s.io/api/batch/v1" batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"

View File

@ -10,8 +10,8 @@ import (
"github.com/r3labs/diff" "github.com/r3labs/diff"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
acidzalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do" acidzalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -19,11 +19,11 @@ import (
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
) )
var poolerRunAsUser = int64(100) var poolerRunAsUser = int64(100)

View File

@ -7,12 +7,12 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake" fakeacidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"

View File

@ -11,10 +11,10 @@ import (
"github.com/lib/pq" "github.com/lib/pq"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
"github.com/zalando/postgres-operator/pkg/util/users" "github.com/zalando/postgres-operator/v2/pkg/util/users"
) )
const ( const (

View File

@ -11,8 +11,8 @@ import (
"k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/remotecommand" "k8s.io/client-go/tools/remotecommand"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
) )
// ExecCommand executes arbitrary command inside the pod // ExecCommand executes arbitrary command inside the pod

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/filesystems" "github.com/zalando/postgres-operator/v2/pkg/util/filesystems"
) )
func (c *Cluster) getPostgresFilesystemInfo(podName *spec.NamespacedName) (device, fstype string, err error) { func (c *Cluster) getPostgresFilesystemInfo(podName *spec.NamespacedName) (device, fstype string, err error) {

View File

@ -24,14 +24,14 @@ import (
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
) )
const ( const (

View File

@ -9,13 +9,13 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake" fakeacidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"

View File

@ -8,8 +8,8 @@ import (
"strings" "strings"
"github.com/Masterminds/semver/v3" "github.com/Masterminds/semver/v3"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"

View File

@ -13,11 +13,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
) )
func (c *Cluster) listPods() ([]v1.Pod, error) { func (c *Cluster) listPods() ([]v1.Pod, error) {

View File

@ -9,12 +9,12 @@ import (
"time" "time"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/zalando/postgres-operator/mocks" "github.com/zalando/postgres-operator/v2/mocks"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -13,9 +13,9 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
) )
const ( const (

View File

@ -8,11 +8,11 @@ import (
"sort" "sort"
"strings" "strings"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
) )

View File

@ -9,13 +9,13 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
fakezalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake" fakezalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"

View File

@ -12,11 +12,11 @@ import (
"strings" "strings"
"time" "time"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
batchv1 "k8s.io/api/batch/v1" batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1" policyv1 "k8s.io/api/policy/v1"

View File

@ -20,15 +20,15 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/zalando/postgres-operator/mocks" "github.com/zalando/postgres-operator/v2/mocks"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake" fakeacidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
"k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/fake"
) )

View File

@ -3,7 +3,7 @@ package cluster
import ( import (
"time" "time"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1" policyv1 "k8s.io/api/policy/v1"

View File

@ -20,14 +20,14 @@ import (
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
acidzalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do" acidzalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/nicediff" "github.com/zalando/postgres-operator/v2/pkg/util/nicediff"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
) )
// OAuthTokenGetter provides the method for fetching OAuth tokens // OAuthTokenGetter provides the method for fetching OAuth tokens

View File

@ -13,13 +13,13 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/zalando/postgres-operator/mocks" "github.com/zalando/postgres-operator/v2/mocks"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake" fakeacidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/patroni" "github.com/zalando/postgres-operator/v2/pkg/util/patroni"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"

View File

@ -11,11 +11,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/filesystems" "github.com/zalando/postgres-operator/v2/pkg/util/filesystems"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/volumes" "github.com/zalando/postgres-operator/v2/pkg/util/volumes"
) )
func (c *Cluster) syncVolumes() error { func (c *Cluster) syncVolumes() error {

View File

@ -14,12 +14,12 @@ import (
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/zalando/postgres-operator/mocks" "github.com/zalando/postgres-operator/v2/mocks"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/volumes" "github.com/zalando/postgres-operator/v2/pkg/util/volumes"
"k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/fake"
) )

View File

@ -11,17 +11,17 @@ import (
"time" "time"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/apiserver" "github.com/zalando/postgres-operator/v2/pkg/apiserver"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
acidv1informer "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do/v1" acidv1informer "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/teams" "github.com/zalando/postgres-operator/v2/pkg/teams"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/ringlog" "github.com/zalando/postgres-operator/v2/pkg/util/ringlog"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1" rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

View File

@ -7,10 +7,10 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
) )

View File

@ -5,13 +5,13 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
) )
func (c *Controller) nodeAdd(obj interface{}) { func (c *Controller) nodeAdd(obj interface{}) {

View File

@ -3,7 +3,7 @@ package controller
import ( import (
"testing" "testing"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -4,11 +4,11 @@ import (
"context" "context"
"fmt" "fmt"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -3,9 +3,9 @@ package controller
import ( import (
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
) )

View File

@ -17,12 +17,12 @@ import (
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/ringlog" "github.com/zalando/postgres-operator/v2/pkg/util/ringlog"
) )
func (c *Controller) clusterResync(stopCh <-chan struct{}, wg *sync.WaitGroup) { func (c *Controller) clusterResync(stopCh <-chan struct{}, wg *sync.WaitGroup) {

View File

@ -6,8 +6,8 @@ import (
"testing" "testing"
"time" "time"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -5,7 +5,7 @@ import (
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
) )
// EventType contains type of the events for the TPRs and Pods received from Kubernetes // EventType contains type of the events for the TPRs and Pods received from Kubernetes

View File

@ -10,12 +10,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/cluster" "github.com/zalando/postgres-operator/v2/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
) )

View File

@ -8,9 +8,9 @@ import (
b64 "encoding/base64" b64 "encoding/base64"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/config" "github.com/zalando/postgres-operator/v2/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/k8sutil" "github.com/zalando/postgres-operator/v2/pkg/util/k8sutil"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -28,8 +28,8 @@ import (
fmt "fmt" fmt "fmt"
http "net/http" http "net/http"
acidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/zalando.org/v1"
discovery "k8s.io/client-go/discovery" discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol" flowcontrol "k8s.io/client-go/util/flowcontrol"

View File

@ -25,11 +25,11 @@ SOFTWARE.
package fake package fake
import ( import (
clientset "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" clientset "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
acidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake" fakeacidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake"
zalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/zalando.org/v1"
fakezalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1/fake" fakezalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/zalando.org/v1/fake"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"

View File

@ -25,8 +25,8 @@ SOFTWARE.
package fake package fake
import ( import (
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -25,8 +25,8 @@ SOFTWARE.
package scheme package scheme
import ( import (
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -27,8 +27,8 @@ package v1
import ( import (
http "net/http" http "net/http"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" scheme "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
) )

View File

@ -25,7 +25,7 @@ SOFTWARE.
package fake package fake
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
) )

View File

@ -25,8 +25,8 @@ SOFTWARE.
package fake package fake
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
gentype "k8s.io/client-go/gentype" gentype "k8s.io/client-go/gentype"
) )

View File

@ -25,8 +25,8 @@ SOFTWARE.
package fake package fake
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
gentype "k8s.io/client-go/gentype" gentype "k8s.io/client-go/gentype"
) )

View File

@ -25,8 +25,8 @@ SOFTWARE.
package fake package fake
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
gentype "k8s.io/client-go/gentype" gentype "k8s.io/client-go/gentype"
) )

View File

@ -27,8 +27,8 @@ package v1
import ( import (
context "context" context "context"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" scheme "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"

View File

@ -27,8 +27,8 @@ package v1
import ( import (
context "context" context "context"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" scheme "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"

View File

@ -27,8 +27,8 @@ package v1
import ( import (
context "context" context "context"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" scheme "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"

View File

@ -27,8 +27,8 @@ package v1
import ( import (
context "context" context "context"
zalandoorgv1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" scheme "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"

View File

@ -25,8 +25,8 @@ SOFTWARE.
package fake package fake
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
zalandoorgv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1" zalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/zalando.org/v1"
gentype "k8s.io/client-go/gentype" gentype "k8s.io/client-go/gentype"
) )

View File

@ -25,7 +25,7 @@ SOFTWARE.
package fake package fake
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/zalando.org/v1"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
) )

View File

@ -27,8 +27,8 @@ package v1
import ( import (
http "net/http" http "net/http"
zalandoorgv1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" scheme "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/scheme"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
) )

View File

@ -25,8 +25,8 @@ SOFTWARE.
package acid package acid
import ( import (
v1 "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/acid.zalan.do/v1"
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
) )
// Interface provides access to each of this group's versions. // Interface provides access to each of this group's versions.

View File

@ -25,7 +25,7 @@ SOFTWARE.
package v1 package v1
import ( import (
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
) )
// Interface provides access to all the informers in this group version. // Interface provides access to all the informers in this group version.

View File

@ -28,10 +28,10 @@ import (
context "context" context "context"
time "time" time "time"
apisacidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" apisacidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" versioned "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/generated/listers/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/listers/acid.zalan.do/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -28,10 +28,10 @@ import (
context "context" context "context"
time "time" time "time"
apisacidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" apisacidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" versioned "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/generated/listers/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/listers/acid.zalan.do/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -28,10 +28,10 @@ import (
context "context" context "context"
time "time" time "time"
apisacidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" apisacidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" versioned "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
acidzalandov1 "github.com/zalando/postgres-operator/pkg/generated/listers/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/listers/acid.zalan.do/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -30,10 +30,10 @@ import (
sync "sync" sync "sync"
time "time" time "time"
versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" versioned "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
acidzalando "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do" acidzalando "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/acid.zalan.do"
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
zalandoorg "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/zalando.org" zalandoorg "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/zalando.org"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -27,8 +27,8 @@ package externalversions
import ( import (
fmt "fmt" fmt "fmt"
v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandoorgv1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
) )

View File

@ -27,7 +27,7 @@ package internalinterfaces
import ( import (
time "time" time "time"
versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" versioned "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"

View File

@ -25,8 +25,8 @@ SOFTWARE.
package zalando package zalando
import ( import (
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/zalando.org/v1" v1 "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/zalando.org/v1"
) )
// Interface provides access to each of this group's versions. // Interface provides access to each of this group's versions.

View File

@ -28,10 +28,10 @@ import (
context "context" context "context"
time "time" time "time"
apiszalandoorgv1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" apiszalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" versioned "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
zalandoorgv1 "github.com/zalando/postgres-operator/pkg/generated/listers/zalando.org/v1" zalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/generated/listers/zalando.org/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@ -25,7 +25,7 @@ SOFTWARE.
package v1 package v1
import ( import (
internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" internalinterfaces "github.com/zalando/postgres-operator/v2/pkg/generated/informers/externalversions/internalinterfaces"
) )
// Interface provides access to all the informers in this group version. // Interface provides access to all the informers in this group version.

View File

@ -25,7 +25,7 @@ SOFTWARE.
package v1 package v1
import ( import (
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers" listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"

View File

@ -25,7 +25,7 @@ SOFTWARE.
package v1 package v1
import ( import (
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers" listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"

View File

@ -25,7 +25,7 @@ SOFTWARE.
package v1 package v1
import ( import (
acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidzalandov1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers" listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"

View File

@ -25,7 +25,7 @@ SOFTWARE.
package v1 package v1
import ( import (
zalandoorgv1 "github.com/zalando/postgres-operator/pkg/apis/zalando.org/v1" zalandoorgv1 "github.com/zalando/postgres-operator/v2/pkg/apis/zalando.org/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers" listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"

View File

@ -1,8 +1,8 @@
package teams package teams
import ( import (
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
) )
// PostgresTeamMap is the operator's internal representation of all PostgresTeam CRDs // PostgresTeamMap is the operator's internal representation of all PostgresTeam CRDs

View File

@ -3,8 +3,8 @@ package teams
import ( import (
"testing" "testing"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@ -17,7 +17,7 @@ const (
resize2fs = "resize2fs" resize2fs = "resize2fs"
) )
//Ext234Resize implements the FilesystemResizer interface for the ext4/3/2fs. // Ext234Resize implements the FilesystemResizer interface for the ext4/3/2fs.
type Ext234Resize struct { type Ext234Resize struct {
} }

View File

@ -7,11 +7,11 @@ import (
b64 "encoding/base64" b64 "encoding/base64"
"encoding/json" "encoding/json"
apiacidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" apiacidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
zalandoclient "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" zalandoclient "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned"
acidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
zalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1" zalandov1 "github.com/zalando/postgres-operator/v2/pkg/generated/clientset/versioned/typed/zalando.org/v1"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
apiappsv1 "k8s.io/api/apps/v1" apiappsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

View File

@ -11,11 +11,11 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
httpclient "github.com/zalando/postgres-operator/pkg/util/httpclient" httpclient "github.com/zalando/postgres-operator/v2/pkg/util/httpclient"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
) )

View File

@ -12,9 +12,9 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/zalando/postgres-operator/mocks" "github.com/zalando/postgres-operator/v2/mocks"
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
) )

View File

@ -7,9 +7,9 @@ import (
"reflect" "reflect"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util" "github.com/zalando/postgres-operator/v2/pkg/util"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
) )
const ( const (
@ -60,11 +60,13 @@ func (strategy DefaultUserSyncStrategy) ProduceSyncRequests(dbUsers spec.PgUserM
} }
} else { } else {
r := spec.PgSyncUserRequest{} r := spec.PgSyncUserRequest{}
newMD5Password := util.NewEncryptor(strategy.PasswordEncryption).PGUserPassword(newUser)
// do not compare for roles coming from docker image // A plain string comparison with a freshly generated hash would
if dbUser.Password != newMD5Password { // re-issue ALTER ROLE on every sync for SCRAM-SHA-256, because
r.User.Password = newMD5Password // each generated verifier embeds a new random salt. Verify the
// stored hash against the desired password instead.
if !util.PGUserPasswordUpToDate(newUser, dbUser.Password, strategy.PasswordEncryption) {
r.User.Password = util.NewEncryptor(strategy.PasswordEncryption).PGUserPassword(newUser)
r.Kind = spec.PGsyncUserAlter r.Kind = spec.PGsyncUserAlter
} }
if addNewRoles, equal := util.SubstractStringSlices(newUser.MemberOf, dbUser.MemberOf); !equal { if addNewRoles, equal := util.SubstractStringSlices(newUser.MemberOf, dbUser.MemberOf); !equal {

View File

@ -13,6 +13,7 @@ import (
"reflect" "reflect"
"regexp" "regexp"
"sort" "sort"
"strconv"
"strings" "strings"
"time" "time"
@ -21,7 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
"golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/pbkdf2"
) )
@ -94,14 +95,21 @@ func NewEncryptor(encryption string) *Encryptor {
} }
func (e *Encryptor) PGUserPassword(user spec.PgUser) string { func (e *Encryptor) PGUserPassword(user spec.PgUser) string {
if (len(user.Password) == md5.Size*2+len(md5prefix) && user.Password[:3] == md5prefix) || if isMD5Hash(user.Password) || isScramHash(user.Password) || user.Password == "" {
(len(user.Password) > len(scramsha256prefix) && user.Password[:len(scramsha256prefix)] == scramsha256prefix) || user.Password == "" {
// Avoid processing already encrypted or empty passwords // Avoid processing already encrypted or empty passwords
return user.Password return user.Password
} }
return e.encrypt(user) return e.encrypt(user)
} }
func isMD5Hash(password string) bool {
return len(password) == md5.Size*2+len(md5prefix) && password[:3] == md5prefix
}
func isScramHash(password string) bool {
return len(password) > len(scramsha256prefix) && password[:len(scramsha256prefix)] == scramsha256prefix
}
func (e *Encryptor) PGUserPasswordMD5(user spec.PgUser) string { func (e *Encryptor) PGUserPasswordMD5(user spec.PgUser) string {
s := md5.Sum([]byte(user.Password + user.Name)) // #nosec, using md5 since PostgreSQL uses it for hashing passwords. s := md5.Sum([]byte(user.Password + user.Name)) // #nosec, using md5 since PostgreSQL uses it for hashing passwords.
return md5prefix + hex.EncodeToString(s[:]) return md5prefix + hex.EncodeToString(s[:])
@ -127,6 +135,93 @@ func (e *Encryptor) PGUserPasswordScramSHA256(user spec.PgUser) string {
return pass return pass
} }
// PGUserPasswordUpToDate reports whether the password hash stored in the
// database already corresponds to the user's desired password and the
// configured password encryption, i.e. whether ALTER ROLE ... PASSWORD can
// be skipped during role sync.
//
// A SCRAM-SHA-256 verifier embeds a random salt, so regenerating one from
// the plaintext and comparing strings never matches. Instead, the salt and
// iteration count are taken from the stored verifier and the derived keys
// are compared. A stored hash whose type differs from the configured
// encryption is reported as outdated so that changing password_encryption
// still re-hashes the roles.
func PGUserPasswordUpToDate(user spec.PgUser, storedPassword, encryption string) bool {
// Empty and pre-hashed desired passwords can only be compared verbatim,
// mirroring the early return in PGUserPassword.
if user.Password == "" || isMD5Hash(user.Password) || isScramHash(user.Password) {
return user.Password == storedPassword
}
switch {
case isMD5Hash(storedPassword):
if encryption != "md5" {
return false
}
return NewEncryptor(encryption).PGUserPassword(user) == storedPassword
case isScramHash(storedPassword):
if encryption == "md5" {
return false
}
return scramVerifierMatches(user.Password, storedPassword)
}
return false
}
// scramVerifierMatches verifies a plaintext password against a stored
// SCRAM-SHA-256 verifier of the form
// SCRAM-SHA-256$<iterations>:<salt>$<storedKey>:<serverKey>
// by re-deriving the keys with the stored salt and iteration count.
func scramVerifierMatches(password, verifier string) bool {
rest := strings.TrimPrefix(verifier, scramsha256prefix+"$")
if rest == verifier {
return false
}
saltedParams, keys, found := strings.Cut(rest, "$")
if !found {
return false
}
iterationsPart, saltPart, found := strings.Cut(saltedParams, ":")
if !found {
return false
}
storedKeyPart, serverKeyPart, found := strings.Cut(keys, ":")
if !found {
return false
}
iterationCount, err := strconv.Atoi(iterationsPart)
if err != nil || iterationCount < 1 {
return false
}
salt, err := base64.StdEncoding.DecodeString(saltPart)
if err != nil {
return false
}
storedKey, err := base64.StdEncoding.DecodeString(storedKeyPart)
if err != nil {
return false
}
serverKey, err := base64.StdEncoding.DecodeString(serverKeyPart)
if err != nil {
return false
}
key := pbkdf2.Key([]byte(password), salt, iterationCount, 32, sha256.New)
serverMAC := hmac.New(sha256.New, key)
serverMAC.Write([]byte("Server Key"))
derivedServerKey := serverMAC.Sum(nil)
clientMAC := hmac.New(sha256.New, key)
clientMAC.Write([]byte("Client Key"))
derivedStoredKey := sha256.Sum256(clientMAC.Sum(nil))
return hmac.Equal(derivedServerKey, serverKey) && hmac.Equal(derivedStoredKey[:], storedKey)
}
// Diff returns diffs between 2 objects // Diff returns diffs between 2 objects
func Diff(a, b interface{}) []string { func Diff(a, b interface{}) []string {
return pretty.Diff(a, b) return pretty.Diff(a, b)

View File

@ -8,7 +8,7 @@ import (
"regexp" "regexp"
"github.com/zalando/postgres-operator/pkg/spec" "github.com/zalando/postgres-operator/v2/pkg/spec"
) )
var pgUsers = []struct { var pgUsers = []struct {
@ -162,6 +162,41 @@ func TestPGUserPassword(t *testing.T) {
} }
} }
func TestPGUserPasswordUpToDate(t *testing.T) {
user := spec.PgUser{Name: "someuser", Password: "password"}
md5Hash := NewEncryptor("md5").PGUserPassword(user)
// real generation path: random salt in the verifier
scramHash := NewEncryptor("scram-sha-256").PGUserPassword(user)
tests := []struct {
name string
user spec.PgUser
stored string
encryption string
want bool
}{
{"scram verifier matches its plaintext", user, scramHash, "scram-sha-256", true},
{"a differently salted verifier of the same password matches", user, NewEncryptor("scram-sha-256").PGUserPassword(user), "scram-sha-256", true},
{"scram verifier of another password does not match", spec.PgUser{Name: "someuser", Password: "different"}, scramHash, "scram-sha-256", false},
{"md5 hash matches its plaintext", user, md5Hash, "md5", true},
{"md5 hash of another password does not match", spec.PgUser{Name: "someuser", Password: "different"}, md5Hash, "md5", false},
{"stored md5 is outdated when scram is configured", user, md5Hash, "scram-sha-256", false},
{"stored scram is outdated when md5 is configured", user, scramHash, "md5", false},
{"pre-hashed desired password compares verbatim", spec.PgUser{Name: "someuser", Password: md5Hash}, md5Hash, "md5", true},
{"pre-hashed desired password differs from stored", spec.PgUser{Name: "someuser", Password: md5Hash}, scramHash, "md5", false},
{"empty desired password matches empty stored", spec.PgUser{Name: "someuser"}, "", "scram-sha-256", true},
{"empty desired password differs from stored hash", spec.PgUser{Name: "someuser"}, scramHash, "scram-sha-256", false},
{"malformed stored hash is outdated", user, "not-a-hash", "scram-sha-256", false},
{"truncated scram verifier is outdated", user, "SCRAM-SHA-256$4096:c2FsdA==", "scram-sha-256", false},
{"scram verifier with bad base64 is outdated", user, "SCRAM-SHA-256$4096:!!$aaaa:bbbb", "scram-sha-256", false},
}
for _, tt := range tests {
if got := PGUserPasswordUpToDate(tt.user, tt.stored, tt.encryption); got != tt.want {
t.Errorf("%s: PGUserPasswordUpToDate expected %v, got %v", tt.name, tt.want, got)
}
}
}
func TestPrettyDiff(t *testing.T) { func TestPrettyDiff(t *testing.T) {
for _, tt := range prettyDiffTest { for _, tt := range prettyDiffTest {
if actual := PrettyDiff(tt.inA, tt.inB); actual != tt.out { if actual := PrettyDiff(tt.inA, tt.inB); actual != tt.out {

View File

@ -10,8 +10,8 @@ import (
"github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/aws-sdk-go-v2/service/ec2/types"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"github.com/zalando/postgres-operator/pkg/util/constants" "github.com/zalando/postgres-operator/v2/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/retryutil" "github.com/zalando/postgres-operator/v2/pkg/util/retryutil"
) )
// EBSVolumeResizer implements volume resizing interface for AWS EBS volumes. // EBSVolumeResizer implements volume resizing interface for AWS EBS volumes.

View File

@ -2,9 +2,9 @@ package volumes
import ( import (
"fmt" "fmt"
"testing"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
) )
func TestGetProviderVolumeID(t *testing.T) { func TestGetProviderVolumeID(t *testing.T) {
@ -88,7 +88,7 @@ func TestVolumeBelongsToProvider(t *testing.T) {
name: "AWS EBS volume handle", name: "AWS EBS volume handle",
pv: &v1.PersistentVolume{ pv: &v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string { Annotations: map[string]string{
"pv.kubernetes.io/provisioned-by": "kubernetes.io/aws-ebs", "pv.kubernetes.io/provisioned-by": "kubernetes.io/aws-ebs",
}, },
}, },

View File

@ -38,7 +38,7 @@
"brfs": "^2.0.2", "brfs": "^2.0.2",
"dedent-js": "1.0.1", "dedent-js": "1.0.1",
"eslint": "^8.32.0", "eslint": "^8.32.0",
"js-yaml": "4.3.0", "js-yaml": "4.3.1",
"pug": "^3.0.2", "pug": "^3.0.2",
"rimraf": "^4.1.2", "rimraf": "^4.1.2",
"riot": "^3.13.2", "riot": "^3.13.2",