Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed path check as kubectl is handling path in it #5648

Merged
merged 3 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.