Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: output cluster context name #25

Open
wicked1133 opened this issue Dec 27, 2022 · 2 comments
Open

Request: output cluster context name #25

wicked1133 opened this issue Dec 27, 2022 · 2 comments

Comments

@wicked1133
Copy link

wicked1133 commented Dec 27, 2022

Hi, could you add/output the cluster context name as its own?

@wicked1133
Copy link
Author

wicked1133 commented Dec 27, 2022

I found a workaround to use. I am uncertain if that is best practice, but it works for me.

output "cluster_context" {
  value = jsondecode(jsonencode(yamldecode(kind_cluster.this.kubeconfig).contexts))[0].name
}

@tehcyx
Copy link
Owner

tehcyx commented Jan 7, 2023

Hi, I'll have to see if I can find a better solution. Luckily until then you already have a workaround. Thanks for documenting the workaround here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants