Skip to content

Commit 18ce96a

Browse files
authored
Merge pull request #2948 from wfernandes/fix-config-provider-output
🐛Fix output of clusterctl config provider
2 parents 29dd8f3 + 43eede2 commit 18ce96a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: cmd/clusterctl/cmd/config_provider.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package cmd
1919
import (
2020
"fmt"
2121
"os"
22+
"path/filepath"
23+
"strings"
2224

2325
"github.com/pkg/errors"
2426
"github.com/spf13/cobra"
@@ -151,10 +153,15 @@ func runGetComponents() error {
151153
func printComponents(c client.Components, output string) error {
152154
switch output {
153155
case ComponentsOutputText:
156+
dir, file := filepath.Split(c.URL())
157+
// Remove the version suffix from the URL since we already display it
158+
// separately.
159+
baseURL, _ := filepath.Split(strings.TrimSuffix(dir, "/"))
154160
fmt.Printf("Name: %s\n", c.Name())
155161
fmt.Printf("Type: %s\n", c.Type())
156-
fmt.Printf("URL: %s\n", c.URL())
162+
fmt.Printf("URL: %s\n", baseURL)
157163
fmt.Printf("Version: %s\n", c.Version())
164+
fmt.Printf("File: %s\n", file)
158165
fmt.Printf("TargetNamespace: %s\n", c.TargetNamespace())
159166
fmt.Printf("WatchingNamespace: %s\n", c.WatchingNamespace())
160167
if len(c.Variables()) > 0 {

0 commit comments

Comments
 (0)