Skip to content

Commit 0e33503

Browse files
wilybracejkatz
authored andcommitted
fixes go formatting
go fmt is the standard tool for ensuring Go code is canonically formatted The changes in this commit are the result of running go fmt on all files without other changes There are no functional changes in this commit to prevent any confusion from unified diffs or odd diff interpretations, especially when fixed automatically by users with Go-aware editors.
1 parent 313b2de commit 0e33503

File tree

30 files changed

+250
-279
lines changed

30 files changed

+250
-279
lines changed

apis/cr/v1/common.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ type PgContainerResources struct {
5858
LimitsCPU string `json:"limitscpu"`
5959
}
6060

61-
// CompletedStatus -
61+
// CompletedStatus -
6262
const CompletedStatus = "completed"
63-
// InProgressStatus -
63+
64+
// InProgressStatus -
6465
const InProgressStatus = "in progress"
65-
// SubmittedStatus -
66+
67+
// SubmittedStatus -
6668
const SubmittedStatus = "submitted"
6769

6870
// JobCompletedStatus ....

apiserver/failoverservice/failoverimpl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ func preferredNode(nodes []string, targetNode string) bool {
261261

262262
func checkAutofail(cluster *crv1.Pgcluster) error {
263263
var err error
264-
264+
265265
if util.IsAutofailEnabled(cluster) {
266266
return errors.New("autofail flag is set to true, manual failover requires autofail to be set to false, use pgo update to disable autofail.")
267267
}
268-
268+
269269
return err
270270
}

apiserver/loadservice/loadimpl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type loadJobTemplateFields struct {
4848
PVCName string
4949
SecurityContext string
5050
ContainerResources string
51-
PGUserSecret string
51+
PGUserSecret string
5252
}
5353

5454
type containerResourcesTemplateFields struct {

apiserver/pgouserservice/pgouserimpl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ func UpdatePgouser(clientset *kubernetes.Clientset, updatedBy string, request *m
238238
secret.Data[MAP_KEY_NAMESPACES] = []byte("")
239239
}
240240

241-
log.Info("Updating secret for: " , request.PgouserName )
241+
log.Info("Updating secret for: ", request.PgouserName)
242242
err = kubeapi.UpdateSecret(clientset, secret, apiserver.PgoNamespace)
243243
if err != nil {
244-
log.Debug("Error updating pgouser secret: " , err.Error)
244+
log.Debug("Error updating pgouser secret: ", err.Error)
245245
resp.Status.Code = msgs.Error
246246
resp.Status.Msg = err.Error()
247247
return resp

apiserver/upgradeservice/upgradeimpl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func CreateUpgrade(request *msgs.CreateUpgradeRequest, ns string) msgs.CreateUpg
113113
response.Status.Msg = clusterName + " is not a valid pgcluster"
114114
return response
115115
}
116-
116+
117117
//figure out what version we are upgrading to
118118
imageToUpgradeTo := apiserver.Pgo.Cluster.CCPImageTag
119119
if request.CCPImageTag != "" {

apiserver/userservice/userimpl.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import (
2121
"fmt"
2222
kerrors "k8s.io/apimachinery/pkg/api/errors"
2323
"math/rand"
24+
"regexp"
2425
"strconv"
2526
"strings"
2627
"time"
27-
"regexp"
2828

2929
crv1 "github.com/crunchydata/postgres-operator/apis/cr/v1"
3030
"github.com/crunchydata/postgres-operator/apiserver"
@@ -168,7 +168,7 @@ func UpdateUser(request *msgs.UpdateUserRequest, pgouser string) msgs.UpdateUser
168168
}
169169
log.Debugf("expiring user %s", request.Username)
170170
}
171-
171+
172172
if request.Expired != "" {
173173
results := callDB(info, d.ObjectMeta.Name, request.Expired)
174174
if len(results) > 0 {
@@ -645,8 +645,6 @@ func CreateUser(request *msgs.CreateUserRequest, pgouser string) msgs.CreateUser
645645
resp.Status.Msg = ""
646646
resp.Results = make([]string, 0)
647647

648-
649-
650648
getDefaults()
651649

652650
log.Debugf("createUser selector is ", request.Selector)

apiservermsgs/common.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717

1818
import ()
1919

20-
2120
const PGO_VERSION = "4.1.0"
2221

2322
// Ok status

apiservermsgs/usermsgs.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ import (
2121

2222
// UpdateUserRequest ...
2323
type UpdateUserRequest struct {
24-
Clusters []string
25-
Selector string
26-
AllFlag bool
27-
ExpireUser bool
28-
Namespace string
29-
PasswordAgeDays int
30-
PasswordAgeDaysUpdate bool
31-
Username string
32-
Password string
33-
DeleteUser string
34-
ValidDays string
35-
UserDBAccess string
36-
AddUser string
37-
Expired string
38-
ManagedUser bool
39-
ClientVersion string
40-
PasswordLength int
24+
Clusters []string
25+
Selector string
26+
AllFlag bool
27+
ExpireUser bool
28+
Namespace string
29+
PasswordAgeDays int
30+
PasswordAgeDaysUpdate bool
31+
Username string
32+
Password string
33+
DeleteUser string
34+
ValidDays string
35+
UserDBAccess string
36+
AddUser string
37+
Expired string
38+
ManagedUser bool
39+
ClientVersion string
40+
PasswordLength int
4141
}
4242

4343
// DeleteUserRequest ...

config/pgoconfig.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (c *PgoConfig) Validate() error {
302302
return errors.New(errPrefix + "Invalid PGBadgerPort: " + err.Error())
303303
}
304304
}
305-
if c.Cluster.ExporterPort == "" {
305+
if c.Cluster.ExporterPort == "" {
306306
c.Cluster.ExporterPort = DEFAULT_EXPORTER_PORT
307307
log.Infof("setting ExporterPort to default %s", c.Cluster.ExporterPort)
308308
} else {
@@ -319,7 +319,6 @@ func (c *PgoConfig) Validate() error {
319319
}
320320
}
321321

322-
323322
if c.Cluster.LogStatement != "" {
324323
found := false
325324
for _, v := range log_statement_values {
@@ -348,7 +347,7 @@ func (c *PgoConfig) Validate() error {
348347
if c.Cluster.PrimaryNodeLabel != "" {
349348
parts := strings.Split(c.Cluster.PrimaryNodeLabel, "=")
350349
if len(parts) != 2 {
351-
return errors.New(errPrefix+ "Cluster.PrimaryNodeLabel does not follow key=value format")
350+
return errors.New(errPrefix + "Cluster.PrimaryNodeLabel does not follow key=value format")
352351
}
353352
}
354353

@@ -480,12 +479,12 @@ func (c *PgoConfig) Validate() error {
480479
return errors.New(errPrefix + "Cluster.User is required")
481480
} else {
482481
// validates that username can be used as the kubernetes secret name
483-
// Must consist of lower case alphanumeric characters,
482+
// Must consist of lower case alphanumeric characters,
484483
// '-' or '.', and must start and end with an alphanumeric character
485-
errs := validation.IsDNS1123Subdomain(c.Cluster.User)
484+
errs := validation.IsDNS1123Subdomain(c.Cluster.User)
486485
if len(errs) > 0 {
487486
var msg string
488-
for i := range errs{
487+
for i := range errs {
489488
msg = msg + errs[i]
490489
}
491490
return errors.New(errPrefix + msg)

controller/jobcontroller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ func (c *JobController) onUpdate(oldObj, newObj interface{}) {
107107
log.Debugf("jobController onUpdate rmdata job succeeded")
108108
publishDeleteClusterComplete(labels[config.LABEL_PG_CLUSTER], job.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
109109
job.ObjectMeta.Labels[config.LABEL_PGOUSER], job.ObjectMeta.Namespace)
110-
110+
111111
log.Debugf("jobController onUpdate rmdata job case")
112-
112+
113113
err = handleRmdata(job, c.JobClient, c.JobClientset, job.ObjectMeta.Namespace)
114114
if err != nil {
115115
log.Error(err)
116116
}
117-
117+
118118
return
119119
}
120120

0 commit comments

Comments
 (0)