Skip to content
Snippets Groups Projects
Unverified Commit be2a8a21 authored by Varac's avatar Varac
Browse files

Rename apiclient to api_client_instance

parent ba2aa7b2
No related branches found
No related tags found
No related merge requests found
......@@ -171,21 +171,22 @@ def get_kubernetes_secret_data(secret_name, namespace):
def store_kubernetes_secret(secret_dict, namespace, update=False):
"""Stores either a new secret in the cluster, or updates an existing one."""
apiclient = api_client.ApiClient()
api_client_instance = api_client.ApiClient()
if update:
verb = "updated"
api_response = patch_kubernetes_secret(secret_dict, namespace)
else:
verb = "created"
api_response = create_from_yaml(
apiclient, yaml_objects=[secret_dict], namespace=namespace
api_client_instance, yaml_objects=[
secret_dict], namespace=namespace
)
print(f"Secret {verb} with api response: {api_response}")
def patch_kubernetes_secret(secret_dict, namespace):
"""Patches secret in the cluster with new data."""
apiclient = api_client.ApiClient()
api_client_instance = api_client.ApiClient()
api_instance = client.CoreV1Api(apiclient)
name = secret_dict["metadata"]["name"]
body = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment