Skip to content

Commit 8a1bb8a

Browse files
committed
isURL
1 parent 14ace52 commit 8a1bb8a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cmd/analyze/cli/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func runAnalyzers(v *viper.Viper, bundlePath string) error {
6666
}
6767

6868
func isURL(str string) bool {
69-
_, err := url.ParseRequestURI(str)
69+
parsed, err := url.ParseRequestURI(str)
7070
if err != nil {
7171
return false
7272
}
7373

74-
return true
74+
return parsed.Scheme != ""
7575
}

cmd/preflight/cli/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ func homeDir() string {
1717
}
1818

1919
func isURL(str string) bool {
20-
_, err := url.ParseRequestURI(str)
20+
parsed, err := url.ParseRequestURI(str)
2121
if err != nil {
2222
return false
2323
}
2424

25-
return true
25+
return parsed.Scheme != ""
2626
}
2727

2828
func createTroubleshootK8sClient(configFlags *genericclioptions.ConfigFlags) (*troubleshootclientv1beta1.TroubleshootV1beta1Client, error) {

cmd/troubleshoot/cli/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ func homeDir() string {
1818
}
1919

2020
func isURL(str string) bool {
21-
_, err := url.ParseRequestURI(str)
21+
parsed, err := url.ParseRequestURI(str)
2222
if err != nil {
2323
return false
2424
}
2525

26-
return true
26+
return parsed.Scheme != ""
2727
}
2828

2929
func createTroubleshootK8sClient(configFlags *genericclioptions.ConfigFlags) (*troubleshootclientv1beta1.TroubleshootV1beta1Client, error) {

ffi/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
func Analyze(bundleURL string, analyzers string, outputFormat string, compatibility string) *C.char {
1919
logger.SetQuiet(true)
2020

21-
result, err := analyzer.DownloadAndAnalyze(context.Background(), bundleURL, analyzers)
21+
result, err := analyzer.DownloadAndAnalyze(bundleURL, analyzers)
2222
if err != nil {
2323
fmt.Printf("error downloading and analyzing: %s\n", err.Error())
2424
return C.CString("")

0 commit comments

Comments
 (0)