aws / aws/eks-anywhere

Consolidate EKSA_VSPHERE_* Env Var Validation

Open
#3,071 0 comments 0 reactions 0 assignees View on GitHub
area/providers/vsphere kind/cleanup team/cli
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.