Skip to content

feat: add prompt to proceed if http proxy is set and https proxy unset #2186

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

screspod
Copy link
Member

@screspod screspod commented May 23, 2025

What this PR does / why we need it:

Installation fails if http_proxy is configured but https_proxy is not set.
This PR adds the following confirmation prompt before proceeding with an installation:

Typically if `http_proxy` is set, `https_proxy` should be set too. Installation failures are likely otherwise. Do you want to continue anyway? (y/N)

Which issue(s) this PR fixes:

https://app.shortcut.com/replicated/story/121629/prompt-if-http-proxy-is-set-but-not-https-proxy

Does this PR require a test?

Unit tests have been added to verify:

  • http_proxy set without https_proxy and user confirms (inputs y) proceeding with installation
  • http_proxy set without https_proxy and user declines (inputs n) proceeding with installation

Does this PR require a release note?

Added confirmation prompt to prevent installation failures when `http_proxy` is set but `https_proxy` is missing.

Does this PR require documentation?

NONE

Copy link

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-909c56b" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-909c56b?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

@screspod screspod marked this pull request as ready for review May 23, 2025 22:29
Copy link
Member

@emosbaugh emosbaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving the change but I would wait for feedback from @ajp-io on the ux and copy

@@ -99,6 +101,20 @@ func getProxySpec(cmd *cobra.Command) (*ecv1beta1.ProxySpec, error) {
}
}

// Check if user only provided HTTP proxy but not HTTPS proxy
if httpProxy != "" && httpsProxy == "" {
message := "Typically if `http_proxy` is set, `https_proxy` should be set too. Installation failures are likely otherwise. Do you want to continue anyway?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message := "Typically if `http_proxy` is set, `https_proxy` should be set too. Installation failures are likely otherwise. Do you want to continue anyway?"
message := "Typically --https-proxy should be set if --http-proxy is set. Installation failures are likely otherwise. Do you want to continue anyway?"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at your loom, this prints out before the message about a required flag (--license) missing. generally i think errors due to missing flags should be shown first since this is an informational warning that someone could ignore. so i would prefer for this check to occur after the required flags are looked at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants