Browse Source

A few misc fixes found by go vet

pull/4822/head
Matt Keeler 6 years ago
parent
commit
34b53e7099
  1. 1
      agent/consul/acl_test.go
  2. 2
      agent/consul/fsm/snapshot_oss.go
  3. 2
      agent/consul/state/acl.go
  4. 2
      testutil/server.go

1
agent/consul/acl_test.go

@ -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 Implementation: Was the ACLResolver updated to use new RPC methods")
return nil
}
func newTestACLResolver(t *testing.T, delegate ACLResolverDelegate, cb func(*ACLResolverConfig)) *ACLResolver {

2
agent/consul/fsm/snapshot_oss.go

@ -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
// 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 {

2
agent/consul/state/acl.go

@ -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.
existing, err := tx.First("index", "id", "acl-token-bootstrap")
if err != nil {
fmt.Errorf("bootstrap check failed: %v", err)
return fmt.Errorf("bootstrap check failed: %v", err)
}
if existing != nil {
if resetIndex == 0 {

2
testutil/server.go

@ -89,7 +89,7 @@ type TestServerConfig struct {
PrimaryDatacenter string `json:"primary_datacenter,omitempty"`
ACLDefaultPolicy string `json:"acl_default_policy,omitempty"`
ACLEnforceVersion8 bool `json:"acl_enforce_version_8"`
ACL TestACLs `json:"acl",omitempty`
ACL TestACLs `json:"acl,omitempty"`
Encrypt string `json:"encrypt,omitempty"`
CAFile string `json:"ca_file,omitempty"`
CertFile string `json:"cert_file,omitempty"`

Loading…
Cancel
Save