mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
PT-1865 Changed tool name
This commit is contained in:
35
src/go/pt-k8s-debug-collector/main.go
Normal file
35
src/go/pt-k8s-debug-collector/main.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/percona/percona-toolkit/src/go/pt-k8s-debug-collector/dumper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
namespace := ""
|
||||
resource := ""
|
||||
clusterName := ""
|
||||
|
||||
flag.StringVar(&namespace, "namespace", "", "Namespace for collecting data. If empty data will be collected from all namespaces")
|
||||
flag.StringVar(&resource, "resource", "pxc", "Resource name. Default value - 'pxc'")
|
||||
flag.StringVar(&clusterName, "cluster", "", "Cluster name")
|
||||
flag.Parse()
|
||||
|
||||
if len(clusterName) > 0 {
|
||||
resource += "/" + clusterName
|
||||
}
|
||||
|
||||
d := dumper.New("", namespace, resource)
|
||||
log.Println("Start collecting cluster data")
|
||||
|
||||
err := d.DumpCluster()
|
||||
if err != nil {
|
||||
log.Println("Error:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
log.Println("Done")
|
||||
}
|
Reference in New Issue
Block a user