Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛Fix output of clusterctl config provider #2948

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmd/clusterctl/cmd/config_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package cmd
import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/pkg/errors"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -151,10 +153,15 @@ func runGetComponents() error {
func printComponents(c client.Components, output string) error {
switch output {
case ComponentsOutputText:
dir, file := filepath.Split(c.URL())
// Remove the version suffix from the URL since we already display it
// separately.
baseURL, _ := filepath.Split(strings.TrimSuffix(dir, "/"))
fmt.Printf("Name: %s\n", c.Name())
fmt.Printf("Type: %s\n", c.Type())
fmt.Printf("URL: %s\n", c.URL())
fmt.Printf("URL: %s\n", baseURL)
fmt.Printf("Version: %s\n", c.Version())
fmt.Printf("File: %s\n", file)
fmt.Printf("TargetNamespace: %s\n", c.TargetNamespace())
fmt.Printf("WatchingNamespace: %s\n", c.WatchingNamespace())
if len(c.Variables()) > 0 {
Expand Down