Skip to content

fix(ops): restore the ops/client subpath and IngressRoute.ingressClassName - #41

Merged
pyramation merged 1 commit into
mainfrom
feat/ops-client-subpath-shim
Aug 23, 2026
Merged

fix(ops): restore the ops/client subpath and IngressRoute.ingressClassName#41
pyramation merged 1 commit into
mainfrom
feat/ops-client-subpath-shim

Conversation

@pyramation

Copy link
Copy Markdown
Collaborator

Summary

Two regressions in the published @kubernetesjs/ops@1.2.1, both found by typechecking constructive-db against it.

1. @kubernetesjs/ops/client disappeared. #40 deleted packages/ops/src/client.ts because the generated index no longer imports it — but the file was also a public entry point, so constructive-db's reconciler broke with TS2307: Cannot find module '@kubernetesjs/ops/client'. The file comes back as a re-export only, so the transport still lives once, in kubernetesjs:

export * from 'kubernetesjs/client';

The generated index keeps importing kubernetesjs/client directly (unchanged codegen config); nothing routes through the shim except consumers that already imported that subpath.

2. IngressRoute.spec.ingressClassName is missing from the generated types. Traefik added it in traefik/traefik#12313, but scripts/swagger.json is a snapshot of one cluster's CRDs, and that cluster ran an older Traefik — so ops@1.1.0 had the field (its snapshot came from a newer cluster) and 1.2.1 silently dropped it, breaking spec.ingressClassName = … in the reconciler's http-route handler. Rather than depend on which cluster the spec was last fetched from, codegen now pins the field:

patchedSchema.definitions['io.traefik.v1alpha1.IngressRoute'].properties.spec
  .properties.ingressClassName = { type: 'string', description:  };

Like the existing IntOrString patch, this is idempotent and survives a re-fetch of the spec from either an older or a newer cluster.

Regenerated output is exactly one added line (ingressClassName?: string; on TraefikIoV1alpha1IngressRoute); pnpm build and pnpm lint pass, and dist/client.{js,d.ts} is emitted again so the subpath resolves in the published tarball.

Link to Devin session: https://app.devin.ai/sessions/95f4ed628067485ebab80535c50d6e88
Requested by: @pyramation

Restore @kubernetesjs/ops/client as a re-export of the core transport, and patch spec.ingressClassName back onto the Traefik IngressRoute definition.
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@tenki-reviewer

tenki-reviewer Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This PR extends the generated Traefik IngressRoute type with an optional ingressClassName field and adds a small client re-export module.

Files Change
packages/ops/scripts/codegen.ts Adds a codegen patch that injects an optional ingressClassName string property into the IngressRoute spec schema when regenerating the client.
packages/ops/src/index.ts Regenerated output adding ingressClassName?: string to the TraefikIoV1alpha1IngressRoute interface.
packages/ops/src/client.ts New barrel re-exporting from kubernetesjs/client, mirroring existing usage in the generated entry point.

The only candidate finding (a low-confidence suggestion to guard the injection against an already-present field) fell below the confidence threshold and was not retained.

Reviewed commit: 01aa7b4

@pyramation
pyramation merged commit d2bc04b into main Aug 23, 2026
14 checks passed
@pyramation
pyramation deleted the feat/ops-client-subpath-shim branch August 23, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant