Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit a12295c

Browse files
committed
keep helpful debug logs
1 parent 164da01 commit a12295c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

scripts/overlay/terraform-viable.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ func validateOperationParameters(resource *ResourceInfo, primaryID string, schem
155155

156156
// If the manual mapping points to a valid entity field (including nested), it's acceptable
157157
if checkFieldExistsInEntityWithRefResolution(manualMatch, entityProps, schemas) {
158-
158+
fmt.Printf(" Manual mapping %s -> %s points to valid entity field (including nested)\n", param, manualMatch)
159159
continue
160160
} else {
161-
161+
fmt.Printf(" Manual mapping %s -> %s points to non-existent entity field\n", param, manualMatch)
162162
hasConflictingEntityIDs = true
163163
break
164164
}
@@ -274,39 +274,30 @@ func isSystemProperty(propName string) bool {
274274
func checkFieldExistsInEntityWithRefResolution(fieldPath string, entityProps map[string]interface{}, schemas map[string]interface{}) bool {
275275
parts := strings.Split(fieldPath, ".")
276276

277-
fmt.Printf(" Debug: Checking field path: %s (parts: %v)\n", fieldPath, parts)
278-
279277
currentLevel := entityProps
280278

281279
for i, part := range parts {
282-
fmt.Printf(" Debug: Looking for part '%s' at level %d\n", part, i)
283280

284281
if prop, exists := currentLevel[part]; exists {
285-
fmt.Printf(" Debug: Found part '%s'\n", part)
286282

287283
if i == len(parts)-1 {
288-
fmt.Printf(" Debug: Reached final part, field exists: %s\n", fieldPath)
289284
return true
290285
}
291286

292287
if propMap, ok := prop.(map[string]interface{}); ok {
293288
// Check if it has direct properties
294289
if nestedProps, hasProps := propMap["properties"].(map[string]interface{}); hasProps {
295-
fmt.Printf(" Debug: Found direct properties for '%s'\n", part)
296290
currentLevel = nestedProps
297291
continue
298292
}
299293

300294
// Check if it has a $ref that needs resolution
301295
if ref, hasRef := propMap["$ref"].(string); hasRef {
302-
fmt.Printf(" Debug: Found $ref '%s' for part '%s'\n", ref, part)
303296

304297
resolvedSchema := resolveSchemaRef(ref, schemas)
305298
if resolvedSchema != nil {
306-
fmt.Printf(" Debug: Successfully resolved $ref '%s'\n", ref)
307299

308300
if refProps, hasRefProps := resolvedSchema["properties"].(map[string]interface{}); hasRefProps {
309-
fmt.Printf(" Debug: Found properties in resolved schema\n")
310301
currentLevel = refProps
311302
continue
312303
} else {

0 commit comments

Comments
 (0)