Skip to content

Commit

Permalink
Add consul token option
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Mar 22, 2019
1 parent 572b4bb commit d3a8699
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 15 deletions.
2 changes: 2 additions & 0 deletions dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ func (a *Agent) StartServer() {
sConfig.Bucket = a.config.Keyspace
case store.REDIS:
sConfig.Password = a.config.BackendPassword
case store.CONSUL:
sConfig.Token = a.config.BackendPassword
}
a.Store = NewStore(a.config.Backend, a.config.BackendMachines, a, a.config.Keyspace, &sConfig)
if err := a.Store.Healthy(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion dkron/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func ConfigFlagSet() *flag.FlagSet {
cmdFlags.String("http-addr", c.HTTPAddr, "Address to bind the UI web server to. Only used when server")
cmdFlags.String("backend", string(c.Backend), "Store backend (etcd|etcdv3|consul|zk|redis|boltdb|dynamodb)")
cmdFlags.StringSlice("backend-machine", c.BackendMachines, "Store backend machines addresses")
cmdFlags.String("backend-password", c.BackendPassword, "Store backend machines password only use redis")
cmdFlags.String("backend-password", c.BackendPassword, "Store backend machines password or token, only REDIS/CONSUL")
cmdFlags.String("profile", c.Profile, "Profile is used to control the timing profiles used")
cmdFlags.StringSlice("join", []string{}, "An initial agent to join with. This flag can be specified multiple times")
cmdFlags.StringSlice("tag", []string{}, "Tag can be specified multiple times to attach multiple key/value tag pairs to the given node, specified as key=value")
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/victorcoder/dkron

require (
github.com/BurntSushi/toml v0.3.0 // indirect
github.com/DataDog/datadog-go v0.0.0-20170427165718-0ddda6bee211 // indirect
github.com/abronan/leadership v0.0.0-20171113102752-76df1b7fa384
github.com/abronan/valkeyrie v0.0.0-20190123051312-61bbc4571a5d
github.com/abronan/valkeyrie v0.0.0-20190313085051-8fd1c7cad28d
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/armon/go-metrics v0.0.0-20171002182731-9a4b6e10bed6
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
Expand Down Expand Up @@ -108,3 +107,5 @@ require (
gopkg.in/vmihailenco/msgpack.v2 v2.9.1 // indirect
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 // indirect
)

replace google.golang.org/grpc => google.golang.org/grpc v1.19.0
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.0 h1:e1/Ivsx3Z0FVTV0NSOv/aVgbUWyQuzj7DDnFblkRvsY=
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DataDog/datadog-go v0.0.0-20170427165718-0ddda6bee211 h1:hOSWYZBOWXZwYN+huYLFKsb4f6uohHgpx6cLlAXOqjA=
github.com/DataDog/datadog-go v0.0.0-20170427165718-0ddda6bee211/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/abronan/leadership v0.0.0-20171113102752-76df1b7fa384 h1:RrhEAhkYDUHltCCL1RX/+5Hz+vPdyfGJZVUkfq3gIWg=
Expand All @@ -9,6 +10,8 @@ github.com/abronan/valkeyrie v0.0.0-20171113095143-2461fc53ec823c81911896e33b8f4
github.com/abronan/valkeyrie v0.0.0-20171113095143-2461fc53ec823c81911896e33b8f4253bb3977e2/go.mod h1:JIGF3QSHRw3C3mvFVynyswy1LEgy+3yDqw6czgY7R+M=
github.com/abronan/valkeyrie v0.0.0-20190123051312-61bbc4571a5d h1:zi7xxDWztTeG37nWfp9Sc9WI+BdVzRDr2aXrIrPa7+4=
github.com/abronan/valkeyrie v0.0.0-20190123051312-61bbc4571a5d/go.mod h1:A/IdrwsPb8nboz577OaOlF9StXVQHPXus26p6ZOEhZM=
github.com/abronan/valkeyrie v0.0.0-20190313085051-8fd1c7cad28d h1:P4aevzwd2Xm9RzPSfOWQMfhAVu5/jGVI3/7BKgoOG94=
github.com/abronan/valkeyrie v0.0.0-20190313085051-8fd1c7cad28d/go.mod h1:A/IdrwsPb8nboz577OaOlF9StXVQHPXus26p6ZOEhZM=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/go-metrics v0.0.0-20171002182731-9a4b6e10bed6 h1:rfTl4Lc+Gfud1YdmAFg99WN4rICM1S65KXBuADdLTms=
Expand Down Expand Up @@ -262,6 +265,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.3.0 h1:FBSsiFRMz3LBeXIomRnVzrQwSDj4ibvcRexLG0LZGQk=
Expand All @@ -274,6 +278,8 @@ google.golang.org/grpc v1.16.0 h1:dz5IJGuC2BB7qXR5AyHNwAUBhZscK2xVez7mznh72sY=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.18.0 h1:IZl7mfBGfbhYx2p2rKRtYgDFw6SBz+kclmxYrCksPPA=
google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
Expand All @@ -291,3 +297,4 @@ gopkg.in/vmihailenco/msgpack.v2 v2.9.1/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 h1:+t9dhfO+GNOIGJof6kPOAenx7YgrZMTdRPV+EsnPabk=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
4 changes: 2 additions & 2 deletions website/content/cli/dkron.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date: 2019-02-21
date: 2019-03-22
title: "dkron"
slug: dkron
url: /cli/dkron/
Expand Down Expand Up @@ -29,4 +29,4 @@ If a machine fails (the leader), a follower will take over and keep running the
* [dkron leave](/cli/dkron_leave/) - Force an agent to leave the cluster
* [dkron version](/cli/dkron_version/) - Show version

###### Auto generated by spf13/cobra on 21-Feb-2019
###### Auto generated by spf13/cobra on 22-Mar-2019
5 changes: 3 additions & 2 deletions website/content/cli/dkron_agent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date: 2019-02-21
date: 2019-03-22
title: "dkron agent"
slug: dkron_agent
url: /cli/dkron_agent/
Expand All @@ -24,6 +24,7 @@ dkron agent [flags]
--advertise-rpc-port int Use the value of rpc-port by default
--backend string Store backend (etcd|etcdv3|consul|zk|redis|boltdb|dynamodb) (default "boltdb")
--backend-machine strings Store backend machines addresses (default [./dkron.db])
--backend-password string Store backend machines password or token, only REDIS/CONSUL
--bind-addr string Address to bind network listeners to (default "0.0.0.0:8946")
--dog-statsd-addr string DataDog Agent address
--dog-statsd-tags strings Datadog tags, specified as key:value
Expand Down Expand Up @@ -61,4 +62,4 @@ dkron agent [flags]

* [dkron](/cli/dkron/) - Open source distributed job scheduling system

###### Auto generated by spf13/cobra on 21-Feb-2019
###### Auto generated by spf13/cobra on 22-Mar-2019
4 changes: 2 additions & 2 deletions website/content/cli/dkron_doc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date: 2019-02-21
date: 2019-03-22
title: "dkron doc"
slug: dkron_doc
url: /cli/dkron_doc/
Expand Down Expand Up @@ -37,4 +37,4 @@ dkron doc [flags]

* [dkron](/cli/dkron/) - Open source distributed job scheduling system

###### Auto generated by spf13/cobra on 21-Feb-2019
###### Auto generated by spf13/cobra on 22-Mar-2019
4 changes: 2 additions & 2 deletions website/content/cli/dkron_keygen.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date: 2019-02-21
date: 2019-03-22
title: "dkron keygen"
slug: dkron_keygen
url: /cli/dkron_keygen/
Expand Down Expand Up @@ -34,4 +34,4 @@ dkron keygen [flags]

* [dkron](/cli/dkron/) - Open source distributed job scheduling system

###### Auto generated by spf13/cobra on 21-Feb-2019
###### Auto generated by spf13/cobra on 22-Mar-2019
4 changes: 2 additions & 2 deletions website/content/cli/dkron_leave.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date: 2019-02-21
date: 2019-03-22
title: "dkron leave"
slug: dkron_leave
url: /cli/dkron_leave/
Expand Down Expand Up @@ -38,4 +38,4 @@ dkron leave [flags]

* [dkron](/cli/dkron/) - Open source distributed job scheduling system

###### Auto generated by spf13/cobra on 21-Feb-2019
###### Auto generated by spf13/cobra on 22-Mar-2019
4 changes: 2 additions & 2 deletions website/content/cli/dkron_version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date: 2019-02-21
date: 2019-03-22
title: "dkron version"
slug: dkron_version
url: /cli/dkron_version/
Expand Down Expand Up @@ -32,4 +32,4 @@ dkron version [flags]

* [dkron](/cli/dkron/) - Open source distributed job scheduling system

###### Auto generated by spf13/cobra on 21-Feb-2019
###### Auto generated by spf13/cobra on 22-Mar-2019

0 comments on commit d3a8699

Please sign in to comment.