feat(resource-value-verification): add apiserver resval trace log (task 4.2)
One logger.Debug("resource-location stored", ...) call in
OnResourceLocationUpdated, immediately after store.ResourceLocations.Put,
logging resource/host/value as zap fields. Debug-level only, matches this
package's existing logging convention (reuses convert.go's field names).
Live-confirmed against a real deployment with logging.level: debug.
Also surfaced (but did not fix, out of boundary - pure Go change, no
possible causal link) a pre-existing xce_test segfault on string-typed
resupdate (type/model) - uninitialized stack memory, non-deterministic,
invisible to ASan. Logged as bug-1574; flagged in tasks.md as a risk for
task 7.1's default resource set and task 8.1's live e2e run.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
04ecfa5cc1
commit
8b4fbffa51
2 changed files with 24 additions and 1 deletions
|
|
@ -92,6 +92,26 @@ func (h *DefaultHandler) OnResourceUpdated(res *models.ResourceDefinitionInfo) {
|
|||
func (h *DefaultHandler) OnResourceLocationUpdated(res *models.ResourceDistributionInfo) {
|
||||
key := res.ResourceName + ":" + res.Location
|
||||
store.ResourceLocations.Put(key, *res)
|
||||
|
||||
// resource-value-verification task 4.2 (Requirements 5.1, 5.2, 5.4): trace
|
||||
// the stored value at its point of application, mirroring the scheduler's
|
||||
// sibling trace log added in task 4.1 (core_events.c). One typed "value"
|
||||
// field carrying whichever of StringValue/NumericValue/BooleanValue is
|
||||
// live for res.ValueType, so a downstream grep sees exactly what was
|
||||
// stored, not every possibly-zero field on the struct.
|
||||
var valueField zap.Field
|
||||
switch res.ValueType {
|
||||
case int(models.STRING):
|
||||
valueField = zap.String("value", res.StringValue)
|
||||
case int(models.BOOLEAN):
|
||||
valueField = zap.Bool("value", res.BooleanValue)
|
||||
default:
|
||||
valueField = zap.Float64("value", res.NumericValue)
|
||||
}
|
||||
logger.Debug("resource-location stored",
|
||||
zap.String("resource", res.ResourceName),
|
||||
zap.String("host", res.Location),
|
||||
valueField)
|
||||
}
|
||||
|
||||
// dispatchJobArray delivers a locally-expanded compact array push to the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue