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

kubernetes-validate 1.28.1 fails to import #27

Closed
faust64 opened this issue Dec 11, 2023 · 4 comments
Closed

kubernetes-validate 1.28.1 fails to import #27

faust64 opened this issue Dec 11, 2023 · 4 comments

Comments

@faust64
Copy link

faust64 commented Dec 11, 2023

Hi,

I am using Ansible kubernetes module, with some "validate" option that relies on kubernetes-validate
https://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_module.html#parameter-validate

As of upgrading kubernetes-validate from 1.27.1 to 1.28.1, I noticed my playbooks would fail with an error such as

failed to import the required Python library (kubernetes-validate) on [my_hostname]'s Python /usr/bin/python3. Please read the module documentation and installl it in the appropriate location ... if the module is installed ... consult the documentation on ansible_python_interpreter)

I did attempt to rebuild that image, same issue showing.

Using ansible core, 2.15.0.
Python 3.9.18 and Python 3.11.15 are present in image.
When I do some ansible --version, python 3.9 is the one in use ... while in doubt, all "pip install" we have building this image would run for both python versions, ... I can confirm pip3.9 list and pip3.11 list would both show kubernetes-validate to be installed.

Downgrading to 1.28.0, my playbooks are happy with this.
I'm not yet sure what could be wrong here ... In doubt asking here, does this ring a bell?!

@willthames
Copy link
Owner

Hi @faust64 ok, I've reproduced this - I missed a dependency in the most recent merged PR.

The quick fix is to install the typing_extensions module.

I'll release a fixed 1.28.2 shortly that adds the dependency on that module (and also see if I can work out how to add a test for that kind of problem)

@faust64
Copy link
Author

faust64 commented Dec 12, 2023

oh, great! thanks a lot!

@willthames
Copy link
Owner

#28 fixed this problem (including a change to the test suite so that this is less likely to happen in future) and I've just pushed 1.28.2 to pypi

@faust64
Copy link
Author

faust64 commented Dec 12, 2023

looks great, thanks again!

@faust64 faust64 closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants