Skip to content

Commit 15ced93

Browse files
authored
Merge pull request #19 from ncode/juliano/refactoring
updates and refactoring
2 parents 0777361 + b22e2bc commit 15ced93

File tree

18 files changed

+1882
-206
lines changed

18 files changed

+1882
-206
lines changed

cmd/run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616
package cmd
1717

1818
import (
19-
"golang.org/x/net/context"
19+
"context"
2020
"os"
2121

2222
"github.com/ncode/ballot/internal/ballot"
@@ -38,6 +38,7 @@ var runCmd = &cobra.Command{
3838
"caller": "run",
3939
"step": "New",
4040
}).Error(err)
41+
os.Exit(1)
4142
}
4243

4344
err = b.Run()

configs/consul_with_3_nodes/consul-agent-1/my-service.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

configs/consul_with_3_nodes/consul-agent-2/my-service.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

configs/consul_with_3_nodes/consul-agent-3/my-service.json

Lines changed: 0 additions & 15 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM scratch
1+
FROM oraclelinux:9
22
COPY ballot /ballot
33
ENTRYPOINT ["/ballot"]
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ build:
77

88
docker-build:
99
docker build -t ncode/ballot:dev .
10+
rm ballot
1011

1112
up:
1213
docker compose up
1314

14-
dowm:
15-
docker compose dowm
15+
down:
16+
docker compose down

configs/consul_with_3_nodes/ballot-1/ballot.yaml renamed to configs/development/ballot-1/ballot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ election:
55
enabled:
66
- my-service
77
services:
8-
my_service:
8+
my-service:
99
id: my-service1
1010
key: service/my-service
1111
token:

configs/consul_with_3_nodes/ballot-2/ballot.yaml renamed to configs/development/ballot-2/ballot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ election:
55
enabled:
66
- my-service
77
services:
8-
my_service:
8+
my-service:
99
id: my-service2
1010
key: service/my-service
1111
token:

configs/consul_with_3_nodes/ballot-3/ballot.yaml renamed to configs/development/ballot-3/ballot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ election:
55
enabled:
66
- my-service
77
services:
8-
my_service:
8+
my-service:
99
id: my-service3
1010
key: service/my-service
1111
token:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
service {
2+
id = "my-service1"
3+
name = "my-service"
4+
tags = ["v1"]
5+
address = "127.0.0.1"
6+
port = 8000
7+
8+
enable_tag_override = true
9+
10+
check {
11+
ID = "service:election1"
12+
DeregisterCriticalServiceAfter = "90m"
13+
Args = ["/bin/ls", "/state/ready1"]
14+
Interval = "10s"
15+
timeout = "5s"
16+
}
17+
18+
weights {
19+
passing = 10
20+
warning = 1
21+
}
22+
}

0 commit comments

Comments
 (0)