fleet/infrastructure/kubequery/cmd/gentables/main.go
Lucas Manuel Rodriguez 3b2e97db89
Move kubequery dependency to monorepo (#16027)
#15561

We didn't find a way to preserve history of the original fork (see
[here](https://github.com/fleetdm/fleet/issues/15561#issuecomment-1883473504),
thus we are moving it with one commit.

The second commit updates a reference.
2024-01-11 08:30:26 -03:00

39 lines
893 B
Go

/**
* Copyright (c) 2020-present, The kubequery authors
*
* This source code is licensed as defined by the LICENSE file found in the
* root directory of this source tree.
*
* SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only)
*/
package main
import (
"fmt"
"github.com/Uptycs/kubequery/internal/k8s/tables"
)
func main() {
tbls := tables.GetTables()
fmt.Printf("{\n \"tables\": [")
for j, t := range tbls {
fmt.Printf(" {\n \"name\": \"%s\",\n \"columns\": [\n", t.Name)
for i, c := range t.Columns {
fmt.Printf(" {\n \"name\": \"%s\",\n \"type\": \"%s\"\n", c.Name, c.Type)
if i < len(t.Columns)-1 {
fmt.Printf(" },\n")
} else {
fmt.Printf(" }\n")
}
}
fmt.Printf(" ]\n")
if j < len(tbls)-1 {
fmt.Printf(" },\n")
} else {
fmt.Printf(" }\n")
}
}
fmt.Printf(" ]\n}")
}