Skip to content

Commit

Permalink
Fixed PVKeyrotation tests failures (#10628)
Browse files Browse the repository at this point in the history
Signed-off-by: Parag Kamble <[email protected]>
  • Loading branch information
paraggit authored Oct 9, 2024
1 parent 5c4ed11 commit c2e8adc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocs_ci/helpers/keyrotation_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ocs_ci.ocs.resources.pvc import get_deviceset_pvcs
from ocs_ci.ocs.exceptions import UnexpectedBehaviour
from ocs_ci.utility.retry import retry
from ocs_ci.utility.kms import get_kms_deployment
from ocs_ci.utility.kms import get_kms_details

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -356,7 +356,7 @@ def compare_old_with_new_keys():
class PVKeyrotation(KeyRotation):
def __init__(self, sc_obj):
self.sc_obj = sc_obj
self.kms = get_kms_deployment()
self.kms = get_kms_details()

def annotate_storageclass_key_rotation(self, schedule="@weekly"):
"""
Expand Down
10 changes: 10 additions & 0 deletions ocs_ci/utility/kms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,16 @@ def update_csi_kms_vault_connection_details(update_config):
run_cmd(f"oc apply -f {resource_data_yaml.name}", timeout=300)


def get_kms_details():
kms_provider = config.ENV_DATA["KMS_PROVIDER"]
try:
return kms_map[kms_provider]()
except KeyError:
raise KMSNotSupported(
f"Not a supported KMS deployment , provider: {kms_provider}"
)


def get_kms_deployment():
provider = config.ENV_DATA["KMS_PROVIDER"]
if not config.ENV_DATA.get("encryption_at_rest"):
Expand Down

0 comments on commit c2e8adc

Please sign in to comment.