def create_secret(secret_data={}, namespace="default"): """Store the input dict as a secret in k8s, and return the secret name.""" secret = Secret(namespace=namespace, data=secret_data) # avoid create the secret for same input dict if secret.name not in states._secrets: states._secrets[secret.name] = secret return secret.name
def create_secret( secret_data, namespace="default", name=None, dry_run=False, use_existing=False, ): """Store the input dict as a secret in k8s, and return the secret name.""" secret = Secret( namespace=namespace, data=secret_data, name=name, dry_run=dry_run, use_existing=use_existing, ) # avoid create the secret for same input dict if secret.name not in states._secrets: states._secrets[secret.name] = secret return secret.name