Merge branch 'master' into feature/actions-for-secret-syncing

This commit is contained in:
erthalion 2018-09-24 10:28:19 +02:00
commit dc8f169a00
15 changed files with 29 additions and 30 deletions

View File

@ -45,6 +45,8 @@ They will be deprecated and removed in the future.
Variable names are underscore-separated words. Variable names are underscore-separated words.
## General ## General
Those are top-level keys, containing both leaf keys and groups. Those are top-level keys, containing both leaf keys and groups.
@ -420,3 +422,5 @@ scalyr sidecar. In the CRD-based configuration they are grouped under the
* **scalyr_memory_limit** * **scalyr_memory_limit**
Memory limit value for the Scalyr sidecar. The default is `1Gi`. Memory limit value for the Scalyr sidecar. The default is `1Gi`.
For the configmap operator configuration, the [default parameter values](https://github.com/zalando-incubator/postgres-operator/blob/master/pkg/util/config/config.go#L14) mentioned here are likely to be overwritten in your local operator installation via your local version of the operator configmap. In the case you use the operator CRD, all the CRD defaults are provided in the [operator's default configuration manifest](https://github.com/zalando-incubator/postgres-operator/blob/master/manifests/postgresql-operator-default-configuration.yaml)

2
glide.lock generated
View File

@ -100,7 +100,7 @@ imports:
version: b2aad2c9a95d14eb978f29baa6e3a5c3c20eef30 version: b2aad2c9a95d14eb978f29baa6e3a5c3c20eef30
- name: github.com/peterbourgon/diskv - name: github.com/peterbourgon/diskv
version: 5f041e8faa004a95c88a202771f4cc3e991971e6 version: 5f041e8faa004a95c88a202771f4cc3e991971e6
- name: github.com/Sirupsen/logrus - name: github.com/sirupsen/logrus
version: 3e01752db0189b9157070a0e1668a620f9a85da2 version: 3e01752db0189b9157070a0e1668a620f9a85da2
- name: github.com/spf13/pflag - name: github.com/spf13/pflag
version: 583c0c0531f06d5278b7d917446061adc344b5cd version: 583c0c0531f06d5278b7d917446061adc344b5cd

View File

@ -1,6 +1,6 @@
package: github.com/zalando-incubator/postgres-operator package: github.com/zalando-incubator/postgres-operator
import: import:
- package: github.com/Sirupsen/logrus - package: github.com/sirupsen/logrus
version: ^1.0.1 version: ^1.0.1
- package: github.com/aws/aws-sdk-go - package: github.com/aws/aws-sdk-go
version: ^1.8.24 version: ^1.8.24

View File

@ -129,13 +129,8 @@ var unmarshalCluster = []struct {
Name: "acid-testcluster1", Name: "acid-testcluster1",
}, },
Status: ClusterStatusInvalid, Status: ClusterStatusInvalid,
Error: (&json.UnmarshalTypeError{ // This error message can vary between Go versions, so compute it for the current version.
Value: "number", Error: json.Unmarshal([]byte(`{"teamId": 0}`), &PostgresSpec{}).Error(),
Type: reflect.TypeOf(""),
Offset: 126,
Struct: "PostgresSpec",
Field: "teamId",
}).Error(),
}, },
[]byte(`{"kind":"Postgresql","apiVersion":"acid.zalan.do/v1","metadata":{"name":"acid-testcluster1","creationTimestamp":null},"spec":{"postgresql":{"version":"","parameters":null},"volume":{"size":"","storageClass":""},"patroni":{"initdb":null,"pg_hba":null,"ttl":0,"loop_wait":0,"retry_timeout":0,"maximum_lag_on_failover":0},"resources":{"requests":{"cpu":"","memory":""},"limits":{"cpu":"","memory":""}},"teamId":"","allowedSourceRanges":null,"numberOfInstances":0,"users":null,"clone":{}},"status":"Invalid"}`), nil}, []byte(`{"kind":"Postgresql","apiVersion":"acid.zalan.do/v1","metadata":{"name":"acid-testcluster1","creationTimestamp":null},"spec":{"postgresql":{"version":"","parameters":null},"volume":{"size":"","storageClass":""},"patroni":{"initdb":null,"pg_hba":null,"ttl":0,"loop_wait":0,"retry_timeout":0,"maximum_lag_on_failover":0},"resources":{"requests":{"cpu":"","memory":""},"limits":{"cpu":"","memory":""}},"teamId":"","allowedSourceRanges":null,"numberOfInstances":0,"users":null,"clone":{}},"status":"Invalid"}`), nil},
{[]byte(`{ {[]byte(`{

View File

@ -11,7 +11,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/zalando-incubator/postgres-operator/pkg/cluster" "github.com/zalando-incubator/postgres-operator/pkg/cluster"
"github.com/zalando-incubator/postgres-operator/pkg/spec" "github.com/zalando-incubator/postgres-operator/pkg/spec"

View File

@ -10,7 +10,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"k8s.io/api/apps/v1beta1" "k8s.io/api/apps/v1beta1"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
policybeta1 "k8s.io/api/policy/v1beta1" policybeta1 "k8s.io/api/policy/v1beta1"

View File

@ -5,7 +5,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
acidv1 "github.com/zalando-incubator/postgres-operator/pkg/apis/acid.zalan.do/v1" acidv1 "github.com/zalando-incubator/postgres-operator/pkg/apis/acid.zalan.do/v1"
"github.com/zalando-incubator/postgres-operator/pkg/spec" "github.com/zalando-incubator/postgres-operator/pkg/spec"
"github.com/zalando-incubator/postgres-operator/pkg/util/config" "github.com/zalando-incubator/postgres-operator/pkg/util/config"
@ -256,7 +256,7 @@ func TestInitHumanUsersWithSuperuserTeams(t *testing.T) {
ownerTeam: "postgres_superusers", ownerTeam: "postgres_superusers",
existingRoles: map[string]spec.PgUser{ existingRoles: map[string]spec.PgUser{
// role with the name exists before w/o superuser privilege // role with the name exists before w/o superuser privilege
"postgres_superuser": spec.PgUser{ "postgres_superuser": {
Origin: spec.RoleOriginTeamsAPI, Origin: spec.RoleOriginTeamsAPI,
Name: "postgres_superuser", Name: "postgres_superuser",
Password: "", Password: "",

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"sort" "sort"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"k8s.io/api/apps/v1beta1" "k8s.io/api/apps/v1beta1"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"

View File

@ -5,7 +5,7 @@ import (
"os" "os"
"sync" "sync"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
rbacv1beta1 "k8s.io/api/rbac/v1beta1" rbacv1beta1 "k8s.io/api/rbac/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -157,10 +157,10 @@ func (c *Controller) initPodServiceAccount() {
if c.opConfig.PodServiceAccountDefinition == "" { if c.opConfig.PodServiceAccountDefinition == "" {
c.opConfig.PodServiceAccountDefinition = ` c.opConfig.PodServiceAccountDefinition = `
{ "apiVersion": "v1", { "apiVersion": "v1",
"kind": "ServiceAccount", "kind": "ServiceAccount",
"metadata": { "metadata": {
"name": "operator" "name": "operator"
} }
}` }`
} }
@ -193,10 +193,10 @@ func (c *Controller) initRoleBinding() {
// we assume the role is created by the k8s administrator // we assume the role is created by the k8s administrator
if c.opConfig.PodServiceAccountRoleBindingDefinition == "" { if c.opConfig.PodServiceAccountRoleBindingDefinition == "" {
c.opConfig.PodServiceAccountRoleBindingDefinition = ` c.opConfig.PodServiceAccountRoleBindingDefinition = `
{ {
"apiVersion": "rbac.authorization.k8s.io/v1beta1", "apiVersion": "rbac.authorization.k8s.io/v1beta1",
"kind": "RoleBinding", "kind": "RoleBinding",
"metadata": { "metadata": {
"name": "zalando-postgres-operator" "name": "zalando-postgres-operator"
}, },
"roleRef": { "roleRef": {
@ -209,7 +209,7 @@ func (c *Controller) initRoleBinding() {
"kind": "ServiceAccount", "kind": "ServiceAccount",
"name": "operator" "name": "operator"
} }
] ]
}` }`
} }
c.logger.Info("Parse role bindings") c.logger.Info("Parse role bindings")

View File

@ -5,7 +5,7 @@ import (
"sort" "sort"
"sync/atomic" "sync/atomic"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/zalando-incubator/postgres-operator/pkg/cluster" "github.com/zalando-incubator/postgres-operator/pkg/cluster"
"github.com/zalando-incubator/postgres-operator/pkg/spec" "github.com/zalando-incubator/postgres-operator/pkg/spec"

View File

@ -8,7 +8,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
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"
@ -71,7 +71,7 @@ func (c *Controller) clusterListAndSync() error {
} }
c.queueEvents(list, event) c.queueEvents(list, event)
} else { } else {
c.logger.Infof("not enough time passed since the last sync (%s seconds) or repair (%s seconds)", c.logger.Infof("not enough time passed since the last sync (%v seconds) or repair (%v seconds)",
timeFromPreviousSync, timeFromPreviousRepair) timeFromPreviousSync, timeFromPreviousRepair)
} }
return nil return nil

View File

@ -10,7 +10,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
) )

View File

@ -8,7 +8,7 @@ import (
"net/http" "net/http"
"time" "time"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
) )

View File

@ -6,7 +6,7 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
) )
// InfrastructureAccount defines an account of the team on some infrastructure (i.e AWS, Google) platform. // InfrastructureAccount defines an account of the team on some infrastructure (i.e AWS, Google) platform.

View File

@ -7,7 +7,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/Sirupsen/logrus" "github.com/sirupsen/logrus"
) )
var ( var (