mirror of https://github.com/status-im/consul.git
Merge pull request #4822 from hashicorp/mis
A few misc fixes found by go vet
This commit is contained in:
commit
7c51d8345d
|
@ -214,7 +214,6 @@ func (d *ACLResolverTestDelegate) RPC(method string, args interface{}, reply int
|
||||||
panic("Bad Test Implmentation: should provide a policyResolveFn to the ACLResolverTestDelegate")
|
panic("Bad Test Implmentation: should provide a policyResolveFn to the ACLResolverTestDelegate")
|
||||||
}
|
}
|
||||||
panic("Bad Test Implementation: Was the ACLResolver updated to use new RPC methods")
|
panic("Bad Test Implementation: Was the ACLResolver updated to use new RPC methods")
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTestACLResolver(t *testing.T, delegate ACLResolverDelegate, cb func(*ACLResolverConfig)) *ACLResolver {
|
func newTestACLResolver(t *testing.T, delegate ACLResolverDelegate, cb func(*ACLResolverConfig)) *ACLResolver {
|
||||||
|
|
|
@ -446,7 +446,7 @@ func restoreACLBootstrap(header *snapshotHeader, restore *state.Restore, decoder
|
||||||
|
|
||||||
// With V2 ACLs whether bootstrapping has been performed is stored in the index table like nomad
|
// With V2 ACLs whether bootstrapping has been performed is stored in the index table like nomad
|
||||||
// so this "restores" into that index table.
|
// so this "restores" into that index table.
|
||||||
return restore.IndexRestore(&state.IndexEntry{"acl-token-bootstrap", req.ModifyIndex})
|
return restore.IndexRestore(&state.IndexEntry{Key: "acl-token-bootstrap", Value: req.ModifyIndex})
|
||||||
}
|
}
|
||||||
|
|
||||||
func restoreCoordinates(header *snapshotHeader, restore *state.Restore, decoder *codec.Decoder) error {
|
func restoreCoordinates(header *snapshotHeader, restore *state.Restore, decoder *codec.Decoder) error {
|
||||||
|
|
|
@ -210,7 +210,7 @@ func (s *Store) ACLBootstrap(idx, resetIndex uint64, token *structs.ACLToken, le
|
||||||
// We must have initialized before this will ever be possible.
|
// We must have initialized before this will ever be possible.
|
||||||
existing, err := tx.First("index", "id", "acl-token-bootstrap")
|
existing, err := tx.First("index", "id", "acl-token-bootstrap")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Errorf("bootstrap check failed: %v", err)
|
return fmt.Errorf("bootstrap check failed: %v", err)
|
||||||
}
|
}
|
||||||
if existing != nil {
|
if existing != nil {
|
||||||
if resetIndex == 0 {
|
if resetIndex == 0 {
|
||||||
|
|
|
@ -89,7 +89,7 @@ type TestServerConfig struct {
|
||||||
PrimaryDatacenter string `json:"primary_datacenter,omitempty"`
|
PrimaryDatacenter string `json:"primary_datacenter,omitempty"`
|
||||||
ACLDefaultPolicy string `json:"acl_default_policy,omitempty"`
|
ACLDefaultPolicy string `json:"acl_default_policy,omitempty"`
|
||||||
ACLEnforceVersion8 bool `json:"acl_enforce_version_8"`
|
ACLEnforceVersion8 bool `json:"acl_enforce_version_8"`
|
||||||
ACL TestACLs `json:"acl",omitempty`
|
ACL TestACLs `json:"acl,omitempty"`
|
||||||
Encrypt string `json:"encrypt,omitempty"`
|
Encrypt string `json:"encrypt,omitempty"`
|
||||||
CAFile string `json:"ca_file,omitempty"`
|
CAFile string `json:"ca_file,omitempty"`
|
||||||
CertFile string `json:"cert_file,omitempty"`
|
CertFile string `json:"cert_file,omitempty"`
|
||||||
|
|
Loading…
Reference in New Issue