Skip to content

Regenerate both clients with openapi-generator 7.25.0 - #2684

Merged
kubernetes-prow[bot] merged 2 commits into
kubernetes-client:masterfrom
yurnov:regen-openapi-generator-7.25.0
Aug 25, 2026
Merged

Regenerate both clients with openapi-generator 7.25.0#2684
kubernetes-prow[bot] merged 2 commits into
kubernetes-client:masterfrom
yurnov:regen-openapi-generator-7.25.0

Conversation

@yurnov

@yurnov yurnov commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

Regenerates both clients with openapi-generator v7.25.0 (released 2026-08-24), up from the 830e9d15 master snapshot. Sync and asyncio move together, as @yliaog asked on #2681.

The motivating fix is #24716: Configuration resolved the environment proxy once in __init__, before load_kube_config assigns host. Because the scheme-specific proxy depends on the host, HTTPS_PROXY was silently ignored — at construction host is "", so urlparse("").scheme is "" and neither https nor http matched. The proxy is now re-resolved when host is assigned, and an explicitly set proxy still wins.

Upstream changes that reach the generated code:

PR Effect Sync Asyncio
#24716 Re-resolve the environment proxy when host is assigned — fixes #2681
#24539 Native proxy_ssl_context support (requested in #2387)
#23992 Honour content-type parameters when preparing a request
#24357 Null handling in generated models
#24359 Serialize booleans as lowercase in all parameter styles
#24718 Deserialize Optional[...] instead of raising AttributeError

#24716 and #24539 land only on the sync side — they change the urllib3-based templates, which the aiohttp-based asyncio client does not use.

#24357 accounts for the bulk of the diff and is a behaviour fix, not churn. The old template dropped falsy items entirely, in both list and map serialization:

for _item in self.conditions:
    if _item:
        _items.append(_to_openapi_value(_item))

so a 0, "", or False element silently vanished from the serialized output. It now emits None only for genuine None:

_items.append(_to_openapi_value(_item) if _item is not None else None)

scripts/swagger.json is byte-identical, so every change here is generator-driven; no spec drift is mixed in.

Which issue(s) this PR fixes:

Fixes #2681

Also delivers the proxy_ssl_context support requested in #2387 (already closed).

Special notes for your reviewer:

Requires kubernetes-client/gen#310, which pins openapi/python.sh and openapi/python-aio.sh to v7.25.0. That merged on 2026-08-25, so both trees here reproduce from a clean checkout using gen's current defaults.

Where to look. The diff is large (523 files over two commits) but almost entirely mechanical regeneration. The only hand-written changes are:

  • scripts/client_go_retry_patch.diff and scripts/client_go_retry_asyncio_patch.diff — regenerated with context lines
  • scripts/rest_client_patch.diff — regenerated with context lines
  • scripts/update-client.sh and scripts/update-client-asyncio.sh — dropping --unidiff-zero

Everything else is generator output.

The local patches needed refreshing, and one case is worth showing. rest_client_patch.diff failed loudly, because #23992 rewrote the line it anchored on — that is the good outcome. client_go_retry_patch.diff did not. Its hunks were zero-context pure insertions (@@ -359,0 +360,16 @@), and with no context lines git apply --unidiff-zero has nothing to match — it inserts at the recorded offset unconditionally. This bump adds eight lines to configuration.py above that offset, so replaying the old patch on the new output gives:

$ git apply --unidiff-zero scripts/client_go_retry_patch.diff
$ echo $?
0

…while having inserted the block at line 360 instead of 368, in the middle of the proxy_ssl_context docstring:

        self.proxy_ssl_context = proxy_ssl_context
        """SSL context used only for the TLS handshake with the proxy itself
        (e.g. an HTTPS CONNECT tunnel), independent of the destination TLS
        self.client_go_retries = False          # <-- landed here

Here the corruption happens to produce a SyntaxError, so it would be caught — but by compileall or the test run, pointing at generated code rather than at the patch that broke it. A smaller shift would just as easily produce valid code in the wrong scope.

Both patches are regenerated with normal context and --unidiff-zero is dropped from update-client.sh and update-client-asyncio.sh.

On the asyncio patch specifically: it still applies correctly on this bump, because the changes above it are confined to the urllib3 templates. Refreshing it is hardening rather than a fix — happy to drop that hunk of the change if you would rather keep it minimal.

AI Assistance Disclosure: This code was developed with the assistance of Claude Opus 5 (claude-opus-5). The author has reviewed, tested, and takes full responsibility for the logic and changes

Verification

All run in a container:

  • compileall clean over kubernetes/ (sync + asyncio)
  • sync kubernetes/test + kubernetes/base: 246 passed, 14 skipped, 99 subtests
  • asyncio kubernetes/aio/test: 951 passed, 6 subtests
  • Both refreshed patches apply with no fuzz to pristine generated output and reproduce the committed files byte-for-byte
  • Clean-room round-trip: fresh clone, both regeneration scripts run against gen master with OPENAPI_GENERATOR_COMMIT unset, gives zero diff outside doc/ — so the tree is reproducible and no hand-maintained content is lost on regeneration
  • HTTP_PROXY/HTTPS_PROXY ignored by load_kube_config(): proxy scheme resolved before the host is known #2681 confirmed end-to-end, with and without the environment set:
$ HTTPS_PROXY=... HTTP_PROXY=... NO_PROXY=.internal
host unset at construction : '' -> proxy None
after https host assigned  : 'http://secure-proxy.example:8888'
after http host assigned   : 'http://plain-proxy.example:8080'
no_proxy                   : '.internal'
explicit proxy survives    : 'http://explicit.example'
explicit None stays None   : None

$ (no proxy environment)
after https host assigned  : None

Follow-ups deliberately left out

  • rest.py still compares the content type by exact string when coercing application/json-patch+json to strategic merge; with #23992 available that could move to contenttype_matches(), but it is a behaviour change and does not belong in a regeneration PR.

Does this PR introduce a user-facing change?

Fixed `load_kube_config` ignoring the `HTTPS_PROXY`/`HTTP_PROXY` environment variables. The environment proxy is now re-resolved when `Configuration.host` is assigned, so it is selected against the actual cluster URL rather than an empty host. Both the synchronous and asyncio clients are regenerated with openapi-generator 7.25.0, which also adds `proxy_ssl_context` support, honours content-type parameters when preparing requests, serializes booleans in query parameters as lowercase, and no longer drops falsy items from serialized lists and maps.

yurnov added 2 commits August 24, 2026 17:24
Picks up the load_kube_config environment-proxy fix (#2681), native
proxy_ssl_context support (#2387), content-type parameter handling,
lowercase boolean query parameters, and null-preserving list and map
serialization.

Regenerate the local patches against the new output. The client-go
retry patch now carries context lines: its zero-context hunks applied
at fixed offsets, so lines added above them by the generator shift the
insertion point without failing the apply.
Keeps the asyncio client on the same generator release as the
synchronous one, as requested on #2681.

Regenerate client_go_retry_asyncio_patch.diff with context lines and
drop --unidiff-zero. Its hunks were pure insertions at fixed offsets,
so generator drift above them moves the insertion point while git apply
still reports success.
@kubernetes-prow kubernetes-prow Bot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 24, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog August 24, 2026 16:35
@yurnov

yurnov commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

This PR in status Draft until kubernetes-client/gen#310 is merged

@yliaog
yliaog marked this pull request as ready for review August 25, 2026 03:32
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2026
@yliaog

yliaog commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

thanks for the PR

kubernetes-client/gen#310 has merged.

/lgtm
/approve

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 25, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yliaog, yurnov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 917b311 into kubernetes-client:master Aug 25, 2026
10 checks passed
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP_PROXY/HTTPS_PROXY ignored by load_kube_config(): proxy scheme resolved before the host is known

2 participants