Repository navigation
Tags
Tags
Group the CLI help by mode instead of one flat flag list (#66) With the rvtools subcommand sharing a single flag set, -h listed every flag as if all of them applied everywhere: -source looked like a global option, and the vCenter connection flags looked meaningful for an export-based run. The help is now grouped — rvtools flags, vCenter connection and collection, verification, output and filtering, other — and adapts to the active mode: 'esx-hcl-check rvtools -h' shows the subcommand usage line and hides the connection flags it ignores, while the bare form documents both modes. Long usage strings are wrapped rather than printed as 200-character lines. A catch-all section prints any flag not assigned to a group, so a flag added later cannot silently vanish from the help; a test covers that path directly. The README parameter table is split along the same boundaries. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Match GPUs by VID:DID against the GPU guide, not by name (#52 F438 ) PR #50 routed GPUs to the sptg GPU guide but matched by device-model keyword, which is fragile: the sptg keyword search ANDs tokens, so a host name like "NVIDIA H100 NVL PCIe 94GB" (guide: "NVIDIA H100 NVL") returned count=0 -> a false FALSE, and short tokens collide ("L4" also matches "L40"/"L40S"), so the count>0 + release-in-body verdict could be satisfied by a sibling model. Match by exact VID:DID instead. The sptg response carries VID/DID per row (hoverData) and the whole guide is ~63 rows, so fetch it once, build map["vid:did"] -> supported ESXi releases, and verify each GPU by its PCI VID:DID against that row's release list (exact match). The sptg filter endpoint ignores vid/did server-side, hence the fetch-all-then-join. - gpuHCL index + verdict(); parseGpuHCL (reads hoverData VID/DID + esxVersion, skips VID/DID-less SXM/NVSwitch rows); loadGpuHCL fetches once via the bounded Broadcom client with a truncation warning. - Fetched only when the inventory has a GPU and we're online. -offline -> SKIPPED; a failed fetch -> ERROR (undetermined), never a false FALSE. - Fetch time folded into stats broadcom_hcl_query_ms. Live-verified through the real loadGpuHCL against the customer's fleet: A40, H100 NVL PCIe 94GB, H200 NVL, L4, L40S all TRUE for ESXi 9.1 (all FALSE for 7.0); iLO5 VGA (Matrox BMC) correctly FALSE. Tests: verdict matrix, parser (incl. VID/DID-less skip + malformed-body error). Closes #51 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Match driver cert by version when host reports no driver name (#47) (#48 ) RAID/SAS/block HBAs on ESXi 9.1+ report a driverVersion via the raw SOAP call but no module name, so driver_name was empty and the matcher — which gated the version comparison on the driver name — left driver_certified at N/A even when the version exactly matched an HCL entry. - Extract the <driver> module name in parseHBAFirmwareFromSOAP and carry it into RAID/block HBA inventory entries. - Add a version-only fallback in evaluateVsanPCI: when the host reports a driver version but no name, match on version against the already PCI-matched device's supported drivers. Name matching stays enforced when a name is present, so this is not a blanket pass. Closes #47 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Add govc-style connection/TLS flags that override env vars (#46) Mirror the existing -dc/-cluster pattern (flag defaults to its GOVC_* env var, an explicit flag wins) for the connection and TLS inputs, for govc parity: -u GOVC_URL -k GOVC_INSECURE -tls-ca-certs GOVC_TLS_CA_CERTS -tls-known-hosts GOVC_TLS_KNOWN_HOSTS connectToVC no longer reads os.Getenv for these directly; it takes a connOptions struct built from the resolved flag values, so the flag-overrides-env precedence lives in one place (the flag declarations) and the path stays unit-testable. configureTLSFromEnv becomes configureTLS, taking the resolved CA-certs/known-hosts values; GOVC_TLS_HANDSHAKE_TIMEOUT stays env-only (govc exposes no flag for it), as does username/password (no secrets on the command line). Insecure-mode warnings now key off the resolved value and name both the env var and the flag. README documents the flag/env pairs and precedence. Closes #45 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
CI: add gofmt + golangci-lint gates (#42) * Add gofmt + golangci-lint CI gates and fix errcheck findings (#41) Adds a lint job to CI: a gofmt gate and golangci-lint v1.64.8 (default linters). golangci-lint flagged 5 errcheck issues, fixed here: - queryBroadcomAPI: a malformed JSON response now returns CertError (undetermined) rather than silently falling through - saveRawInventory: propagate the temp-file write error instead of dropping it - two client.Logout calls and one test json.Unmarshal marked explicitly ignored (_ =) The tree is gofmt-clean (from the hardening pass), so the gofmt gate passes. Closes #41 * CI: compile golangci-lint from source (goinstall) for Go 1.26 The prebuilt golangci-lint v1.64.8 binary is built with Go 1.24 and errors out ("the Go language version used to build golangci-lint is lower than the targeted Go version (1.26)") on this go 1.26 module. install-mode: goinstall compiles the linter with the CI's own Go toolchain, so it always matches the module's Go version. Refs #41
Add .exe to the Windows SLSA build output name (#36) The v0.4.1-rc2 dry run produced esx-hcl-check-windows-amd64 with no extension — the SLSA Go builder does not auto-append .exe for goos=windows (unlike the old workflow). Windows users need the .exe suffix to run it. Set the Windows config's binary to esx-hcl-check-{{ .Os }}-{{ .Arch }}.exe so the release asset is esx-hcl-check-windows-amd64.exe as before. The rc2 build otherwise validated end to end: binaries + *.intoto.jsonl provenance attached, -version stamped correctly, and slsa-verifier reports PASSED. Refs #27
Refresh the README for v0.4.0 (Architecture rewrite + stale-bit fixes) ( #26) * Rewrite README Architecture section for current capabilities (#25) The old "vSAN Offline DB & Firmware Limitations" section was stale — it claimed NIC firmware requires esxcli (now read via govmomi pNIC props) and predated the 9.1 SOAP path, cross-host dedup, timeouts/retry, atomic cache writes, the typed verdicts, and offline mode. Rewritten from scratch as "How Verification Works": - Leads with the no-esxcli design constraint - Phase 1 collection with the real firmware/driver sources (pNIC, NVMe topology + PCIe HBA + 9.1 SOAP, FC/RAID via 9.1 SOAP else Issues, NVMe vendor tokenization, CPUID decode) - Phase 2 two-source verification: vSAN DB matrices (driver/firmware verdicts, supported_* lists, -mismatch, prefix matching) then live API fallback (baseline only, timeouts + retry + cross-host dedup) - vSAN DB caching (auto-download, 24h refresh, atomic + integrity check, -vsanhcl, -offline) - A certification-status vocabulary table (TRUE/FALSE/N/A/ERROR/SKIPPED) Docs only. Closes #25 * Refresh remaining stale README bits for v0.4.0 (#25) - Intro: drop the "clear TRUE or FALSE" claim (there are now five verdicts: TRUE/FALSE/N/A/ERROR/SKIPPED) and note the no-esxcli design, parallel collection, CI/CD exit code, and air-gapped operation - Document the previously-missing -vspherejson flag in the parameters table - Fence the exclude.json example as json (was bash) - Trim a trailing space in the Downloads heading Docs only. Refs #25 * Add a CI/CD exit-code gating usage example (#25) Demonstrates the findings-based exit code (0/1/2) driving a pipeline, matching the intro's CI/CD gating claim. Docs only. Refs #25
v0.3.0: breaking schema + contract changes (bundle) (#12) * Fix HostComponents JSON tags to snake_case (#11) HostComponents serialized Datacenter/Cluster/Hostname/Results as PascalCase and Issues as "Issues", inconsistent with every other struct in the -json output (device_type, hw_certified, ...). Align them to snake_case: datacenter, cluster, hostname, results, issues. Breaking: top-level -json field names change. Refs #11 * Add source (vCenter) identifier to output schema (#11) Add a "source" field to RawHostData and HostComponents, populated from the connected vCenter's SDK host (client.Client.URL().Host, which carries no credentials). Surfaced as a "vCenter:" line in the text header and a "source" key in JSON. This reserves the schema slot now so future multi-vCenter/batch work adds data under an existing field instead of forcing another breaking reshape. The aggregated (-unique) result intentionally leaves source empty since it spans sources. Refs #11 * Surface skipped hosts and clusters instead of dropping them (#11) extractHostHardware previously returned nil both when the property collector errored and when a host was not connected, so a host we had no visibility into (RBAC/network) looked identical to one that was simply powered off — and both vanished from the output entirely. cluster.Hosts and standalone cr.Hosts enumeration errors were also silently swallowed. - Add a skip_reason field to RawHostData and HostComponents - extractHostHardware now returns a populated skip record distinguishing "property-collector-error: <err>" from "host not connected (state: X)" - collectVSphereData records a skipped entry for cluster/standalone host enumeration failures (commonly missing permissions) rather than continue - performHCLChecks short-circuits skipped hosts (no hardware to evaluate) - printText prints a SKIPPED line; applyFilters always keeps skipped hosts visible so -unsupported/-mismatch don't hide them - skip_reason is emitted in JSON via the schema Refs #11 * Route diagnostics to stderr, keep only report data on stdout (#11) Progress lines ("# Connecting...", "# Collecting...", "# Raw inventory saved..."), the -release argument error, and the vSAN DB load warning all went to stdout, mixing diagnostics with the actual text report. Anyone piping or redirecting stdout got diagnostics interleaved with their data. Route all of these to stderr via fmt.Fprintln/Fprintf(os.Stderr, ...). printText's report content (headers, table, Issues) and printJSON's JSON remain the only things on stdout. Message format is unchanged; structured logging (slog) can layer on later without another contract change. Verified: with -release missing, stdout is empty and the error is on stderr. Breaking: consumers parsing progress lines from stdout must read stderr. Refs #11 * Replace cert string sentinels with a typed CertStatus (#11) The certification fields were plain strings holding "TRUE"/"FALSE"/"N/A" plus an "ERROR" sentinel returned by queryBroadcomAPI on network/parse failure. Because "ERROR" shared the same string space as the real verdicts and was easy to miscompare, a transient Broadcom failure could read like a definitive "not certified" — a trust bug for a compliance tool. - Add CertStatus (CertNA/CertTrue/CertFalse/CertError) with String, MarshalJSON, and UnmarshalJSON that preserve the historical "TRUE"/"FALSE"/"N/A"/"ERROR" wire values, so -json output is unchanged - Change HCLResult.Certified/DriverCertified/FirmwareCertified to CertStatus; queryBroadcomAPI now returns CertStatus (CertError, not a string) so a failed lookup is type-distinct from CertFalse - Update the applyFilters comparisons to the typed constants - Add committed guardrail tests for String/Marshal/Unmarshal and for the preserved JSON wire format (first tests in the repo; run by CI) Internal type change; JSON wire values preserved. Refs #11 * Make exit codes reflect scan findings (#11) The tool exited 0 on any successful scan regardless of findings, so it could not be used as a CI/CD pre-upgrade gate without parsing output. Introduce a findings-based exit code: 0 = all components certified (or N/A) 1 = at least one component definitively NOT certified 2 = scan could not be fully determined (a host/cluster was skipped, or an HCL lookup returned CertError), or a fatal run error occurred - computeExitCode derives 0/1/2 from the full result set, computed before -unique/-filters drop entries so status always reflects true findings; 2 takes precedence over 1 - Fatal run errors (connect/collect/save) and the -release usage error now exit 2 (previously log.Fatalf/os.Exit(1)); dropped the now-unused log import - Add committed guardrail tests for the 0/1/2 mapping and precedence Breaking: exit-code contract changes. Refs #11 * Document exit codes, output streams, and skipped hosts (#11) Add README sections for the v0.3.0 behavior changes: the 0/1/2 exit-code contract for CI/CD gating, the stdout (report only) vs stderr (diagnostics) split, and the new skip_reason/source fields for hosts that can't be scanned. Refs #11
Add bounded retry/backoff to Broadcom HCL calls (#10) The vSAN DB download and the per-device compatibility-guide query each failed outright on any transient error — a network blip, a 429, or a 5xx. Because queryBroadcomAPI runs per device, a momentary hiccup could decertify hardware that a retry would have confirmed. - doBroadcomWithRetry: issue a request through broadcomHTTPClient with bounded exponential backoff (3 attempts; 500ms base, doubling). The request is rebuilt fresh per attempt so POST bodies replay safely. - isRetryableStatus: retry only on transport errors and 429/500/502/503/ 504; return immediately on success or any non-retryable status (e.g. 4xx) so callers' existing status handling is unchanged. - Wire both call sites (loadVsanHCL GET, queryBroadcomAPI POST) through the helper. Non-breaking: no change to -json or -text output schema. Closes #9 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
PreviousNext