Skip to content

Commit 3e878d0

Browse files
authored
(feature): add api handlers_deletion
(feature): add api handlers_deletion
2 parents a79331d + 1b27491 commit 3e878d0

File tree

209 files changed

+877
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+877
-289
lines changed

pkg/agent/agent_dependency_resolver.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,23 @@ func (a *StateAwareAgent) resolveDependencyReference(reference string) (string,
127127
}
128128
}
129129

130-
// Check for primary resource ID mapping
131-
resourceID, exists := a.resourceMappings[stepID]
132-
a.mappingsMutex.RUnlock()
133-
134-
// If mapping exists return it directly
135-
if exists {
136-
return resourceID, nil
130+
// Check for primary resource ID mapping (only if requestedField is "resourceId" or default)
131+
if requestedField == "resourceId" {
132+
resourceID, exists := a.resourceMappings[stepID]
133+
a.mappingsMutex.RUnlock()
134+
135+
// If mapping exists return it directly
136+
if exists {
137+
return resourceID, nil
138+
}
139+
} else {
140+
a.mappingsMutex.RUnlock()
137141
}
138142

139143
// For all other cases (no mapping exists OR specific field requested), resolve from infrastructure state
140-
if a.testMode && !exists {
144+
if a.testMode {
141145
// In test mode, avoid accessing real state - rely only on stored mappings
142-
return "", fmt.Errorf("dependency reference not found in test mode: %s (step ID: %s not found in resource mappings)", reference, stepID)
146+
return "", fmt.Errorf("dependency reference not found in test mode: %s (step ID: %s, field: %s not found in resource mappings)", reference, stepID, requestedField)
143147
}
144148

145149
// Resolve from infrastructure state (handles both missing mappings and specific field requests)

0 commit comments

Comments
 (0)