Skip to content

Commit 22780b2

Browse files
committed
chore(pre-commit): go-fmt & stuff
Signed-off-by: Toni Tauro <[email protected]>
1 parent 8b3bbdd commit 22780b2

File tree

6 files changed

+33
-14
lines changed

6 files changed

+33
-14
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/TekWizely/pre-commit-golang
3+
rev: v1.0.0-beta.5
4+
hooks:
5+
- id: go-fmt
6+
- id: go-vet-mod
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.1.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-symlinks
13+
- id: check-merge-conflict
14+
- id: check-case-conflict
15+
- id: detect-aws-credentials
16+
args:
17+
- --allow-missing-credentials
18+
- id: detect-private-key
19+
- id: forbid-new-submodules

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ The following annotations on services of type `LoadBalancer` are supported:
1818

1919
The following configuration flags are supported:
2020

21-
- `-cloudscale-token`, `CLOUDSCALE_TOKEN`, no default, required: cloudscale.ch API token with
21+
- `-cloudscale-token`, `CLOUDSCALE_TOKEN`, no default, required: cloudscale.ch API token with
2222
write access
2323
- `-ip-limit`, `IP_LIMIT`, default `5`: maximum number of floating ips that are allowed to exist on
2424
the cloudscale.ch account; this is used as an additional guard in case this controller is out of
2525
control and would create an infinite amount of floating ips
2626
- `-controller-id`, `CONTROLLER_ID`, no default: if set, the controller will only process services
2727
with a `linkyard.ch/slb-controller-id` annotation set to this value
28-
- `-leader-election-configmap`, `LEADER_ELECTION_CONFIGMAP`, no default: name of the `ConfigMap`
28+
- `-leader-election-configmap`, `LEADER_ELECTION_CONFIGMAP`, no default: name of the `ConfigMap`
2929
to use for leader election
30-
- `-leader-election-namespace` `LEADER_ELECTION_NAMESPACE`, no default: name of the namespace where
30+
- `-leader-election-namespace` `LEADER_ELECTION_NAMESPACE`, no default: name of the namespace where
3131
the `ConfigMap` for leader election is located at
3232
- `-leader-election-node`, `LEADER_ELECTION_NODE`, no default: name of the pod
3333
- `-leader-election-ttl`, `LEADER_ELECTION_TTL`, default `10s`: TTL for leader election, e.g. `10s`;
@@ -36,7 +36,7 @@ The following configuration flags are supported:
3636
`Panic`, `Fatal`, `Error`, `Warn`, `Info`, `Debug`, `Trace`
3737
- `-kubeconfig`, `KUBECONFIG`, no default, not required: path to a kubernetes kubconfig file; this
3838
is not required when running inside a kubernetes cluster
39-
- `-fake-cloudscale-client`, `FAKE_CLOUDSCALE_CLIENT`: set to `true` to use a fake cloudscale.ch
39+
- `-fake-cloudscale-client`, `FAKE_CLOUDSCALE_CLIENT`: set to `true` to use a fake cloudscale.ch
4040
API client
41-
- `-chaos-chance`, `CHAOS_CHANCE`, default `0`: chance of a call to one of the fake components failing;
41+
- `-chaos-chance`, `CHAOS_CHANCE`, default `0`: chance of a call to one of the fake components failing;
4242
range `[0.0,1,0)`

cmd/cloudscale_slb_controller/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Flags:
2929
-cloudscale-token cloudscale.ch API token [CLOUDSCALE_TOKEN]
3030
3131
-ip-limit maximum number of floating ips that are allowed to exist on the
32-
cloudscale.ch account (default: 5); used to make sure we don't go
32+
cloudscale.ch account (default: 5); used to make sure we don't go
3333
bankrupt if this component runs amok [IP_LIMIT]
3434
3535
-kubeconfig path to a kubernetes kubeconfig [KUBECONFIG]

deploy/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ roleRef:
9292
name: cloudscale-slb-controller
9393
subjects:
9494
- kind: ServiceAccount
95-
name: cloudscale-slb-controller
95+
name: cloudscale-slb-controller

glide.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ import:
1313
- package: github.com/evanphx/json-patch
1414
- package: github.com/imdario/mergo
1515
- package: github.com/spf13/pflag
16-
- package: github.com/namsral/flag
16+
- package: github.com/namsral/flag

internal/event_processor.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ func (processor *EventProcessor) ReAttach(namespace string, name string) (*v1.Se
144144
svc, err := processor.k8sClient.CoreV1().Services(namespace).Get(name, metav1.GetOptions{})
145145
if err != nil {
146146
log.WithFields(log.Fields{
147-
"svc": getKeyFor(namespace, name),
148-
"action": "ReAttach",
149-
"error": err,
147+
"svc": getKeyFor(namespace, name),
148+
"action": "ReAttach",
149+
"error": err,
150150
}).Error("unable to re-attach ip")
151151
processor.emitEvent(
152152
"Warning",
@@ -165,10 +165,10 @@ func (processor *EventProcessor) VerifyIp(svc *v1.Service) error {
165165
ip, serverName, err := processor.verifyIp(svc)
166166
if err != nil {
167167
log.WithFields(log.Fields{
168-
"svc": getKey(svc),
169-
"action": "VerifyIp",
168+
"svc": getKey(svc),
169+
"action": "VerifyIp",
170170
"server_name": serverName,
171-
"error": err,
171+
"error": err,
172172
}).Error("unable to verify ip")
173173
processor.emitEvent(
174174
"Warning",

0 commit comments

Comments
 (0)