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

Several kubectl fixes #40882

Merged
merged 2 commits into from
Jul 11, 2018
Merged

Several kubectl fixes #40882

merged 2 commits into from
Jul 11, 2018

Conversation

selslack
Copy link
Contributor

SUMMARY

Fixes several bugs which make use of kubectl connection impossible.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

k8s / kubectl

ANSIBLE VERSION
ansible 2.5.3
  config file = /Users/~~~/ansible/ansible.cfg
  configured module search path = ['/Users/~~~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/~~~/ansible/env/lib/python3.6/site-packages/ansible
  executable location = /Users/~~~/ansible/env/bin/ansible
  python version = 3.6.4 (default, Mar 20 2018, 23:32:11) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
ADDITIONAL INFORMATION

Fixes these errors when using k8s inventory and kubectl connection:

Typo in inventory parsing:

 [WARNING]:  * Failed to parse /Users/~~~/ansible/inventory/k8s.yml with auto plugin: list indices must be integers or slices, not str
  
  ...
  File "/Users/~~~/ansible/env/lib/python3.6/site-packages/ansible/module_utils/k8s/inventory.py", line 71, in fetch_objects
    namespaces = connections['namespaces']

Absence of --namespace parameter when executing command on pods from non-default namespace:

<~~~> EXEC ['/usr/local/bin/kubectl', 'exec', '-I', '~~~', '-c', '~~~', '--', '/bin/sh', '-c', "/bin/sh -c 'echo ~None && sleep 0'"]

Invalid temp directory (note None):

<~~~> EXEC ['/usr/local/bin/kubectl', '-n', '~~~', 'exec', '-I', '~~~', '-c', '~~~', '--', '/bin/sh', '-c', '/bin/sh -c \'( umask 77 && mkdir -p "` echo ~None/.ansible/tmp/ansible-tmp-1527688125.119122-3174488126227 `" && echo ansible-tmp-1527688125.119122-3174488126227="` echo ~None/.ansible/tmp/ansible-tmp-1527688125.119122-3174488126227 `" ) && sleep 0\'']

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 30, 2018
@s-hertel s-hertel removed needs_triage Needs a first human triage before being processed. python3 labels Jun 1, 2018
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 9, 2018
@ansibot
Copy link
Contributor

ansibot commented Jul 11, 2018

@fabianvf
Copy link
Contributor

shipit

@willthames willthames merged commit 2a90bea into ansible:devel Jul 11, 2018
@willthames
Copy link
Contributor

Merged, thanks @selslack

@dagwieers dagwieers added the k8s label Feb 8, 2019
@ansible ansible locked and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. k8s new_contributor This PR is the first contribution by a new community member. small_patch stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants