cleanup: remove unused MissingPassphrase error type

Storing a passphrase is now done while the volume is created. There is
no need to (re)generate a passphrase when it can not be found.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-02-15 10:56:22 +01:00 committed by mergify[bot]
parent 9b6c2117f3
commit dc81e001cf
3 changed files with 2 additions and 12 deletions

View File

@ -67,11 +67,6 @@ type EncryptionKMS interface {
GetID() string
}
// MissingPassphrase is an error instructing to generate new passphrase.
type MissingPassphrase struct {
error
}
// SecretsKMS is default KMS implementation that means no KMS is in use.
type SecretsKMS struct {
passphrase string

View File

@ -331,9 +331,7 @@ func (vc *vaultConnection) GetID() string {
// data.data.passphrase structure.
func (kms *VaultKMS) GetPassphrase(key string) (string, error) {
s, err := kms.secrets.GetSecret(filepath.Join(kms.vaultPassphrasePath, key), kms.keyContext)
if errors.Is(err, loss.ErrInvalidSecretId) {
return "", MissingPassphrase{err}
} else if err != nil {
if err != nil {
return "", err
}

View File

@ -25,7 +25,6 @@ import (
"strconv"
"github.com/hashicorp/vault/api"
loss "github.com/libopenstorage/secrets"
apierrs "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@ -351,9 +350,7 @@ func (kms *VaultTokensKMS) initCertificates(config map[string]interface{}) error
// data.data.passphrase structure.
func (kms *VaultTokensKMS) GetPassphrase(key string) (string, error) {
s, err := kms.secrets.GetSecret(key, kms.keyContext)
if errors.Is(err, loss.ErrInvalidSecretId) {
return "", MissingPassphrase{err}
} else if err != nil {
if err != nil {
return "", err
}