From 494d1ff28f637c9f4c509619d30e85b065c296d6 Mon Sep 17 00:00:00 2001 From: DongHo Jung Date: Mon, 3 Jun 2024 23:16:28 +0900 Subject: [PATCH] Fix inconsistent columns for Kubernetes CRDs (#229) --- kubernetes/table_kubernetes_custom_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index b19fe22..8af9b6a 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -50,9 +50,9 @@ func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec int allColumns := []string{"name", "uid", "kind", "api_version", "namespace", "creation_timestamp", "labels", "start_line", "end_line", "path", "source_type", "annotations", "context_name"} // add the spec columns - flag := 0 schemaSpec := versionSchemaSpec.(v1.JSONSchemaProps) for k, v := range schemaSpec.Properties { + flag := 0 for _, specColumn := range allColumns { if specColumn == strcase.ToSnake(k) { flag = 1 @@ -78,9 +78,9 @@ func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec int } // add the status columns - flag = 0 schemaStatus := versionSchemaStatus.(v1.JSONSchemaProps) for k, v := range schemaStatus.Properties { + flag := 0 for _, statusColumn := range allColumns { if statusColumn == strcase.ToSnake(k) { flag = 1