mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 18:09:55 +00:00
* bump version Signed-off-by: David Wertenteil <dwertent@armosec.io> * change default view Signed-off-by: David Wertenteil <dwertent@armosec.io> * fixed tests Signed-off-by: David Wertenteil <dwertent@armosec.io> * fixed go mod Signed-off-by: David Wertenteil <dwertent@armosec.io> --------- Signed-off-by: David Wertenteil <dwertent@armosec.io>
46 lines
944 B
Go
46 lines
944 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/kubescape/kubescape/v3/core/cautils"
|
|
"github.com/kubescape/kubescape/v3/core/meta"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
configExample = fmt.Sprintf(`
|
|
# View cached configurations
|
|
%[1]s config view
|
|
|
|
# Delete cached configurations
|
|
%[1]s config delete
|
|
|
|
# Set cached configurations
|
|
%[1]s config set --help
|
|
`, cautils.ExecName())
|
|
setConfigExample = fmt.Sprintf(`
|
|
# Set account id
|
|
%[1]s config set accountID <account id>
|
|
|
|
# Set cloud report URL
|
|
%[1]s config set cloudReportURL <cloud Report URL>
|
|
`, cautils.ExecName())
|
|
)
|
|
|
|
func GetConfigCmd(ks meta.IKubescape) *cobra.Command {
|
|
|
|
// configCmd represents the config command
|
|
configCmd := &cobra.Command{
|
|
Use: "config",
|
|
Short: "Handle cached configurations",
|
|
Example: configExample,
|
|
}
|
|
|
|
configCmd.AddCommand(getDeleteCmd(ks))
|
|
configCmd.AddCommand(getSetCmd(ks))
|
|
configCmd.AddCommand(getViewCmd(ks))
|
|
|
|
return configCmd
|
|
}
|