-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Nutanix VM image preflight check #1130
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
Conversation
4780b5f
to
265a77a
Compare
fb9d8a1
to
f0cb9f8
Compare
Preflight failures work nicely! Not sure it's what we want here but at least it works!
|
The Nutanix e2e test is failing because it uses imageLookup, and the check does not yet support that. I'm working on it. Update: I will add support for imageLookup in a separate PR. For now, we will allow it with a warning. > kubectl create --dry-run=server -f test-cluster.yaml
Warning: cluster.spec.topology.workers.machineDeployments[.name=md-0].variables[.name=workerConfig].value.nutanix.machineDetails uses imageLookup, which is not yet supported by checks
cluster.cluster.x-k8s.io/dlag created (server dry run) |
ca0bc94
to
f440ff1
Compare
From @yanhua121: If the credential check fails, failures from other checks are just noise. Can we exclude them? Update: Addressed in 7cc0676 |
98103a7
to
a1a08d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, had a question on the clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
6ab50f2
to
93299d2
Compare
|
93299d2
to
365033c
Compare
Automated PR Comment From Black Duck SCA❌ Found dependencies violating policy!
|
Neither of the two failing checks failed before... |
Blackduck is giving a false negative here. github.com/samber/lo has had an MIT license since its initial commit. And it has the same license in the v1.51.0 tag: https://github.com/samber/lo/blob/v1.51.0/LICENSE (For reference, the dependency was changed by #1160, and the Blackduck scan also failed for the same reason there) |
Allow imageLookup with warning
Mock nutanix clients to allow unit tests
* Refactor nutanixChecker to allow unit tests of all checks. * Add unit tests. * Fix field reported when spec init for worker spec fails. * Fix handling of credentials "Insecure" option. * Use lowercase 'v' in errors that refers to the Nutanix client
Use the correct check name
Run VM Image check only if Nutanix clients are initialized. This avoids returning errors that are not actionable. The user will see an error from the credentials check only.
Remove unused v4 client mock
Merge separate v3 and v4 clients into one
Remove unused code
Implement Check interface.
Refactor to simplify, and remove need to checker factory.
Address linter complaint
97075a2
to
ed9b787
Compare
Rebased because #1164 merged. |
🤖 I have created a release *beep* *boop* --- ## 0.30.0 (2025-06-24) <!-- Release notes generated using configuration in .github/release.yaml at main --> ## What's Changed ### Exciting New Features 🎉 * feat: Build with Go 1.24.4 to fix CVEs by @jimmidyson in #1157 * feat: add requests and limits to registry containers by @dkoshkin in #1158 * feat: Add preflight checks framework by @dlipovetsky in #1129 * feat: Preflight check opt-out by @dlipovetsky in #1156 * feat: Nutanix VM image preflight check by @dlipovetsky in #1130 * feat: update addons by @dkoshkin in #1168 * feat: Enforce MD replicas within cluster autoscaler bounds by @jimmidyson in #1169 * feat(preflight): Storage container checks for Nutanix by @thunderboltsid in #1136 * feat: update Nutanix CSI to 3.3.4 by @dkoshkin in #1179 ### Fixes 🔧 * fix: update CNCF registry version to 2.3.4, app version 2.8.3 by @dkoshkin in #1150 * fix: registry addon headless service port by @dkoshkin in #1159 * fix: preserve registry addon root CA on move by @dkoshkin in #1155 * fix: Add noderegistration patch to previous handler by @jimmidyson in #1177 ### Other Changes * build: include regclient/regsync image for registry addon by @dkoshkin in #1148 * test: Add update test helpers by @jimmidyson in #1162 * test(e2e): Nutanix 1.33.1 testing by @jimmidyson in #1164 * build: Update all tools by @jimmidyson in #1165 * refactor: add global feature.Gates variable by @dkoshkin in #1167 * ci: new env variable to set --feature-gates by @dkoshkin in #1166 * build: github.com/hashicorp/go-retryablehttp@v0.7.8 to fix CVE by @jimmidyson in #1170 * docs: Update link to default Cilium values in cni.md by @yannickstruyf3 in #1173 * docs: Fix up Cilium config link (again) & icons by @jimmidyson in #1176 ## New Contributors * @yannickstruyf3 made their first contribution in #1173 **Full Changelog**: v0.29.0...v0.30.0 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Shalin Patel <shalin.patel@nutanix.com>
What problem does this PR solve?:
Implements a preflight check that verifies the Nutanix VM images referenced by the Cluster spec.
The VM IMages check reads various various topology variables, and I have defined a pseudo-check that intializes the variables from the Cluster spec.
The VM Images check also uses a Prism Central API client. I have defined a pseudo-check that initializes this client.
Which issue(s) this PR fixes:
Fixes #
How Has This Been Tested?:
Special notes for your reviewer:
Stacked on #1129
I am working on unit tests. The Nutanix client is difficult to mock, so creating the tests is taking more time than I expected.