hashicorp / terraform-k8s

Terraform Cloud Operator for Kubernetes

Home Page:https://learn.hashicorp.com/tutorials/terraform/kubernetes-operator?in=terraform/kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Workspace Name Prefixed With Namespace

tsunamishaun opened this issue Β· comments

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

By default the operator prefixes workspace names with the namespace of the CR. This can't be overridden and makes referencing workspace state harder (i.e. needing to know namespace). I am proposing making this a flag in the CR or simply turning it off by default and just using Name, letting a chart or whatever is generating the CR be responsible for naming the resource.

workspace := fmt.Sprintf("%s-%s", instance.Namespace, instance.Name)

I wanted to leave the decision up to those that use this currently, mostly because mistakenly changing the name of a workspace could be catastrophic. Option 1 could be the path of least resistance, based on the outcome here I am able to create a PR and another for the chart.