chore(k8s): bump patch versions for 1.14 - 1.31 - #393
Merged
Conversation
KCL's auto-generated Kubernetes schema packages up to 1.31 imported the `apimachinery.pkg.apis.meta.v1` module without an alias, which causes schema resolution to fail whenever the parent package is imported via `as <alias>` (the relative-import resolver cannot fall back to the parent-package namespace). Fix by adding `as metav1` to every such import and rewriting in-file `v1.<TypeName>` references to `metav1.<TypeName>`. 1.32+ already uses this pattern and is unaffected. This unblocks downstream users on Windows / older k8s versions (e.g. konfig nginx-example pinned to 1.31.2) and resolves the failure reported in kcl-lang/kcl#2127. Affected: 3308 files across k8s 1.14 -> 1.31. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claude <claude@anthropic.com>
Extend TestK8sPackages to exercise every k8s package version touched by the bare `apimachinery.pkg.apis.meta.v1` import fix. The new networkpolicy case instantiates a NetworkPolicy that depends on both metav1.ObjectMeta (via `metadata`) and metav1.LabelSelector (via `spec.podSelector.matchLabels`), so any future regression on the `metav1` aliasing will surface as a compile or assertion failure. Per-case required-schema gates skip the ingress test for k8s 1.14 - 1.18 because networking.k8s.io/v1 Ingress was only promoted out of v1beta1 in 1.19. Local `go test ./...` reports 67 PASS / 5 SKIP across 20 versions. Signed-off-by: Claude <claude@anthropic.com>
PR #392 rewrote 3308 schema files to fix the bare `apimachinery.pkg.apis.meta.v1` import bug, but the kcl.mod files themselves were left at their old patch versions. Bump every affected package by one patch so users who pin a version (or rely on `kcl mod update`) actually pull the fix. - 1.14.1 -> 1.14.2 - ... - 1.28.1 -> 1.28.2 - 1.31.2 -> 1.31.3 1.32+ and 1.30.x unaffected paths are not touched. Signed-off-by: Claude <claude@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #392.
PR #392 rewrote 3308 schema files to fix the bare
apimachinery.pkg.apis.meta.v1import bug, but thekcl.modfilesthemselves were left at their old patch versions. Users who pin a
specific version (or who rely on
kcl mod updateagainst a registrythat still serves the old tags) would silently stay on the broken
package.
This PR bumps the patch digit on every
k8s/<x.y>/kcl.modwhosecontents were changed by #392:
(Full table of 18 versions in the commit message.)
k8s 1.32+ are untouched because they were never affected by the bug.
Test plan
go test ./...locally is still 67 PASS / 5 SKIP / 0 FAIL acrossthe 20 versions covered by
TestK8sPackages(the test readskcl.modonly as a sanity check; the version bump itself is apure metadata change).