Files
test/keywords/k8s/secret/kubectl_delete_secret_keywords.py
Gabriel Calixto de Paula 20cbf97010 k8s_dashboard_access part4
finishing up the steps that create the necessary k8s resources that are
present in the file k8s_dashboard.yaml

Change-Id: Iaa506e3d3748bc4a3f64114fd463245406432fc7
Signed-off-by: Gabriel Calixto de Paula <gabrielcalixto9@gmail.com>
2025-02-19 10:06:39 -05:00

31 lines
787 B
Python

from keywords.base_keyword import BaseKeyword
from keywords.k8s.k8s_command_wrapper import export_k8s_config
class KubectlDeleteSecretsKeywords(BaseKeyword):
"""
Keywords for delete secrets
"""
def __init__(self, ssh_connection):
"""
Constructor
Args:
ssh_connection:
"""
self.ssh_connection = ssh_connection
def delete_secret(self, secret_name: str, namespace: str) -> str:
"""
Deletes the secret
Args:
secret_name (): the secret
Returns: the output
"""
output = self.ssh_connection.send(export_k8s_config(f"kubectl delete -n {namespace} secret {secret_name}"))
self.validate_success_return_code(self.ssh_connection)
return output