mirror of
https://github.com/containers/kubernetes-mcp-server.git
synced 2025-10-23 01:22:57 +03:00
feat(output)!: default list-output changed from yaml to table
This commit is contained in:
@@ -118,7 +118,7 @@ func flagInit() {
|
||||
rootCmd.Flags().StringP("sse-base-url", "", "", "SSE public base URL to use when sending the endpoint message (e.g. https://example.com)")
|
||||
rootCmd.Flags().StringP("kubeconfig", "", "", "Path to the kubeconfig file to use for authentication")
|
||||
rootCmd.Flags().String("profile", "full", "MCP profile to use (one of: "+strings.Join(mcp.ProfileNames, ", ")+")")
|
||||
rootCmd.Flags().String("list-output", "yaml", "Output format for resource lists (one of: "+strings.Join(output.Names, ", ")+")")
|
||||
rootCmd.Flags().String("list-output", "table", "Output format for resource lists (one of: "+strings.Join(output.Names, ", ")+")")
|
||||
rootCmd.Flags().Bool("read-only", false, "If true, only tools annotated with readOnlyHint=true are exposed")
|
||||
rootCmd.Flags().Bool("disable-destructive", false, "If true, tools annotated with destructiveHint=true are disabled")
|
||||
_ = viper.BindPFlags(rootCmd.Flags())
|
||||
|
||||
@@ -52,13 +52,13 @@ func TestListOutput(t *testing.T) {
|
||||
t.Fatalf("Expected all available outputs, got %s %v", out, err)
|
||||
}
|
||||
})
|
||||
t.Run("default", func(t *testing.T) {
|
||||
t.Run("defaults to table", func(t *testing.T) {
|
||||
rootCmd.SetArgs([]string{"--version", "--log-level=1"})
|
||||
rootCmd.ResetFlags()
|
||||
flagInit()
|
||||
out, err := captureOutput(rootCmd.Execute)
|
||||
if !strings.Contains(out, "- ListOutput: yaml") {
|
||||
t.Fatalf("Expected list-output 'yaml', got %s %v", out, err)
|
||||
if !strings.Contains(out, "- ListOutput: table") {
|
||||
t.Fatalf("Expected list-output 'table', got %s %v", out, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user