You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/cmd/ansible-operator/run/cmd.go
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -105,15 +105,8 @@ func run(cmd *cobra.Command, f *flags.Flags) {
105
105
os.Exit(1)
106
106
}
107
107
108
-
urlPath, err:=url.Parse(cfg.Host)
109
-
110
-
iferr!=nil {
111
-
log.Error(err, "Failed to Parse the Path URL.")
112
-
os.Exit(1)
113
-
}
114
-
115
-
ifurlPath!=nil&&urlPath.Path!="" {
116
-
log.Error(fmt.Errorf("api endpoint '%s' contains a path component, which the proxy server is currently unable to handle properly. Work on this issue is being tracked here: https://github.com/operator-framework/operator-sdk/issues/4925", cfg.Host), "")
108
+
iferr:=verifyCfgURL(cfg.Host); err!=nil {
109
+
log.Error(err, "Failed toverify config endpoint")
117
110
os.Exit(1)
118
111
}
119
112
@@ -153,7 +146,6 @@ func run(cmd *cobra.Command, f *flags.Flags) {
@@ -280,6 +272,21 @@ func run(cmd *cobra.Command, f *flags.Flags) {
280
272
log.Info("Exiting.")
281
273
}
282
274
275
+
// verifyCfgURL verifies the path component of api endpoint
276
+
// passed through the config.
277
+
funcverifyCfgURL(pathstring) error {
278
+
urlPath, err:=url.Parse(path)
279
+
iferr!=nil {
280
+
log.Error(err, "Failed to Parse the Path URL.")
281
+
returnerr
282
+
}
283
+
ifurlPath!=nil&&urlPath.Path!="" {
284
+
log.Error(fmt.Errorf("api endpoint '%s' contains a path component, which the proxy server is currently unable to handle properly. Work on this issue is being tracked here: https://github.com/operator-framework/operator-sdk/issues/4925", path), "")
285
+
returnerr
286
+
}
287
+
returnnil
288
+
}
289
+
283
290
// exitIfUnsupported prints an error containing unsupported field names and exits
284
291
// if any of those fields are not their default values.
0 commit comments