eks-anywhere
eks-anywhere copied to clipboard
Preflight validate cmd POC
Issue #, if available: Add validate cmd
Description of changes: Add validate cmd to run create cluster validations
Testing (if applicable): To be added
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign pokearu after the PR has been reviewed.
You can assign the PR to them by writing /assign @pokearu in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
Codecov Report
Merging #2858 (59f0ac7) into main (d0a42e7) will increase coverage by
0.90%. The diff coverage is5.55%.
@@ Coverage Diff @@
## main #2858 +/- ##
==========================================
+ Coverage 60.49% 61.40% +0.90%
==========================================
Files 319 324 +5
Lines 26308 26434 +126
==========================================
+ Hits 15916 16232 +316
+ Misses 9081 8927 -154
+ Partials 1311 1275 -36
| Impacted Files | Coverage Ξ | |
|---|---|---|
| pkg/cluster/docker.go | 75.00% <0.00%> (-11.37%) |
:arrow_down: |
| pkg/cluster/snow.go | 68.08% <0.00%> (-2.57%) |
:arrow_down: |
| pkg/cluster/vsphere.go | 74.57% <0.00%> (-4.38%) |
:arrow_down: |
| pkg/workflows/validate.go | 0.00% <0.00%> (ΓΈ) |
|
| pkg/cluster/cloudstack.go | 57.89% <100.00%> (ΓΈ) |
|
| pkg/validations/runner.go | 100.00% <100.00%> (ΓΈ) |
|
| ...g/api/v1alpha1/cloudstackdatacenterconfig_types.go | 55.81% <0.00%> (-9.26%) |
:arrow_down: |
| pkg/curatedpackages/packagecontrollerclient.go | 96.10% <0.00%> (-3.90%) |
:arrow_down: |
| controllers/vsphere_datacenter_controller.go | 11.86% <0.00%> (-2.89%) |
:arrow_down: |
| pkg/api/v1alpha1/cluster.go | 58.87% <0.00%> (-1.74%) |
:arrow_down: |
| ... and 43 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Usage - ./eksctl-anywhere exp validate -f <yaml config file>
Output - valid config example:
β
Validate docker executable
β
Validate cluster
β
Validate kubeconfig path
β
Validate supported provider
β
Validate certificate for registry mirror
β
Create preflight validations pass
β
Connected to server
β
Authenticated to vSphere
β
Datacenter validated
β
Network validated
β
Datastore validated
β
Folder validated
β
Resource pool validated
β
Control plane and Workload templates validated
Provided control plane sshAuthorizedKey is not set or is empty, auto-generating new key pair...
Private key saved to tmpValidate1230314345/eks-a-id_rsa. Use 'ssh -i tmpValidate1230314345/eks-a-id_rsa <username>@<Node-IP-Address>' to login to your cluster node
β
Vsphere Provider setup is valid
Output - invalid config example:
β
Validate docker executable
β Validation failed {"validation": "validate cluster", "error": "failed to validate cluster config name: is not a valid cluster name, cluster names must start with lowercase/uppercase letters and can include numbers and dashes. For instance 'testCluster-123' is a valid name but '123testCluster' is not. ", "remediation": ""}
Error: validations failed
I haven't reviewed this in full but great work!
Do we think its necessary to output so much information? I suspect consumers don't really care that a specific portion of validation succeeded - that feels more like a debug level of logging. I care whether or not the invocation I made makes sense and I can get that from a single line (ideally) saying "Configuration valid".
Closing this POC PR