Skip to content

Commit

Permalink
removed path check as kubectl is handling path in it (#5648)
Browse files Browse the repository at this point in the history
* removed this check as kubectl is handling path in it
* added changelog
* removed test file

Signed-off-by: laxmikantbpandhare <[email protected]>
  • Loading branch information
laxmikantbpandhare authored Apr 12, 2022
1 parent 831a71a commit b6e67cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 72 deletions.
5 changes: 5 additions & 0 deletions changelog/fragments/remove-error-thrown-for-proxy-path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
entries:
- description: >
Previously we added this error to show the user that the Path component is part of proxy server. Now, kubectl made this fix that handles this case and there is no need to throw this error anymore.
kind: addition
breaking: false
19 changes: 0 additions & 19 deletions internal/cmd/ansible-operator/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"errors"
"flag"
"fmt"
"net/url"
"os"
"runtime"
"strconv"
Expand Down Expand Up @@ -112,11 +111,6 @@ func run(cmd *cobra.Command, f *flags.Flags) {
os.Exit(1)
}

if err := verifyCfgURL(cfg.Host); err != nil {
log.Error(err, "URL verification failed.")
os.Exit(1)
}

// TODO(2.0.0): remove
// Deprecated: OPERATOR_NAME environment variable is an artifact of the
// legacy operator-sdk project scaffolding. Flag `--leader-election-id`
Expand Down Expand Up @@ -295,19 +289,6 @@ func run(cmd *cobra.Command, f *flags.Flags) {
log.Info("Exiting.")
}

// verifyCfgURL verifies the path component of api endpoint
// passed through the config.
func verifyCfgURL(path string) error {
urlPath, err := url.Parse(path)
if err != nil {
return fmt.Errorf("failed to parse the path in URL %v", err)
}
if urlPath != nil && urlPath.Path != "" && urlPath.Path != "/" {
return 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)
}
return nil
}

// exitIfUnsupported prints an error containing unsupported field names and exits
// if any of those fields are not their default values.
func exitIfUnsupported(options manager.Options) {
Expand Down
53 changes: 0 additions & 53 deletions internal/cmd/ansible-operator/run/cmd_test.go

This file was deleted.

0 comments on commit b6e67cc

Please sign in to comment.