Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update preflight validations for Nutanix #4215

Merged
merged 4 commits into from
Dec 5, 2022

Conversation

thunderboltsid
Copy link
Contributor

  • Add new preflight validations for machine specs, endpoint, port, and credentials
  • Refactor the unit tests for validations into table tests

@eks-distro-bot
Copy link
Collaborator

Hi @thunderboltsid. Thanks for your PR.

I'm waiting for a aws member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@eks-distro-bot eks-distro-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 25, 2022
@@ -1,48 +0,0 @@
// Code generated by MockGen. DO NOT EDIT.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems like a stray. We are using the mocks from crypto/mocks instead.

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Merging #4215 (82d8f01) into main (a89d9d2) will increase coverage by 0.01%.
The diff coverage is 91.26%.

@@            Coverage Diff             @@
##             main    #4215      +/-   ##
==========================================
+ Coverage   68.50%   68.52%   +0.01%     
==========================================
  Files         404      404              
  Lines       32847    32934      +87     
==========================================
+ Hits        22501    22567      +66     
- Misses       8903     8919      +16     
- Partials     1443     1448       +5     
Impacted Files Coverage Δ
pkg/providers/nutanix/validator.go 88.17% <85.48%> (-11.83%) ⬇️
pkg/clustermanager/cluster_manager.go 70.69% <100.00%> (+1.28%) ⬆️
pkg/dependencies/factory.go 72.34% <100.00%> (+0.13%) ⬆️
pkg/executables/kubectl.go 54.09% <100.00%> (+0.12%) ⬆️
pkg/providers/nutanix/provider.go 74.21% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@abhinavmpandey08
Copy link
Member

/ok-to-test

@deepakm-ntnx
Copy link
Contributor

/test eks-anywhere-presubmit

@deepakm-ntnx
Copy link
Contributor

deepakm-ntnx commented Dec 3, 2022

Adds following point from #4167

  • Add preflight to validate connection to NutanixDatacenterConfig's endpoint:port using something similar to this
    eks-anywhere/pkg/executables/govc.go

  • Add preflight to validate Nutanix credentials before validating subnets and images

  • Add preflight to validate NutanixDatacenterConfig.endpoint is a valid endpoint

  • Add preflight to validate NutanixDatacenterConfig.port is a valid port

  • Add preflight to validate NutanixDatacenterConfig.additionalTrustBundle, if provided, is a valid PEM encoded cert

  • Add preflight to validate NutanixMachineConfig's memorySize, systemDiskSize, vcpuSockets and vcpusPerSocket

  • Separate out validation errors for cluster/subnet/image instead of wrapping them https://github.com/aws/eks-anywhere/blob/main/pkg/providers/nutanix/validator.go#L45-L55

Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@abhinavmpandey08
Copy link
Member

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavmpandey08

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@abhinavmpandey08
Copy link
Member

/lgtm

@eks-distro-bot eks-distro-bot merged commit ac8d541 into aws:main Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/providers/nutanix lgtm ok-to-test size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants