KES dependency upgrade (#14454)

- Updating KES dependency to v.0.18.0
- Fixing incompatibility issue when checking for errors during KES key creation

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
This commit is contained in:
Lenin Alevski
2022-03-02 23:03:40 -08:00
committed by GitHub
parent f6875bb893
commit 289fcbd08c
5 changed files with 35 additions and 161 deletions

View File

@@ -22,7 +22,8 @@ import (
"errors"
"net/http"
"github.com/minio/kes"
"github.com/minio/minio/internal/kms"
"github.com/minio/madmin-go"
"github.com/minio/minio/internal/auth"
"github.com/minio/minio/internal/config"
@@ -144,7 +145,7 @@ func toAdminAPIErr(ctx context.Context, err error) APIError {
Description: "The policy cannot be removed, as it is in use",
HTTPStatusCode: http.StatusBadRequest,
}
case errors.Is(err, kes.ErrKeyExists):
case kms.KeyExists(err):
apiErr = APIError{
Code: "XMinioKMSKeyExists",
Description: err.Error(),

View File

@@ -820,7 +820,7 @@ func handleCommonEnvVars() {
// This implicitly checks that we can communicate to KES. We don't treat
// a policy error as failure condition since MinIO may not have the permission
// to create keys - just to generate/decrypt data encryption keys.
if err = KMS.CreateKey(defaultKeyID); err != nil && !errors.Is(err, kes.ErrKeyExists) && !errors.Is(err, kes.ErrNotAllowed) {
if err = KMS.CreateKey(defaultKeyID); err != nil && !kms.KeyExists(err) && !errors.Is(err, kes.ErrNotAllowed) {
logger.Fatal(err, "Unable to initialize a connection to KES as specified by the shell environment")
}
GlobalKMS = KMS