You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
k8s import: kyverno.io Policy becomes K8s::Iam::Policy and the build changes its apiVersion #5071
Found with chant 0.124.95 while reading a clone of kubernetes/k8s.io at commit 2b3d9153 offline, for #5067.
chant import maps kind: Policy with apiVersion: kyverno.io/v1 to the lexicon's Policy class, which is K8s::Iam::Policy. The build then writes apiVersion: iam.services.k8s.aws/v1alpha1, and WK8501 reports unknown field "spec.background" and "spec.rules".
Files: kubernetes/aks-prow-build/prow/kyverno.yaml, kubernetes/eks-prow-build/prow/kyverno.yaml and the two kubernetes/ibm-*/prow/kyverno.yaml.
The round trip changes the apiVersion of a resource with no warning, so a build of the imported source would apply a different kind from the one in the file.
Wanted: class resolution matches on API group and kind together, never on kind alone. A kind whose group has no class is handled as in the unknown-kind case (untyped, with a warning).
Not planned: this no longer reproduces on current code.
On main plus #5075, chant import of the kubernetes/k8s.io kyverno files writes ibm-ppc64le/prow/kyverno.yaml (Policy, kyverno.io/v1) as k8sManifest({ apiVersion: "kyverno.io/v1", kind: "Policy", ... }), with the warning that Policy (kyverno.io/v1) has no class in the lexicon. chant build of that output keeps apiVersion: kyverno.io/v1, kind: Policy, and WK8501 does not fire. ClusterPolicy behaves the same.
The cause is gone with #5070. exportedClassFor accepts a lexicon class only when its resourceType equals the type the parser built from the group (K8s::Kyverno::Policy), so the packaged Policy entry for K8s::Iam::Policy (iam.services.k8s.aws/v1alpha1) is no longer picked. No other path checked maps a bare kind to a class: the serializer's resolveGVK, projectKindForType, deriveGVKFromType, operation-surface and index-import all key on the full K8s::<Group>::<Kind> type. The issue was found on 0.124.95, before #5070.
While checking this, infra/gcp/bash/namespaces/namespace.yml (name: {{name}}) crashed the import in toLogicalId. It now imports with a warning that metadata.name is a mapping, likely a template placeholder. That fix goes into the next chant batch.
Activity
lex00 commentedon Nov 15, 2026
Not planned: this no longer reproduces on current code.
On main plus #5075,
chant importof thekubernetes/k8s.iokyverno files writesibm-ppc64le/prow/kyverno.yaml(Policy,kyverno.io/v1) ask8sManifest({ apiVersion: "kyverno.io/v1", kind: "Policy", ... }), with the warning thatPolicy (kyverno.io/v1)has no class in the lexicon.chant buildof that output keepsapiVersion: kyverno.io/v1,kind: Policy, and WK8501 does not fire.ClusterPolicybehaves the same.The cause is gone with #5070.
exportedClassForaccepts a lexicon class only when itsresourceTypeequals the type the parser built from the group (K8s::Kyverno::Policy), so the packagedPolicyentry forK8s::Iam::Policy(iam.services.k8s.aws/v1alpha1) is no longer picked. No other path checked maps a bare kind to a class: the serializer'sresolveGVK,projectKindForType,deriveGVKFromType,operation-surfaceandindex-importall key on the fullK8s::<Group>::<Kind>type. The issue was found on 0.124.95, before #5070.While checking this,
infra/gcp/bash/namespaces/namespace.yml(name: {{name}}) crashed the import intoLogicalId. It now imports with a warning thatmetadata.nameis a mapping, likely a template placeholder. That fix goes into the next chant batch.fix(k8s): chant import warns on a metadata.name that is not a string …
feat: estate-read batch 4, lint and import fixes, YAML emit, Grafana …