From f5063e56d1ddba4a705e90303f827bd05ed48a87 Mon Sep 17 00:00:00 2001 From: Ygal Blum Date: Tue, 31 Mar 2026 17:34:40 -0400 Subject: [PATCH] Fix resource_id extraction from wrong map level in catalog instance table resource_id is a top-level field on the instance response, not nested under spec. Extract it from the top-level map instead. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Ygal Blum --- internal/commands/catalog_instance.go | 4 +--- internal/commands/catalog_instance_test.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/commands/catalog_instance.go b/internal/commands/catalog_instance.go index c2c810a..ad926bc 100644 --- a/internal/commands/catalog_instance.go +++ b/internal/commands/catalog_instance.go @@ -20,16 +20,14 @@ var catalogInstanceTableDef = &output.TableDef{ return []string{"", "", "", "", ""} } var catalogItemID string - var resourceID string if spec, ok := m["spec"].(map[string]any); ok { catalogItemID = stringifyValue(spec, "catalog_item_id") - resourceID = stringifyValue(spec, "resource_id") } return []string{ stringifyValue(m, "uid"), stringifyValue(m, "display_name"), catalogItemID, - resourceID, + stringifyValue(m, "resource_id"), stringifyValue(m, "create_time"), } }, diff --git a/internal/commands/catalog_instance_test.go b/internal/commands/catalog_instance_test.go index dbb62ed..188b1e3 100644 --- a/internal/commands/catalog_instance_test.go +++ b/internal/commands/catalog_instance_test.go @@ -20,9 +20,9 @@ func sampleInstanceResponse() map[string]any { "uid": "c3d4e5f6-a7b8-9012-cdef-123456789012", "display_name": "My App Instance", "create_time": "2026-03-09T10:00:00Z", + "resource_id": "res-abc123", "spec": map[string]any{ "catalog_item_id": "my-catalog-item", - "resource_id": "res-abc123", }, } }