mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: address golangci 'usetesting' linter issues
When a context.Context is needed in a unit test, t.Context() should be used instead of creating a new one with context.TODO() or context.Background(). Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
be5462cf62
commit
457ffe884a
@ -17,7 +17,6 @@ limitations under the License.
|
||||
package kms
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -93,7 +92,7 @@ func TestWorkflowSecretsMetadataKMS(t *testing.T) {
|
||||
// plainDEK is the (LUKS) passphrase for the volume
|
||||
plainDEK := "usually created with generateNewEncryptionPassphrase()"
|
||||
|
||||
ctx := context.TODO()
|
||||
ctx := t.Context()
|
||||
|
||||
// with missing encryptionPassphraseKey, encrypting should fail
|
||||
_, err = kms.EncryptDEK(ctx, volumeID, plainDEK)
|
||||
|
Reference in New Issue
Block a user