diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 7d8e243bb..b05ab4fd3 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -45,6 +45,8 @@ They will be deprecated and removed in the future. Variable names are underscore-separated words. + + ## General 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** 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) \ No newline at end of file diff --git a/glide.lock b/glide.lock index 19cb6c41f..acedb47f5 100644 --- a/glide.lock +++ b/glide.lock @@ -100,7 +100,7 @@ imports: version: b2aad2c9a95d14eb978f29baa6e3a5c3c20eef30 - name: github.com/peterbourgon/diskv version: 5f041e8faa004a95c88a202771f4cc3e991971e6 -- name: github.com/Sirupsen/logrus +- name: github.com/sirupsen/logrus version: 3e01752db0189b9157070a0e1668a620f9a85da2 - name: github.com/spf13/pflag version: 583c0c0531f06d5278b7d917446061adc344b5cd diff --git a/glide.yaml b/glide.yaml index 74e837877..41d8dee29 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,6 @@ package: github.com/zalando-incubator/postgres-operator import: -- package: github.com/Sirupsen/logrus +- package: github.com/sirupsen/logrus version: ^1.0.1 - package: github.com/aws/aws-sdk-go version: ^1.8.24 diff --git a/pkg/apis/acid.zalan.do/v1/util_test.go b/pkg/apis/acid.zalan.do/v1/util_test.go index ab5a39e9e..fae6ea1cf 100644 --- a/pkg/apis/acid.zalan.do/v1/util_test.go +++ b/pkg/apis/acid.zalan.do/v1/util_test.go @@ -129,13 +129,8 @@ var unmarshalCluster = []struct { Name: "acid-testcluster1", }, Status: ClusterStatusInvalid, - Error: (&json.UnmarshalTypeError{ - Value: "number", - Type: reflect.TypeOf(""), - Offset: 126, - Struct: "PostgresSpec", - Field: "teamId", - }).Error(), + // This error message can vary between Go versions, so compute it for the current version. + Error: json.Unmarshal([]byte(`{"teamId": 0}`), &PostgresSpec{}).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(`{ diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 54c870287..7f7a69dd9 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/zalando-incubator/postgres-operator/pkg/cluster" "github.com/zalando-incubator/postgres-operator/pkg/spec" diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 6799c5740..b89d5e4d4 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -10,7 +10,7 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "k8s.io/api/apps/v1beta1" "k8s.io/api/core/v1" policybeta1 "k8s.io/api/policy/v1beta1" diff --git a/pkg/cluster/cluster_test.go b/pkg/cluster/cluster_test.go index c89874e99..acf17ace6 100644 --- a/pkg/cluster/cluster_test.go +++ b/pkg/cluster/cluster_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" 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/util/config" @@ -256,7 +256,7 @@ func TestInitHumanUsersWithSuperuserTeams(t *testing.T) { ownerTeam: "postgres_superusers", existingRoles: map[string]spec.PgUser{ // role with the name exists before w/o superuser privilege - "postgres_superuser": spec.PgUser{ + "postgres_superuser": { Origin: spec.RoleOriginTeamsAPI, Name: "postgres_superuser", Password: "", diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index c2049ff29..195d1c76d 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -5,7 +5,7 @@ import ( "fmt" "sort" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "k8s.io/api/apps/v1beta1" "k8s.io/api/core/v1" diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 3812cf626..b2f32a3f3 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -5,7 +5,7 @@ import ( "os" "sync" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "k8s.io/api/core/v1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -157,10 +157,10 @@ func (c *Controller) initPodServiceAccount() { if c.opConfig.PodServiceAccountDefinition == "" { c.opConfig.PodServiceAccountDefinition = ` - { "apiVersion": "v1", - "kind": "ServiceAccount", - "metadata": { - "name": "operator" + { "apiVersion": "v1", + "kind": "ServiceAccount", + "metadata": { + "name": "operator" } }` } @@ -193,10 +193,10 @@ func (c *Controller) initRoleBinding() { // we assume the role is created by the k8s administrator if c.opConfig.PodServiceAccountRoleBindingDefinition == "" { c.opConfig.PodServiceAccountRoleBindingDefinition = ` - { + { "apiVersion": "rbac.authorization.k8s.io/v1beta1", - "kind": "RoleBinding", - "metadata": { + "kind": "RoleBinding", + "metadata": { "name": "zalando-postgres-operator" }, "roleRef": { @@ -209,7 +209,7 @@ func (c *Controller) initRoleBinding() { "kind": "ServiceAccount", "name": "operator" } - ] + ] }` } c.logger.Info("Parse role bindings") diff --git a/pkg/controller/logs_and_api.go b/pkg/controller/logs_and_api.go index 7a6619203..3e5f20759 100644 --- a/pkg/controller/logs_and_api.go +++ b/pkg/controller/logs_and_api.go @@ -5,7 +5,7 @@ import ( "sort" "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/spec" diff --git a/pkg/controller/postgresql.go b/pkg/controller/postgresql.go index 14e9c5c7c..ad7dcbaad 100644 --- a/pkg/controller/postgresql.go +++ b/pkg/controller/postgresql.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -71,7 +71,7 @@ func (c *Controller) clusterListAndSync() error { } c.queueEvents(list, event) } 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) } return nil diff --git a/pkg/spec/types.go b/pkg/spec/types.go index 1607dbd9b..e394462d4 100644 --- a/pkg/spec/types.go +++ b/pkg/spec/types.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/rest" ) diff --git a/pkg/util/patroni/patroni.go b/pkg/util/patroni/patroni.go index a16fd2dfb..23260f277 100644 --- a/pkg/util/patroni/patroni.go +++ b/pkg/util/patroni/patroni.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "k8s.io/api/core/v1" ) diff --git a/pkg/util/teams/teams.go b/pkg/util/teams/teams.go index 2223d2063..8afcd1a3b 100644 --- a/pkg/util/teams/teams.go +++ b/pkg/util/teams/teams.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // InfrastructureAccount defines an account of the team on some infrastructure (i.e AWS, Google) platform. diff --git a/pkg/util/teams/teams_test.go b/pkg/util/teams/teams_test.go index fd0de591b..637c4e16c 100644 --- a/pkg/util/teams/teams_test.go +++ b/pkg/util/teams/teams_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) var (