Skip to content

Commit

Permalink
Merge pull request #2948 from wfernandes/fix-config-provider-output
Browse files Browse the repository at this point in the history
🐛Fix output of clusterctl config provider
  • Loading branch information
k8s-ci-robot committed Apr 23, 2020
2 parents 29dd8f3 + 43eede2 commit 18ce96a
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 18ce96a

Please sign in to comment.