Improve error handling in cluster install binary
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 328
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 9
Description
**What would you like to be added**:
Improved error handling and reporting from eksanywhere installer
**Why is this needed**:
I believe I have something wrong with my vSphere setup. (as this system is able to deploy EKS-A of the same version using bottlerocket - therefore, the eksanywhere binary would appear to be fine).
It would be nicer/better if when the installer encounters an issue of some sort, if it could 1/ not display output that looks like it crashed 2/ inform the user of what issue was encountered.
Update: I believe it was erroring out due to the fact that I had replicated my `kind: VSphereMachineConfig` without giving the second instance a new name (i.e. I had 2 VSphereMachineConfig with the same name)
```
eksctl anywhere create cluster \
-f $CLUSTER_CONFIG
Warning: VSphereDatacenterConfig configured in insecure mode
Using the new workflow using the controller for management cluster create
Performing setup and validations
Closer failed {"closerType": "*dependencies.Dependencies", "error": "govc returned error when logging out: govc: Post \"https://vsphere.kubernerdes.lab/sdk\": dial tcp: lookup vsphere.kubernerdes.lab on 127.0.0.53:53: no such host\n"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x148 pc=0x2cb023a]
goroutine 1 [running]:
github.com/aws/eks-anywhere/pkg/validations/createvalidations.(*CreateValidations).PreflightValidations(0xc00052d8d0, {0x3ccd898?, 0x56e8b60})
github.com/aws/eks-anywhere/pkg/validations/createvalidations/preflightvalidations.go:72 +0xf1a
```
Contributor guide
Research direction
Start with pkg/validations/createvalidations/preflightvalidations.go:72 and reproduce the failure using the eksctl anywhere create cluster command and the reported cluster configuration. Trace the error from the failed govc connection and define completion as reporting an actionable installation error without panic-style output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100