-
Notifications
You must be signed in to change notification settings - Fork 28
[DNM] (cluster-bot) Fix Healthy condition not updating from Ironic health data #471
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,8 @@ func (af AvailableFeatures) Log(logger logr.Logger) { | |
| "maxVersion", fmt.Sprintf("1.%d", af.MaxVersion), | ||
| "chosenVersion", af.ChooseMicroversion(), | ||
| "virtualMediaGET", af.HasVirtualMediaGetAPI(), | ||
| "disablePowerOff", af.HasDisablePowerOff()) | ||
| "disablePowerOff", af.HasDisablePowerOff(), | ||
| "healthAPI", af.HasHealthAPI()) | ||
| } | ||
|
|
||
| func (af AvailableFeatures) HasVirtualMediaGetAPI() bool { | ||
|
|
@@ -56,7 +57,15 @@ func (af AvailableFeatures) HasDisablePowerOff() bool { | |
| return af.MaxVersion >= 95 //nolint:mnd | ||
| } | ||
|
|
||
| func (af AvailableFeatures) HasHealthAPI() bool { | ||
| return af.MaxVersion >= 109 //nolint:mnd | ||
| } | ||
|
|
||
| func (af AvailableFeatures) ChooseMicroversion() string { | ||
| if af.HasHealthAPI() { | ||
| return "1.109" | ||
| } | ||
|
Comment on lines
+65
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Confirm global microversion assignment from ChooseMicroversion()
rg -n -C3 'p\.client\.Microversion\s*=\s*p\.availableFeatures\.ChooseMicroversion\(\)' pkg/provisioner/ironic
# 2) List Ironic node operations using the same shared client
rg -n -C2 'nodes\.[A-Za-z_]+\(' pkg/provisioner/ironic
# 3) Check for per-request microversion/header overrides (if any)
rg -n -C2 'X-OpenStack-Ironic-API-Version|OpenStack-API-Version|Microversion' pkg/provisioner/ironicRepository: openshift/baremetal-operator Length of output: 16585 🏁 Script executed: # Find HasHealthAPI() definition and usage
rg -n -B2 -A5 'func.*HasHealthAPI' pkg/provisioner/ironic
# Find health-related operations or API calls
rg -n -i 'health' pkg/provisioner/ironic/clients/features.go
# Check what microversions are involved and their implications
rg -n '1\.10[0-9]' pkg/provisioner/ironicRepository: openshift/baremetal-operator Length of output: 1123 🏁 Script executed: # Search for actual health endpoint/operation calls
rg -n -i 'health' pkg/provisioner/ironic/*.go
# Check if there's any health check method or similar
rg -n 'func.*health|checkHealth|getHealth' pkg/provisioner/ironic -i
# Look for what operations actually require 1.109
rg -n 'GetHealthStatus|health.*status' pkg/provisioner/ironic -iRepository: openshift/baremetal-operator Length of output: 2237 🏁 Script executed: # Get the full implementation of GetHealth()
sed -n '2001,2020p' pkg/provisioner/ironic/ironic.go
# Check what getNode() does (referenced in GetHealth)
rg -n -A10 'func.*getNode\(' pkg/provisioner/ironic/ironic.go | head -30
# Verify if getNode uses the shared client
rg -n 'getNode.*p\.client' pkg/provisioner/ironic/ironic.goRepository: openshift/baremetal-operator Length of output: 945 🏁 Script executed: # Confirm p.client is shared across all methods in the provisioner
rg -n 'p\.client\.' pkg/provisioner/ironic/ironic.go | wc -l
# Check if nodes.Get or any node operation supports per-request microversion override
rg -n 'type.*Opts' pkg/provisioner/ironic --include='*.go' | grep -i 'microversion\|version'
# Look at the client definition to understand if Microversion affects all requests
rg -n 'type.*ServiceClient' pkg/provisioner/ironic -A5Repository: openshift/baremetal-operator Length of output: 532 🏁 Script executed: # Check the p.client field definition
rg -n 'p\.client' pkg/provisioner/ironic/ironic.go -B2 -A2 | head -20
# Look at the provisioner struct definition
rg -n 'type ironicProvisioner struct' pkg/provisioner/ironic/ironic.go -A10
# Check if gophercloud ServiceClient uses global Microversion
rg -n 'ServiceClient' pkg/provisioner/ironic/clients/client.go -B2 -A5Repository: openshift/baremetal-operator Length of output: 1640 🏁 Script executed: # Check if there are comments or documentation about microversion 1.109 compatibility
rg -n '1\.109\|microversion.*compat' pkg/provisioner/ironic -B2 -A2
# Look for any test coverage showing issues with 1.109 on non-health operations
rg -n '1\.109' pkg/provisioner/ironic -l
# Check the baseline/conservative microversion to understand the risk delta
rg -n 'baselineVersionString\|conservative' pkg/provisioner/ironic/clients/client.go -B2 -A2Repository: openshift/baremetal-operator Length of output: 162 🏁 Script executed: # Find baseline/conservative version definition
rg -n 'baselineVersionString\|1\.6\|1\.5' pkg/provisioner/ironic/clients/client.go -B2 -A2
# Get context around client initialization with versions
sed -n '85,105p' pkg/provisioner/ironic/clients/client.goRepository: openshift/baremetal-operator Length of output: 304 🏁 Script executed: # Find baselineVersionString definition
rg -n 'baselineVersionString\s*=' pkg/provisioner/ironic/clients/client.go -B2 -A2
# Also check the constants file
rg -n 'const.*Version' pkg/provisioner/ironic/clients/ -B1 -A1Repository: openshift/baremetal-operator Length of output: 54 🏁 Script executed: # Read the beginning of client.go to find baselineVersionString
head -30 pkg/provisioner/ironic/clients/client.go
# Also check imports and constants
rg -n 'baselineVersionString' pkg/provisioner/ironic/clients/client.goRepository: openshift/baremetal-operator Length of output: 1005 🏁 Script executed: # Search all files in the package for baselineVersionString definition
rg -n 'baselineVersionString' pkg/provisioner/ironic/ -A1 -B1
# Check if it's defined in features.go or elsewhere
fd '\.go$' pkg/provisioner/ironic/clients | xargs grep -l 'baselineVersionString'Repository: openshift/baremetal-operator Length of output: 1227 🏁 Script executed: # Find the baseline constant definition
rg -n 'const.*baseline\|baseline\s*=' pkg/provisioner/ironic/clients/features.go -B2 -A2
# Get broader context around baseline and baselineVersionString
sed -n '1,30p' pkg/provisioner/ironic/clients/features.goRepository: openshift/baremetal-operator Length of output: 1082 Global switch to When 🤖 Prompt for AI Agents |
||
|
|
||
| if af.HasDisablePowerOff() { | ||
| return "1.95" | ||
| } | ||
|
|
||
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.
This turns condition recomputation into two extra Ironic reads per loop.
computeConditions()now runs on every reconcile, and for the ironic provisioner it calls bothHasPowerFailure()andGetHealth(). Inpkg/provisioner/ironic/ironic.go, both methods do their owngetNode(ctx)lookup, so steady-state hosts pick up two additional node reads every cycle. Please cache the node-backed condition data per reconcile or plumb a single status snapshot intocomputeConditions. As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."🤖 Prompt for AI Agents