Description
Dell iDRACs use two distinct write patterns: PATCH for DellAttributes and POST for actions like certificate import. This sub-task implements attribute partitioning and idempotent POST handling with drift detection.
Changes
-
partitionAttributes in redfish_dell.go — splits the incoming SettingsAttributes map into two groups:
- PATCH group: keys that map to DellAttributes endpoints (standard key-value pairs)
- POST group: keys with the 3-field format
"POST <action-url> <check-collection-url>" indicating an action that creates/replaces a collection member
-
3-field POST key format — "POST /redfish/v1/.../ImportCertificate /redfish/v1/.../Certificates":
- Field 1: literal
POST
- Field 2: the action URL to POST to
- Field 3: the collection URL to check for existing members (drift detection)
-
buildPostKey(actionURL, collectionURL) — constructs the 3-field key from components.
-
hashRequestBody(body) — SHA-256 hash of the POST request body, stored as the ETag equivalent for POST operations (since POST responses from Dell don't return ETags).
-
POST drift detection — before issuing a POST, check if the target collection already has a member whose body hash matches. If it does, the operation is a no-op (idempotent). This prevents duplicate certificate imports.
-
Dell SetBMCAttributesImmediately — orchestrates both groups: PATCH attributes via httpBasedUpdateBMCAttributes, POST attributes via action URL, returns unified map[string]ApplyResult.
-
Dell GetBMCAttributeValues — wires through to detectSettingsDrift for PATCH attributes; for POST attributes, checks collection member existence.
Tests
TestBuildPostKey — key construction and parsing
TestHashRequestBody — deterministic hash
TestPartitionAttributes — correct grouping of PATCH vs POST keys
- POST idempotency: duplicate POST detected via body hash → no re-POST
Files
bmc/redfish_dell.go (partition logic, POST orchestration, drift detection)
bmc/oem_helpers.go (buildPostKey, hashRequestBody, POST handling in update path)
bmc/oem_helpers_test.go (tests for this PR's scope)
Acceptance Criteria
Description
Dell iDRACs use two distinct write patterns: PATCH for DellAttributes and POST for actions like certificate import. This sub-task implements attribute partitioning and idempotent POST handling with drift detection.
Changes
partitionAttributesinredfish_dell.go— splits the incomingSettingsAttributesmap into two groups:"POST <action-url> <check-collection-url>"indicating an action that creates/replaces a collection member3-field POST key format —
"POST /redfish/v1/.../ImportCertificate /redfish/v1/.../Certificates":POSTbuildPostKey(actionURL, collectionURL)— constructs the 3-field key from components.hashRequestBody(body)— SHA-256 hash of the POST request body, stored as the ETag equivalent for POST operations (since POST responses from Dell don't return ETags).POST drift detection — before issuing a POST, check if the target collection already has a member whose body hash matches. If it does, the operation is a no-op (idempotent). This prevents duplicate certificate imports.
Dell
SetBMCAttributesImmediately— orchestrates both groups: PATCH attributes viahttpBasedUpdateBMCAttributes, POST attributes via action URL, returns unifiedmap[string]ApplyResult.Dell
GetBMCAttributeValues— wires through todetectSettingsDriftfor PATCH attributes; for POST attributes, checks collection member existence.Tests
TestBuildPostKey— key construction and parsingTestHashRequestBody— deterministic hashTestPartitionAttributes— correct grouping of PATCH vs POST keysFiles
bmc/redfish_dell.go(partition logic, POST orchestration, drift detection)bmc/oem_helpers.go(buildPostKey,hashRequestBody, POST handling in update path)bmc/oem_helpers_test.go(tests for this PR's scope)Acceptance Criteria
POSTprefix are routed to action URL, not PATCHmake testgreen