I have the following code using the k8s python client:
config.load_incluster_config()
v1 = client.CoreV1Api()
object_meta = k8s.V1ObjectMeta(generate_name='myprefix',
namespace='my_name_space')
body = k8s.V1Secret(string_data=data, kind='Secret', type='my_type', metadata=object_meta)
api_response = v1.create_namespaced_secret(namespace='my_name_space', body=body)
This creates a secret in my K8s namespace. Since I'm using generate_name it assigned to it some random value with the prefix I gave so the name can be myprefix-fbdsu3 or anything like it.
My question is how do I get the name assigned to that secret after it was created?