kubernetes-client / gen

Common generator scripts for all client libraries
Apache License 2.0
150 stars 147 forks source link

Update preprocess_spec.py to handle if 'name' doesn't exist. #250

Closed brendandburns closed 10 months ago

brendandburns commented 10 months ago
--- Downloading and pre-processing OpenAPI spec
/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py:842: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn((
Traceback (most recent call last):
  File "//preprocess_spec.py", line 543, in <module>
    sys.exit(main())
  File "//preprocess_spec.py", line 537, in main
    out_spec = process_swagger(in_spec, args.client_language, crd_mode)
  File "//preprocess_spec.py", line 196, in process_swagger
    apply_func_to_spec_operations(spec, strip_delete_collection_operation_watch_params)
  File "//preprocess_spec.py", line 71, in apply_func_to_spec_operations
    if func(v[op], v, *params):
  File "//preprocess_spec.py", line 107, in strip_delete_collection_operation_watch_params
    paramName = op['parameters'][i]['name']
KeyError: 'name'

https://github.com/kubernetes-client/javascript/actions/runs/6214469452/job/16866433360

k8s-ci-robot commented 10 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns

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: - ~~[OWNERS](https://github.com/kubernetes-client/gen/blob/master/OWNERS)~~ [brendandburns] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
brendandburns commented 10 months ago

@yliaog

yliaog commented 10 months ago

what is the recent change that caused this? just curious.

/lgtm

brendandburns commented 10 months ago

@yliaog this was me trying to run this on the Kubernetes 1.28 openapi schema. I haven't dug into the schema to figure out where/how the problem was introduced.

yliaog commented 10 months ago

Got it. Thanks for the info.