Skip to content

Commit

Permalink
chore(pre-commit): go-fmt & stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Toni Tauro <[email protected]>
  • Loading branch information
eyenx committed May 12, 2022
1 parent 8b3bbdd commit 22780b2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/TekWizely/pre-commit-golang
rev: v1.0.0-beta.5
hooks:
- id: go-fmt
- id: go-vet-mod
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-symlinks
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-aws-credentials
args:
- --allow-missing-credentials
- id: detect-private-key
- id: forbid-new-submodules
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ The following annotations on services of type `LoadBalancer` are supported:

The following configuration flags are supported:

- `-cloudscale-token`, `CLOUDSCALE_TOKEN`, no default, required: cloudscale.ch API token with
- `-cloudscale-token`, `CLOUDSCALE_TOKEN`, no default, required: cloudscale.ch API token with
write access
- `-ip-limit`, `IP_LIMIT`, default `5`: maximum number of floating ips that are allowed to exist on
the cloudscale.ch account; this is used as an additional guard in case this controller is out of
control and would create an infinite amount of floating ips
- `-controller-id`, `CONTROLLER_ID`, no default: if set, the controller will only process services
with a `linkyard.ch/slb-controller-id` annotation set to this value
- `-leader-election-configmap`, `LEADER_ELECTION_CONFIGMAP`, no default: name of the `ConfigMap`
- `-leader-election-configmap`, `LEADER_ELECTION_CONFIGMAP`, no default: name of the `ConfigMap`
to use for leader election
- `-leader-election-namespace` `LEADER_ELECTION_NAMESPACE`, no default: name of the namespace where
- `-leader-election-namespace` `LEADER_ELECTION_NAMESPACE`, no default: name of the namespace where
the `ConfigMap` for leader election is located at
- `-leader-election-node`, `LEADER_ELECTION_NODE`, no default: name of the pod
- `-leader-election-ttl`, `LEADER_ELECTION_TTL`, default `10s`: TTL for leader election, e.g. `10s`;
Expand All @@ -36,7 +36,7 @@ The following configuration flags are supported:
`Panic`, `Fatal`, `Error`, `Warn`, `Info`, `Debug`, `Trace`
- `-kubeconfig`, `KUBECONFIG`, no default, not required: path to a kubernetes kubconfig file; this
is not required when running inside a kubernetes cluster
- `-fake-cloudscale-client`, `FAKE_CLOUDSCALE_CLIENT`: set to `true` to use a fake cloudscale.ch
- `-fake-cloudscale-client`, `FAKE_CLOUDSCALE_CLIENT`: set to `true` to use a fake cloudscale.ch
API client
- `-chaos-chance`, `CHAOS_CHANCE`, default `0`: chance of a call to one of the fake components failing;
- `-chaos-chance`, `CHAOS_CHANCE`, default `0`: chance of a call to one of the fake components failing;
range `[0.0,1,0)`
2 changes: 1 addition & 1 deletion cmd/cloudscale_slb_controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Flags:
-cloudscale-token cloudscale.ch API token [CLOUDSCALE_TOKEN]
-ip-limit maximum number of floating ips that are allowed to exist on the
cloudscale.ch account (default: 5); used to make sure we don't go
cloudscale.ch account (default: 5); used to make sure we don't go
bankrupt if this component runs amok [IP_LIMIT]
-kubeconfig path to a kubernetes kubeconfig [KUBECONFIG]
Expand Down
2 changes: 1 addition & 1 deletion deploy/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ roleRef:
name: cloudscale-slb-controller
subjects:
- kind: ServiceAccount
name: cloudscale-slb-controller
name: cloudscale-slb-controller
2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ import:
- package: github.com/evanphx/json-patch
- package: github.com/imdario/mergo
- package: github.com/spf13/pflag
- package: github.com/namsral/flag
- package: github.com/namsral/flag
12 changes: 6 additions & 6 deletions internal/event_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ func (processor *EventProcessor) ReAttach(namespace string, name string) (*v1.Se
svc, err := processor.k8sClient.CoreV1().Services(namespace).Get(name, metav1.GetOptions{})
if err != nil {
log.WithFields(log.Fields{
"svc": getKeyFor(namespace, name),
"action": "ReAttach",
"error": err,
"svc": getKeyFor(namespace, name),
"action": "ReAttach",
"error": err,
}).Error("unable to re-attach ip")
processor.emitEvent(
"Warning",
Expand All @@ -165,10 +165,10 @@ func (processor *EventProcessor) VerifyIp(svc *v1.Service) error {
ip, serverName, err := processor.verifyIp(svc)
if err != nil {
log.WithFields(log.Fields{
"svc": getKey(svc),
"action": "VerifyIp",
"svc": getKey(svc),
"action": "VerifyIp",
"server_name": serverName,
"error": err,
"error": err,
}).Error("unable to verify ip")
processor.emitEvent(
"Warning",
Expand Down

0 comments on commit 22780b2

Please sign in to comment.