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

Fix chicken and egg problem with proxy_env not defined on the first … #5896

Merged

Conversation

alexkross
Copy link
Contributor

@alexkross alexkross commented Apr 5, 2020

…envinronment usage.

What type of PR is this?

/kind api-change

/kind bug

/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:
Confguration with proxy defined fails.

Which issue(s) this PR fixes:
Errors on the first task that uses role: kubespray-defaults and have environment: "{{ proxy_env }}. Messages are meaningless:

PLAY [k8s-cluster:etcd] *****************************************************************************************************************************************************
Tuesday 07 April 2020  08:51:31 +0300 (0:00:01.332)       0:04:03.124 *********

TASK [Gathering Facts] ******************************************************************************************************************************************************
fatal: [i9kv1]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}
fatal: [i0k8s1-11]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}
fatal: [i0k8s1-12]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}
fatal: [i0k8s1-13]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}
fatal: [i0k8s1-15]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}
fatal: [i0k8s1-14]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}
fatal: [i0k8s1-16]: FAILED! => {"msg": "The field 'environment' has an invalid value, which includes an undefined variable. The error was: 'None' has no attribute 'get'"}

Fixes #

Special notes for your reviewer:
it's not the best solution, just works.

Does this PR introduce a user-facing change?:
NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 5, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @alexkross. 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 requested review from bozzo and holmsten April 5, 2020 21:31
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 5, 2020
@alexkross
Copy link
Contributor Author

/assign @ant31

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 7, 2020
@Miouge1 Miouge1 added this to the 2.13 milestone Apr 8, 2020
@Miouge1
Copy link
Contributor

Miouge1 commented Apr 8, 2020

Looks good to me.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexkross, Miouge1

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit 910a821 into kubernetes-sigs:master Apr 8, 2020
erulabs added a commit to kubesail/kubespray that referenced this pull request Apr 9, 2020
* 'master' of https://github.com/kubernetes-sigs/kubespray: (21 commits)
  Remove hard-coded dependance to docker.service in kubelet.service file (kubernetes-sigs#5917)
  Update Calico to v3.13.2, Multus to v3.4.1. Add ConfigMap get permission to allow calico-node access to kubeadm config. (kubernetes-sigs#5912)
  Fix idempotence issue in bootstrap-os (kubernetes-sigs#5916)
  Terraform/OpenStack: Fix idempotency bug in module.network.openstack_networking_router_interface_v2.k8s[0] (kubernetes-sigs#5914)
  Add kubernetes 1.18.1 hashes (kubernetes-sigs#5915)
  Proxy fixes (kubernetes-sigs#5869)
  Remove 1.16.x flag for tf-ovh_coreos-calico (now 1.17 ready) (kubernetes-sigs#5853)
  Update docker RHEL/CentOS versions to the latest patch versions available. (kubernetes-sigs#5872)
  Fix conntrack for opensuse and docker support (kubernetes-sigs#5880)
  Add crictl 1.18.0 hashes for k8s 1.18 (kubernetes-sigs#5877)
  fix readonly flexvolume in fcos and coreos (kubernetes-sigs#5885)
  Fix scaling (kubernetes-sigs#5889)
  Fix chicken and egg problem with proxy_env not defined on the first … (kubernetes-sigs#5896)
  make explicit that doc is at kubespray.io (kubernetes-sigs#5878)
  add local-path-provosioner helper image def (kubernetes-sigs#5817)
  remove unused kubelet options (kubernetes-sigs#5903)
  Change docker.io repo to variable and upgrade alb image (kubernetes-sigs#5898)
  Replace latest tags for csi drivers (kubernetes-sigs#5899)
  CentOS 8 CI (kubernetes-sigs#5842)
  Bump requirements.txt versions / remove ansible_python_interpreter hack (kubernetes-sigs#5847)
  ...
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Apr 18, 2020
…kubernetes-sigs#5896)

* Fix chicken and egg problem with proxy_env not defined on the first envinronment usage.

* Disable fact gathering for the first proxy_env evaluation.

* Move proxy_env var set up from the role defaults to the root playbooks as fact.
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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants