go fmt run
This commit is contained in:
parent
abd04e6f5a
commit
5adceceb36
12
cmd/main.go
12
cmd/main.go
|
|
@ -15,13 +15,13 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
KubeConfigFile string
|
||||
podNamespace string
|
||||
configMapName spec.NamespacedName
|
||||
OutOfCluster bool
|
||||
noTeamsAPI bool
|
||||
KubeConfigFile string
|
||||
podNamespace string
|
||||
configMapName spec.NamespacedName
|
||||
OutOfCluster bool
|
||||
noTeamsAPI bool
|
||||
noDatabaseAccess bool
|
||||
version string
|
||||
version string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package cluster
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/client-go/pkg/api/resource"
|
||||
"k8s.io/client-go/pkg/api/v1"
|
||||
|
|
|
|||
|
|
@ -40,17 +40,17 @@ func (c *Cluster) DatabaseAccessDisabled() bool {
|
|||
}
|
||||
func (c *Cluster) initDbConn() (err error) {
|
||||
if c.pgDb == nil {
|
||||
conn, err := sql.Open("postgres", c.pgConnectionString())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = conn.Ping()
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
return err
|
||||
}
|
||||
conn, err := sql.Open("postgres", c.pgConnectionString())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = conn.Ping()
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
c.pgDb = conn
|
||||
c.pgDb = conn
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
|
||||
remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand"
|
||||
"k8s.io/client-go/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/remotecommand"
|
||||
remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand"
|
||||
|
||||
"github.com/zalando-incubator/postgres-operator/pkg/spec"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ type Config struct {
|
|||
WALES3Bucket string `name:"wal_s3_bucket"`
|
||||
KubeIAMRole string `name:"kube_iam_role"`
|
||||
DebugLogging bool `name:"debug_logging" default:"false"`
|
||||
EnableDBAccess bool `name:"enable_database_access" default:"true"`
|
||||
EnableDBAccess bool `name:"enable_database_access" default:"true"`
|
||||
EnableTeamsAPI bool `name:"enable_teams_api" default:"true"`
|
||||
DNSNameFormat string `name:"dns_name_format" default:"%s.%s.%s"`
|
||||
Workers uint32 `name:"workers" default:"4"`
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ type TeamsAPI struct {
|
|||
httpClient *http.Client
|
||||
logger *logrus.Entry
|
||||
RefreshTokenAction func() (string, error)
|
||||
enabled bool
|
||||
enabled bool
|
||||
}
|
||||
|
||||
func NewTeamsAPI(url string, log *logrus.Logger, enabled bool) *TeamsAPI {
|
||||
|
|
@ -50,7 +50,7 @@ func NewTeamsAPI(url string, log *logrus.Logger, enabled bool) *TeamsAPI {
|
|||
url: strings.TrimRight(url, "/"),
|
||||
httpClient: &http.Client{},
|
||||
logger: log.WithField("pkg", "teamsapi"),
|
||||
enabled: enabled,
|
||||
enabled: enabled,
|
||||
}
|
||||
|
||||
return &t
|
||||
|
|
|
|||
Loading…
Reference in New Issue