mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
ci: fix all linter errors found in golangci-lint
Fixing all the linter errors found in golang-ci lint v1.46.2 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
9e5cad173d
commit
1952a9b4b3
@ -199,8 +199,7 @@ func (kms *awsMetadataKMS) EncryptDEK(volumeID, plainDEK string) (string, error)
|
||||
|
||||
// base64 encode the encrypted DEK, so that storing it should not have
|
||||
// issues
|
||||
encryptedDEK :=
|
||||
base64.StdEncoding.EncodeToString(result.CiphertextBlob)
|
||||
encryptedDEK := base64.StdEncoding.EncodeToString(result.CiphertextBlob)
|
||||
|
||||
return encryptedDEK, nil
|
||||
}
|
||||
|
@ -269,7 +269,8 @@ func RegisterProvider(provider Provider) bool {
|
||||
func (kf *kmsProviderList) buildKMS(
|
||||
tenant string,
|
||||
config map[string]interface{},
|
||||
secrets map[string]string) (EncryptionKMS, error) {
|
||||
secrets map[string]string,
|
||||
) (EncryptionKMS, error) {
|
||||
providerName, err := getProvider(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -138,7 +138,8 @@ func initSecretsMetadataKMS(args ProviderInitArgs) (EncryptionKMS, error) {
|
||||
// fetchEncryptionPassphrase fetches encryptionPassphrase from user provided secret.
|
||||
func (kms secretsMetadataKMS) fetchEncryptionPassphrase(
|
||||
config map[string]interface{},
|
||||
defaultNamespace string) (string, error) {
|
||||
defaultNamespace string,
|
||||
) (string, error) {
|
||||
var (
|
||||
secretName string
|
||||
secretNamespace string
|
||||
|
@ -302,6 +302,7 @@ func (vc *vaultConnection) Destroy() {
|
||||
tmpFile, ok := vc.vaultConfig[api.EnvVaultCACert]
|
||||
if ok {
|
||||
// ignore error on failure to remove tmpfile (gosec complains)
|
||||
//nolint:forcetypeassert // ignore error on failure to remove tmpfile
|
||||
_ = os.Remove(tmpFile.(string))
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ func TestInitVaultTokensKMS(t *testing.T) {
|
||||
// add tenant "bob"
|
||||
bob := make(map[string]interface{})
|
||||
bob["vaultAddress"] = "https://vault.bob.example.org"
|
||||
//nolint:forcetypeassert // as its a test we dont need to check assertion here.
|
||||
args.Config["tenants"].(map[string]interface{})["bob"] = bob
|
||||
|
||||
_, err = initVaultTokensKMS(args)
|
||||
|
Reference in New Issue
Block a user