mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
isURL
This commit is contained in:
@@ -66,10 +66,10 @@ func runAnalyzers(v *viper.Viper, bundlePath string) error {
|
||||
}
|
||||
|
||||
func isURL(str string) bool {
|
||||
_, err := url.ParseRequestURI(str)
|
||||
parsed, err := url.ParseRequestURI(str)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return parsed.Scheme != ""
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ func homeDir() string {
|
||||
}
|
||||
|
||||
func isURL(str string) bool {
|
||||
_, err := url.ParseRequestURI(str)
|
||||
parsed, err := url.ParseRequestURI(str)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return parsed.Scheme != ""
|
||||
}
|
||||
|
||||
func createTroubleshootK8sClient(configFlags *genericclioptions.ConfigFlags) (*troubleshootclientv1beta1.TroubleshootV1beta1Client, error) {
|
||||
|
||||
@@ -18,12 +18,12 @@ func homeDir() string {
|
||||
}
|
||||
|
||||
func isURL(str string) bool {
|
||||
_, err := url.ParseRequestURI(str)
|
||||
parsed, err := url.ParseRequestURI(str)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return parsed.Scheme != ""
|
||||
}
|
||||
|
||||
func createTroubleshootK8sClient(configFlags *genericclioptions.ConfigFlags) (*troubleshootclientv1beta1.TroubleshootV1beta1Client, error) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
func Analyze(bundleURL string, analyzers string, outputFormat string, compatibility string) *C.char {
|
||||
logger.SetQuiet(true)
|
||||
|
||||
result, err := analyzer.DownloadAndAnalyze(context.Background(), bundleURL, analyzers)
|
||||
result, err := analyzer.DownloadAndAnalyze(bundleURL, analyzers)
|
||||
if err != nil {
|
||||
fmt.Printf("error downloading and analyzing: %s\n", err.Error())
|
||||
return C.CString("")
|
||||
|
||||
Reference in New Issue
Block a user