misc lint

This commit is contained in:
Thomas Tendyck 2022-03-25 12:50:16 +01:00 committed by Thomas Tendyck
parent cece88b6a0
commit 6bbb783af8
3 changed files with 4 additions and 5 deletions

View File

@ -380,7 +380,7 @@ type stubRoleAssignmentsAPI struct {
} }
func (a *stubRoleAssignmentsAPI) Create(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error) { func (a *stubRoleAssignmentsAPI) Create(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error) {
a.createCounter += 1 a.createCounter++
if len(a.createErrors) == 0 { if len(a.createErrors) == 0 {
return authorization.RoleAssignment{}, nil return authorization.RoleAssignment{}, nil
} }

View File

@ -40,8 +40,7 @@ func (m *fakeAWSClient) GenerateDataKey(ctx context.Context, params *kms.Generat
} }
kekID := *params.KeyId kekID := *params.KeyId
_, ok := m.kekPool[kekID] if _, ok := m.kekPool[kekID]; !ok {
if !ok {
return nil, kmsInterface.ErrKEKUnknown return nil, kmsInterface.ErrKEKUnknown
} }
@ -100,7 +99,7 @@ func (m *fakeAWSClient) DescribeKey(ctx context.Context, params *kms.DescribeKey
// CreateKey stores a key in fakeKMSStore. // CreateKey stores a key in fakeKMSStore.
func (m *fakeAWSClient) CreateKey(ctx context.Context, params *kms.CreateKeyInput, optFns ...func(*kms.Options)) (*kms.CreateKeyOutput, error) { func (m *fakeAWSClient) CreateKey(ctx context.Context, params *kms.CreateKeyInput, optFns ...func(*kms.Options)) (*kms.CreateKeyOutput, error) {
m.keyIDCount += 1 m.keyIDCount++
kekID := strconv.Itoa(m.keyIDCount) kekID := strconv.Itoa(m.keyIDCount)
if _, ok := m.kekPool[kekID]; ok { if _, ok := m.kekPool[kekID]; ok {

View File

@ -46,7 +46,7 @@ func NewHSM(ctx context.Context, vaultName string, store kms.Storage, opts *Opts
return nil, fmt.Errorf("creating HSM client: %w", err) return nil, fmt.Errorf("creating HSM client: %w", err)
} }
// `azkeys.NewClient()` does not error if the vault is non existant // `azkeys.NewClient()` does not error if the vault is non existent
// Test here if we can reach the vault, and error otherwise // Test here if we can reach the vault, and error otherwise
pager := client.ListKeys(&azkeys.ListKeysOptions{MaxResults: to.Int32Ptr(2)}) pager := client.ListKeys(&azkeys.ListKeysOptions{MaxResults: to.Int32Ptr(2)})
pager.NextPage(ctx) pager.NextPage(ctx)