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): ...@@ -171,21 +171,22 @@ def get_kubernetes_secret_data(secret_name, namespace):
def store_kubernetes_secret(secret_dict, namespace, update=False): def store_kubernetes_secret(secret_dict, namespace, update=False):
"""Stores either a new secret in the cluster, or updates an existing one.""" """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: if update:
verb = "updated" verb = "updated"
api_response = patch_kubernetes_secret(secret_dict, namespace) api_response = patch_kubernetes_secret(secret_dict, namespace)
else: else:
verb = "created" verb = "created"
api_response = create_from_yaml( 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}") print(f"Secret {verb} with api response: {api_response}")
def patch_kubernetes_secret(secret_dict, namespace): def patch_kubernetes_secret(secret_dict, namespace):
"""Patches secret in the cluster with new data.""" """Patches secret in the cluster with new data."""
apiclient = api_client.ApiClient() api_client_instance = api_client.ApiClient()
api_instance = client.CoreV1Api(apiclient) api_instance = client.CoreV1Api(apiclient)
name = secret_dict["metadata"]["name"] name = secret_dict["metadata"]["name"]
body = {} 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