Consolidate EKSA_VSPHERE_* Env Var Validation
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 328
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 9
Description
We currently validate EKSA_VSPHERE_* variables in two places: [here](https://github.com/aws/eks-anywhere/blob/16836c512e80e4d1b880691e53b3524d66b55227/pkg/executables/govc.go#L512-L512) and [here](https://github.com/aws/eks-anywhere/blob/16836c512e80e4d1b880691e53b3524d66b55227/pkg/providers/vsphere/envars.go#L11-L11).
We should consolidate this validation logic.
@g-gaston and I were talking recently about the fact that a lot of code pulls data from the environment, treating it as a defacto global state object. We should think about pushing that state into config objects instead. We can then run validations on the config objects as they are created.
Contributor guide
Research direction
Read the validation at pkg/executables/govc.go:512 and pkg/providers/vsphere/envars.go:11 to compare the two EKSA_VSPHERE_* paths. Trace how environment data reaches each validation point, then consolidate the duplicated logic and verify that validation still occurs consistently when the relevant configuration is created.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- infrastructure
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100