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

Adding option to disable globally applying a proxy to etc/yum.conf #6828

Merged
merged 3 commits into from
Oct 21, 2020

Conversation

wand3r3r
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:
This change allows a user to turn of configuring the proxy setting in the /etc/yum.conf file. When a user has an already proxied yum repository such as Artifactory or Nexus the yum proxy should not be applied.

Which issue(s) this PR fixes:

Fixes #6827

Special notes for your reviewer:
This change should leave the default behavior the same but exposes the setting should a user wish to configure it.

Does this PR introduce a user-facing change?:

Users can configure set the proxy_yum_globally to false if they wish to manage their own yum configuration proxy settings.

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 15, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Oct 15, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @wand3r3r!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @wand3r3r. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 15, 2020
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 15, 2020
Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

/cc @oomichi

@@ -78,6 +78,7 @@
state: "{{ http_proxy | default(False) | ternary('present', 'absent') }}"
no_extra_spaces: true
become: true
when: proxy_yum_globally | bool
Copy link
Contributor

Choose a reason for hiding this comment

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

How about just adding

  when:
    - http_proxy is defined

like the other Linux distribution cases instead of adding a new yum-specific option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That case would be taken care of by the default already in place on line 78. In my use case, I need to define http_proxy for most of the environment. But, I manage the /etc/yum.conf and /etc/yum.repos.d separately due to an internally hosted Yum Proxy service I am required to use. This variable allows me to turn off the yum proxy. So that my preconfigured repo settings still work. Without it, in my environment, Kubespray fails to download any of the preinstall packages because it is trying to reach my internal hosted yum repo using the proxy.

Copy link
Contributor

@oomichi oomichi Oct 16, 2020

Choose a reason for hiding this comment

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

Thanks for your explanation. I got an issue you are fixing.
I agree to add an option to skip using http_proxy for getting necessary OS packages.
One thing is I guess we will want to add other options when using different OS(like Ubuntu) because current option name is RHEL/CentOS specific.
How about more generic name like skip_http_proxy_on_os_packages or something?
It is fine to enable this option for RHEL/CentOS only at this time if don't want to take care of the other OS distributions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can do that

@floryut
Copy link
Member

floryut commented Oct 16, 2020

@wand3r3r Thank you for the PR, could you please sign CLA ?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 16, 2020
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 20, 2020
@oomichi
Copy link
Contributor

oomichi commented Oct 20, 2020

Thanks for updating and taking care of the other distributions!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 20, 2020
@oomichi
Copy link
Contributor

oomichi commented Oct 20, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 20, 2020
@floryut
Copy link
Member

floryut commented Oct 21, 2020

Thank you
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, wand3r3r

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2020
@k8s-ci-robot k8s-ci-robot merged commit f323d70 into kubernetes-sigs:master Oct 21, 2020
@floryut floryut mentioned this pull request Dec 19, 2020
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jan 16, 2021
…ubernetes-sigs#6828)

* Adding option to disable gloablly applying a proxy to etc/yum.conf

* Change made to proxy_yum_globaly basedon reviewer feedback

* fix trailing spaces in ymllint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When user specifies an http_proxy the proxy is always applied to /etc/yum.conf
4 participants