mirror of
https://github.com/vee1e/kubearmor-client.git
synced 2026-09-01 18:28:04 +00:00
29 lines
763 B
Go
29 lines
763 B
Go
// SPDX-License-Identifier: Apache-2.0
|
|
// Copyright 2021 Authors of KubeArmor
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"github.com/kubearmor/kubearmor-client/sysdump"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var dumpOptions sysdump.Options
|
|
|
|
// sysdumpCmd represents the get command
|
|
var sysdumpCmd = &cobra.Command{
|
|
Use: "sysdump",
|
|
Short: "Collect system dump information for troubleshooting and error report",
|
|
Long: `Collect system dump information for troubleshooting and error reports`,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
if err := sysdump.Collect(client, dumpOptions); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(sysdumpCmd)
|
|
sysdumpCmd.Flags().StringVarP(&dumpOptions.Filename, "file", "f", "", "output file to use")
|
|
}
|