vmware / terraform-provider-tanzu-mission-control

Terraform Provider for VMware Tanzu Mission Control
https://registry.terraform.io/providers/vmware/tanzu-mission-control/latest/docs
Mozilla Public License 2.0
37 stars 33 forks source link

tanzu-mission-control_tanzu_kubernetes_cluster fails with error "Couldn't read TKG cluster" #392

Open giovannibaratta opened 8 months ago

giovannibaratta commented 8 months ago

Describe the bug

While creating a tanzu-mission-control_tanzu_kubernetes_cluster in a clean environment, the request failed after several minutes with the error Couldn't read TKG cluster.

│ Error: Couldn't read TKG cluster.
│ Management Cluster Name: h2o-2-23532, Provisioner: tap, Cluster Name: tap-view: get request(v1alpha1/clusters/tap-view/kubeconfig?cli=TANZU_CLI&fullName.managementClusterName=h2o-2-23532&fullName.provisionerName=tap) failed with status : 401 Unauthorized, response: {"error":"could not extract auth context","code":16,"message":"could not extract auth context"}
│ 
│   with tanzu-mission-control_tanzu_kubernetes_cluster.tap_view,
│   on clusters-tap-view.tf line 18, in resource "tanzu-mission-control_tanzu_kubernetes_cluster" "tap_view":
│   18: resource "tanzu-mission-control_tanzu_kubernetes_cluster" "tap_view" {

Even if an error was returned, the cluster was available TMC leaving an unclean state. A second apply fails because the cluster already exist, a manual action is required (import in the state or delete the cluster in TMC).

Reproduction steps

Unknown

source code is available here https://github.com/giovannibaratta/vmware-tanzu-training/tree/main/terraform/stages/50-tmc

Expected behavior

The resource should be created successfully, or a second apply should not result in a conflict.

Additional context

github-actions[bot] commented 1 week ago

'Marking this issue as stale due to inactivity. This helps us focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!'