agent: fix formatting

This commit is contained in:
Kyle Havlovitz 2018-11-07 02:16:03 -08:00
parent 60bb53d4e6
commit 1a4204f363
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
5 changed files with 43 additions and 43 deletions

View File

@ -623,9 +623,9 @@ func (c *ConsulProvider) generateCA(privateKey string, sn uint64) (string, error
serialNum := &big.Int{} serialNum := &big.Int{}
serialNum.SetUint64(sn) serialNum.SetUint64(sn)
template := x509.Certificate{ template := x509.Certificate{
SerialNumber: serialNum, SerialNumber: serialNum,
Subject: pkix.Name{CommonName: name}, Subject: pkix.Name{CommonName: name},
URIs: []*url.URL{id.URI()}, URIs: []*url.URL{id.URI()},
BasicConstraintsValid: true, BasicConstraintsValid: true,
KeyUsage: x509.KeyUsageCertSign | KeyUsage: x509.KeyUsageCertSign |
x509.KeyUsageCRLSign | x509.KeyUsageCRLSign |

View File

@ -53,9 +53,9 @@ func TestCA(t testing.T, xc *structs.CARoot) *structs.CARoot {
// Create the CA cert // Create the CA cert
template := x509.Certificate{ template := x509.Certificate{
SerialNumber: sn, SerialNumber: sn,
Subject: pkix.Name{CommonName: result.Name}, Subject: pkix.Name{CommonName: result.Name},
URIs: []*url.URL{id.URI()}, URIs: []*url.URL{id.URI()},
BasicConstraintsValid: true, BasicConstraintsValid: true,
KeyUsage: x509.KeyUsageCertSign | KeyUsage: x509.KeyUsageCertSign |
x509.KeyUsageCRLSign | x509.KeyUsageCRLSign |

View File

@ -11,8 +11,8 @@ import (
func TestStateStore_PreparedQuery_isUUID(t *testing.T) { func TestStateStore_PreparedQuery_isUUID(t *testing.T) {
cases := map[string]bool{ cases := map[string]bool{
"": false, "": false,
"nope": false, "nope": false,
"f004177f-2c28-83b7-4229-eacc25fe55d1": true, "f004177f-2c28-83b7-4229-eacc25fe55d1": true,
"F004177F-2C28-83B7-4229-EACC25FE55D1": true, "F004177F-2C28-83B7-4229-EACC25FE55D1": true,
"x004177f-2c28-83b7-4229-eacc25fe55d1": false, // Bad hex "x004177f-2c28-83b7-4229-eacc25fe55d1": false, // Bad hex

View File

@ -64,21 +64,21 @@ func (c *CheckDefinition) CheckType() *CheckType {
Status: c.Status, Status: c.Status,
Notes: c.Notes, Notes: c.Notes,
ScriptArgs: c.ScriptArgs, ScriptArgs: c.ScriptArgs,
AliasNode: c.AliasNode, AliasNode: c.AliasNode,
AliasService: c.AliasService, AliasService: c.AliasService,
HTTP: c.HTTP, HTTP: c.HTTP,
GRPC: c.GRPC, GRPC: c.GRPC,
GRPCUseTLS: c.GRPCUseTLS, GRPCUseTLS: c.GRPCUseTLS,
Header: c.Header, Header: c.Header,
Method: c.Method, Method: c.Method,
TCP: c.TCP, TCP: c.TCP,
Interval: c.Interval, Interval: c.Interval,
DockerContainerID: c.DockerContainerID, DockerContainerID: c.DockerContainerID,
Shell: c.Shell, Shell: c.Shell,
TLSSkipVerify: c.TLSSkipVerify, TLSSkipVerify: c.TLSSkipVerify,
Timeout: c.Timeout, Timeout: c.Timeout,
TTL: c.TTL, TTL: c.TTL,
DeregisterCriticalServiceAfter: c.DeregisterCriticalServiceAfter, DeregisterCriticalServiceAfter: c.DeregisterCriticalServiceAfter,
} }
} }

View File

@ -81,17 +81,17 @@ func TestCheckDefinitionToCheckType(t *testing.T) {
Status: "green", Status: "green",
Notes: "notes", Notes: "notes",
ServiceID: "svcid", ServiceID: "svcid",
Token: "tok", Token: "tok",
ScriptArgs: []string{"/bin/foo"}, ScriptArgs: []string{"/bin/foo"},
HTTP: "someurl", HTTP: "someurl",
TCP: "host:port", TCP: "host:port",
Interval: 1 * time.Second, Interval: 1 * time.Second,
DockerContainerID: "abc123", DockerContainerID: "abc123",
Shell: "/bin/ksh", Shell: "/bin/ksh",
TLSSkipVerify: true, TLSSkipVerify: true,
Timeout: 2 * time.Second, Timeout: 2 * time.Second,
TTL: 3 * time.Second, TTL: 3 * time.Second,
DeregisterCriticalServiceAfter: 4 * time.Second, DeregisterCriticalServiceAfter: 4 * time.Second,
} }
want := &CheckType{ want := &CheckType{
@ -100,15 +100,15 @@ func TestCheckDefinitionToCheckType(t *testing.T) {
Status: "green", Status: "green",
Notes: "notes", Notes: "notes",
ScriptArgs: []string{"/bin/foo"}, ScriptArgs: []string{"/bin/foo"},
HTTP: "someurl", HTTP: "someurl",
TCP: "host:port", TCP: "host:port",
Interval: 1 * time.Second, Interval: 1 * time.Second,
DockerContainerID: "abc123", DockerContainerID: "abc123",
Shell: "/bin/ksh", Shell: "/bin/ksh",
TLSSkipVerify: true, TLSSkipVerify: true,
Timeout: 2 * time.Second, Timeout: 2 * time.Second,
TTL: 3 * time.Second, TTL: 3 * time.Second,
DeregisterCriticalServiceAfter: 4 * time.Second, DeregisterCriticalServiceAfter: 4 * time.Second,
} }
verify.Values(t, "", got.CheckType(), want) verify.Values(t, "", got.CheckType(), want)