-
Notifications
You must be signed in to change notification settings - Fork 145
Fix missing "tags" key error when running preprocess_spec on a live OpenShift spec #118
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
Conversation
|
Good catch, also not sure why I'm not seeing it (what version of openshift/kubernetes are you pulling?). Unfortunately there's a gross bit of indirection here, the preprocess_spec.py file you modified is actually generated from the file in the kubernetes generator [1], slightly modified to support the delta for the openshift spec. If you want to modify the scripts/from_gen/preprocess_spec.py file, you'll have to look at the scripts/get_scripts_from_gen.sh and scripts/preprocess_spec.py.stub files. Otherwise, your change will be overwritten next time the scripts are pulled from the kubernetes project. |
|
I'm seeing this error running against OpenShift 3.6. My best guess as to why you haven't seen it is that it's nondeterministic and/or you're running on a different Python version than I am. (This issue appears on 3.6.) The other issue I filed yesterday is definitely nondeterministic and appears only on Python 3.5, AFAICT. The nondeteterminism is coming from hash randomization and iteration over dicts: I had to set PYTHONHASHSEED to track the other issue down. |
|
I sent in a pull request to fix this upstream. I'm going to wait at least a little bit to see if it gets uptake there before I hassle with altering that stub file. If the fix goes in upstream, you should be able to rebuild the files here and push a bugfix release to PyPi? |
|
@ceridwen yeah probably. Might need to tweak some stuff if much has changed but (knock on wood) it should be pretty easy |
|
Good call on pushing changes upstream. |
|
They merged my upstream pull request fixing this and #119. Can you pull in the changes? You can close this pull request and that issue afterwards. |
|
yep, we're working on pulling in the latest changes to client-python now |
|
@ceridwen: PR needs rebase. 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. |
|
We no longer support module generation, the new dynamic client and corresponding k8s module are recommended instead. |
I'm pulling the OpenAPI spec from running OpenShift clusters using the /swagger.json endpoint and introspecting information about the Python client. To make sure the names match, I'm running preprocess_spec.py on it before I examine it. When I do, I get a KeyError when the operation doesn't have the 'tags' key, for instance:
This pull request simply ignores operations without the tags key. I don't know why you don't see this when running this script to generate the client or that this is the right fix. If the issue is something else, I can amend my pull request.