mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
make-fmt (#24940)
This commit is contained in:
parent
d90c7e8ab5
commit
fb71d7f3c8
20 changed files with 0 additions and 29 deletions
|
|
@ -219,7 +219,6 @@ func (b *backend) clientEC2(ctx context.Context, s logical.Storage, region, acco
|
|||
// Create an AWS config object using a chain of providers
|
||||
var awsConfig *aws.Config
|
||||
awsConfig, err = b.getClientConfig(ctx, s, region, stsRole, accountID, "ec2")
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -279,7 +278,6 @@ func (b *backend) clientIAM(ctx context.Context, s logical.Storage, region, acco
|
|||
// Create an AWS config object using a chain of providers
|
||||
var awsConfig *aws.Config
|
||||
awsConfig, err = b.getClientConfig(ctx, s, region, stsRole, accountID, "iam")
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ func TestBackend_pathConfigClient(t *testing.T) {
|
|||
Data: data,
|
||||
Storage: storage,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ func TestBackend_pathIam(t *testing.T) {
|
|||
Data: data,
|
||||
Storage: storage,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,7 +297,6 @@ func createRole(t *testing.T, roleName, awsAccountID string, policyARNs []string
|
|||
RoleName: aws.String(roleName), // Required
|
||||
}
|
||||
_, err = svc.AttachRolePolicy(attachment)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("AWS AttachRolePolicy failed: %v", err)
|
||||
}
|
||||
|
|
@ -465,7 +464,6 @@ func deleteTestRole(roleName string) error {
|
|||
|
||||
log.Printf("[INFO] AWS DeleteRole: %s", roleName)
|
||||
_, err = svc.DeleteRole(params)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("[WARN] AWS DeleteRole failed: %v", err)
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -453,7 +453,6 @@ func (b *backend) secretAccessKeysCreate(
|
|||
Tags: tags,
|
||||
UserName: &username,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return logical.ErrorResponse("Error adding tags to user: %s", err), awsutil.CheckAWSError(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ func (b *backend) reloadBackend(ctx context.Context, storage logical.Storage) er
|
|||
err = b.Backend.Initialize(ctx, &logical.InitializationRequest{
|
||||
Storage: storage,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ func (a *ociMethod) Authenticate(context.Context, *api.Client) (string, http.Hea
|
|||
signer := common.DefaultRequestSigner(a.configurationProvider)
|
||||
|
||||
err = signer.Sign(request)
|
||||
|
||||
if err != nil {
|
||||
return "", nil, nil, fmt.Errorf("error signing authentication request: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ func TestKvMetadataPutCommand_CustomMetadata(t *testing.T) {
|
|||
}
|
||||
|
||||
metadata, err = client.Logical().Read(metaFullPath)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("Metadata read error: %#v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ func GetFingerprints(pgpKeys []string, entities []*openpgp.Entity) ([]string, er
|
|||
if entities == nil {
|
||||
var err error
|
||||
entities, err = GetEntities(pgpKeys)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -529,7 +529,6 @@ func (d *DynamoDBBackend) batchWriteRequests(requests []*dynamodb.WriteRequest)
|
|||
output, err = d.client.BatchWriteItem(&dynamodb.BatchWriteItemInput{
|
||||
RequestItems: batch,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,7 +451,6 @@ func (f *FDBBackend) Put(ctx context.Context, entry *physical.Entry) error {
|
|||
|
||||
return nil, nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("put failed for item %s: %w", entry.Key, err)
|
||||
}
|
||||
|
|
@ -509,7 +508,6 @@ func (f *FDBBackend) Delete(ctx context.Context, key string) error {
|
|||
|
||||
return nil, nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("delete failed for item %s: %w", key, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ func compareDBs(t *testing.T, boltDB1, boltDB2 *bolt.DB, dataOnly bool) error {
|
|||
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ func TestZooKeeperBackend(t *testing.T) {
|
|||
randPath := fmt.Sprintf("/vault-%d", time.Now().Unix())
|
||||
acl := zk.WorldACL(zk.PermAll)
|
||||
_, err = client.Create(randPath, []byte("hi"), int32(0), acl)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
|
@ -73,7 +72,6 @@ func TestZooKeeperHABackend(t *testing.T) {
|
|||
randPath := fmt.Sprintf("/vault-ha-%d", time.Now().Unix())
|
||||
acl := zk.WorldACL(zk.PermAll)
|
||||
_, err = client.Create(randPath, []byte("hi"), int32(0), acl)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1284,7 +1284,6 @@ func signCertificate(data *CreationBundle, randReader io.Reader) (*ParsedCertBun
|
|||
}
|
||||
|
||||
certBytes, err = x509.CreateCertificate(randReader, certTemplate, caCert, data.CSR.PublicKey, data.SigningBundle.PrivateKey)
|
||||
|
||||
if err != nil {
|
||||
return nil, errutil.InternalError{Err: fmt.Sprintf("unable to create certificate: %s", err)}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,7 +291,6 @@ func (d *Runner) StartNewService(ctx context.Context, addSuffix, forceLocalAddr
|
|||
config = c
|
||||
return nil
|
||||
}, bo)
|
||||
|
||||
if err != nil {
|
||||
if !d.RunOptions.DoNotAutoRemove {
|
||||
cleanup()
|
||||
|
|
|
|||
|
|
@ -1387,7 +1387,6 @@ func (a *ActivityLog) HandleEndOfMonth(ctx context.Context, currentTime time.Tim
|
|||
// empty when it returns, but dropping some measurements is acceptable.
|
||||
// We use force=true here in case an entry didn't appear this month
|
||||
err = a.saveCurrentSegmentToStorageLocked(ctx, true)
|
||||
|
||||
// Don't return this error, just log it, we are done with that segment anyway.
|
||||
if err != nil {
|
||||
a.logger.Warn("last save of segment failed", "error", err)
|
||||
|
|
|
|||
|
|
@ -149,7 +149,6 @@ func TestKV_Patch_Audit(t *testing.T) {
|
|||
resp, err = kvRequestWithRetry(t, func() (interface{}, error) {
|
||||
return c.Logical().JSONMergePatch(context.Background(), "kv/data/foo", patchData)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("patch request failed, err: %#v, resp: %#v\n", err, resp)
|
||||
}
|
||||
|
|
@ -210,7 +209,6 @@ func TestKV_Patch_RootToken(t *testing.T) {
|
|||
|
||||
return client.Logical().Write("kv/data/foo", data)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -224,7 +222,6 @@ func TestKV_Patch_RootToken(t *testing.T) {
|
|||
}
|
||||
return client.Logical().JSONMergePatch(context.Background(), "kv/data/foo", data)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -642,7 +642,6 @@ func TestIdentityStore_AliasMove_DuplicateAccessor(t *testing.T) {
|
|||
aliasReq.Data = updateData
|
||||
aliasReq.Path = "entity-alias/id/" + alias2ID
|
||||
resp, err = is.HandleRequest(ctx, aliasReq)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -715,7 +714,6 @@ func TestIdentityStore_AliasUpdate_DuplicateAccessor(t *testing.T) {
|
|||
aliasReq.Data = updateData
|
||||
aliasReq.Path = "entity-alias/id/" + alias2ID
|
||||
resp, err = is.HandleRequest(ctx, aliasReq)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -769,7 +767,6 @@ func TestIdentityStore_AliasCreate_DuplicateAccessor(t *testing.T) {
|
|||
|
||||
// This will try to create a new alias with the same accessor and entity
|
||||
resp, err = is.HandleRequest(ctx, aliasReq)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -702,7 +702,6 @@ func (c *Core) handleCancelableRequest(ctx context.Context, req *logical.Request
|
|||
requestBodyToken = token.(string)
|
||||
if IsSSCToken(token.(string)) {
|
||||
token, err = c.CheckSSCToken(ctx, token.(string), c.isLoginRequest(ctx, req), c.perfStandby)
|
||||
|
||||
// If we receive an error from CheckSSCToken, we can assume the token is bad somehow, and the client
|
||||
// should receive a 403 bad token error like they do for all other invalid tokens, unless the error
|
||||
// specifies that we should forward the request or retry the request.
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ func (c *Core) storeVersionEntry(ctx context.Context, vaultVersion *VaultVersion
|
|||
if force {
|
||||
// avoid storage lookup and write immediately
|
||||
err = c.barrier.Put(ctx, newEntry)
|
||||
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
@ -63,7 +62,6 @@ func (c *Core) storeVersionEntry(ctx context.Context, vaultVersion *VaultVersion
|
|||
}
|
||||
|
||||
err = c.barrier.Put(ctx, newEntry)
|
||||
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue